diff options
author | Simon Schampijer <simon@laptop.org> | 2013-02-15 12:53:05 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2013-02-15 14:53:16 (GMT) |
commit | 50ee1896b108409cd886a16229ab53921d7d9b22 (patch) | |
tree | 815fe934c3048749bdaaef791a64da20ab1b27dc | |
parent | 0b1a76ca6ff4a2b6fd2a047ca64c70ccbf27f7b0 (diff) |
Journal sorting button: hide/show on click or touch
Using the 'toggle_palette' property of the Palette invoker
we get the behaviour for hiding/showing the Palette when
clicking or touching the button. We need to set the
'hide_tooltip_on_click' property of the ToolButton to False
in that case. This is the same behaviour as the Frame icons,
see the WirelessDeviceView for a similar case of a ToolButton
with that behaviour.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r-- | src/jarabe/journal/journaltoolbox.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py index e87da2d..f20b6ed 100644 --- a/src/jarabe/journal/journaltoolbox.py +++ b/src/jarabe/journal/journaltoolbox.py @@ -107,8 +107,6 @@ class MainToolbox(ToolbarBox): tool_item.show() self._sorting_button = SortingButton() - self._sorting_button.connect('clicked', - self.__sorting_button_clicked_cb) self.toolbar.insert(self._sorting_button, -1) self._sorting_button.connect('sort-property-changed', self.__sort_changed_cb) @@ -226,9 +224,6 @@ class MainToolbox(ToolbarBox): def __sort_changed_cb(self, button): self._update_if_needed() - def __sorting_button_clicked_cb(self, button): - self._sorting_button.palette.popup(immediate=True, state=1) - def _update_if_needed(self): new_query = self._build_query() if self._query != new_query: @@ -559,6 +554,9 @@ class SortingButton(ToolButton): self.props.tooltip = _('Sort view') self.props.icon_name = 'view-lastedit' + self.props.hide_tooltip_on_click = False + self.palette_invoker.props.toggle_palette = True + menu_box = PaletteMenuBox() self.props.palette.set_content(menu_box) menu_box.show() |