diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2013-04-10 18:38:08 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2013-04-10 18:38:08 (GMT) |
commit | 7659a5b3a6f1d3f9ccb90557d4fe7854c712510d (patch) | |
tree | d0c90258ece0073522dc5c4e254fa711a6d7ef2f | |
parent | e3fe946a657b27bc0844137ecc18d77f1b81f90f (diff) |
Reorganize toolbar to solve fall out of stop buton when rotated - SL#3832
The highlight button is moved to the edition subtoolbar,
and a invisible separator is replaced by a small margin after the label.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r-- | readactivity.py | 18 | ||||
-rw-r--r-- | readtoolbar.py | 9 |
2 files changed, 14 insertions, 13 deletions
diff --git a/readactivity.py b/readactivity.py index 701d3aa..f77ec25 100644 --- a/readactivity.py +++ b/readactivity.py @@ -182,6 +182,10 @@ class ReadActivity(activity.Activity): toolbar_box.toolbar.insert(edit_toolbar_button, -1) edit_toolbar_button.show() + self._highlight = self._edit_toolbar.highlight + self._highlight_id = self._highlight.connect( + 'clicked', self.__highlight_cb) + self._view_toolbar = ViewToolbar() self._view_toolbar.connect('go-fullscreen', self.__view_toolbar_go_fullscreen_cb) @@ -215,28 +219,16 @@ class ReadActivity(activity.Activity): self._total_page_label = Gtk.Label() total_page_item.add(self._total_page_label) self._total_page_label.show() + self._total_page_label.set_margin_right(5) toolbar_box.toolbar.insert(total_page_item, -1) total_page_item.show() - spacer = Gtk.SeparatorToolItem() - spacer.set_size_request(0, -1) - spacer.props.draw = False - toolbar_box.toolbar.insert(spacer, -1) - spacer.show() - self._bookmarker = ToggleToolButton('emblem-favorite') self._bookmarker_toggle_handler_id = self._bookmarker.connect( \ 'toggled', self.__bookmarker_toggled_cb) self._bookmarker.show() toolbar_box.toolbar.insert(self._bookmarker, -1) - self._highlight = ToggleToolButton('format-text-underline') - self._highlight.set_tooltip(_('Highlight')) - self._highlight.props.sensitive = False - self._highlight_id = self._highlight.connect('clicked', \ - self.__highlight_cb) - toolbar_box.toolbar.insert(self._highlight, -1) - self.speech_toolbar_button = ToolbarButton(icon_name='speak') toolbar_box.toolbar.insert(self.speech_toolbar_button, -1) diff --git a/readtoolbar.py b/readtoolbar.py index c4dc2d6..435da1c 100644 --- a/readtoolbar.py +++ b/readtoolbar.py @@ -71,6 +71,15 @@ class EditToolbar(BaseEditToolbar): self.insert(self._next, -1) self._next.show() + separator = Gtk.SeparatorToolItem() + separator.show() + self.insert(separator, -1) + + self.highlight = ToggleToolButton('format-text-underline') + self.highlight.set_tooltip(_('Highlight')) + self.highlight.props.sensitive = False + self.insert(self.highlight, -1) + def set_view(self, view): self._view = view self._view.find_set_highlight_search(True) |