Remove redundant state argument from PaletteWindow.popup

This commit is contained in:
Aleksey Lim 2009-08-01 13:34:42 +00:00
parent e799649f2f
commit 7d76f06ae1
2 changed files with 5 additions and 4 deletions

View File

@ -318,7 +318,7 @@ class PaletteWindow(gtk.Window):
def get_full_size_request(self): def get_full_size_request(self):
return self.size_request() return self.size_request()
def popup(self, immediate=False, state=None): def popup(self, immediate=False):
if self._invoker is not None: if self._invoker is not None:
full_size_request = self.get_full_size_request() full_size_request = self.get_full_size_request()
self._alignment = self._invoker.get_alignment(full_size_request) self._alignment = self._invoker.get_alignment(full_size_request)
@ -365,7 +365,7 @@ class PaletteWindow(gtk.Window):
self.on_invoker_leave() self.on_invoker_leave()
def _invoker_right_click_cb(self, invoker): def _invoker_right_click_cb(self, invoker):
self.popup(immediate=True, state=self.SECONDARY) self.popup(immediate=True)
def __enter_notify_event_cb(self, widget, event): def __enter_notify_event_cb(self, widget, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR and \ if event.detail != gtk.gdk.NOTIFY_INFERIOR and \

View File

@ -93,6 +93,7 @@ class ToolbarButton(ToolButton):
return return
if box.expanded_button is not None: if box.expanded_button is not None:
# need to redraw it to erase arrow
expanded_toolitem = box.expanded_button.page_widget.toolbar_button expanded_toolitem = box.expanded_button.page_widget.toolbar_button
if expanded_toolitem.window is not None: if expanded_toolitem.window is not None:
expanded_toolitem.window.invalidate_rect(None, True) expanded_toolitem.window.invalidate_rect(None, True)
@ -216,14 +217,14 @@ class _ToolbarPalette(PaletteWindow):
requisition.width = max(requisition.width, requisition.width = max(requisition.width,
gtk.gdk.screen_width()) gtk.gdk.screen_width())
def popup(self, immediate=False, state=None): def popup(self, immediate=False):
button = self.toolbar_button button = self.toolbar_button
if button.is_expanded(): if button.is_expanded():
return return
box = button.toolbar_box box = button.toolbar_box
_setup_page(button.page_widget, style.COLOR_BLACK.get_gdk_color(), _setup_page(button.page_widget, style.COLOR_BLACK.get_gdk_color(),
box.props.padding) box.props.padding)
PaletteWindow.popup(self, immediate, state) PaletteWindow.popup(self, immediate)
def __group_popdown_cb(self, group): def __group_popdown_cb(self, group):
if self._focus == 0: if self._focus == 0: