Circular dependecy in ToolbarBox #1389
This commit is contained in:
parent
ac586e5a85
commit
93d65bcb2f
@ -46,7 +46,7 @@ class ToolbarButton(ToolButton):
|
|||||||
def get_page(self):
|
def get_page(self):
|
||||||
if self.page_widget is None:
|
if self.page_widget is None:
|
||||||
return None
|
return None
|
||||||
return _unembed_page(self.page_widget)
|
return _get_embedded_page(self.page_widget)
|
||||||
|
|
||||||
def set_page(self, page):
|
def set_page(self, page):
|
||||||
if page is None:
|
if page is None:
|
||||||
@ -61,13 +61,13 @@ class ToolbarButton(ToolButton):
|
|||||||
|
|
||||||
page = gobject.property(type=object, getter=get_page, setter=set_page)
|
page = gobject.property(type=object, getter=get_page, setter=set_page)
|
||||||
|
|
||||||
def is_paletted(self):
|
def is_in_palette(self):
|
||||||
return self.page is not None and \
|
return self.page is not None and \
|
||||||
self.page_widget.parent == self.props.palette
|
self.page_widget.parent == self.props.palette
|
||||||
|
|
||||||
def is_expanded(self):
|
def is_expanded(self):
|
||||||
return self.page is not None and \
|
return self.page is not None and \
|
||||||
not self.is_paletted()
|
not self.is_in_palette()
|
||||||
|
|
||||||
def popdown(self):
|
def popdown(self):
|
||||||
if self.props.palette is not None:
|
if self.props.palette is not None:
|
||||||
@ -99,7 +99,7 @@ class ToolbarButton(ToolButton):
|
|||||||
box.pack_start(self.page_widget)
|
box.pack_start(self.page_widget)
|
||||||
|
|
||||||
def _move_page_to_palette(self):
|
def _move_page_to_palette(self):
|
||||||
if self.is_paletted():
|
if self.is_in_palette():
|
||||||
return
|
return
|
||||||
|
|
||||||
self._unparent()
|
self._unparent()
|
||||||
@ -282,7 +282,7 @@ def _setup_page(page_widget, color, hpad):
|
|||||||
vpad = style.FOCUS_LINE_WIDTH
|
vpad = style.FOCUS_LINE_WIDTH
|
||||||
page_widget.child.set_padding(vpad, vpad, hpad, hpad)
|
page_widget.child.set_padding(vpad, vpad, hpad, hpad)
|
||||||
|
|
||||||
page = _unembed_page(page_widget)
|
page = _get_embedded_page(page_widget)
|
||||||
page.modify_bg(gtk.STATE_NORMAL, color)
|
page.modify_bg(gtk.STATE_NORMAL, color)
|
||||||
if isinstance(page, gtk.Container):
|
if isinstance(page, gtk.Container):
|
||||||
for i in page.get_children():
|
for i in page.get_children():
|
||||||
@ -308,7 +308,7 @@ def _embed_page(box_class, page):
|
|||||||
return (page_widget, alignment)
|
return (page_widget, alignment)
|
||||||
|
|
||||||
|
|
||||||
def _unembed_page(page_widget):
|
def _get_embedded_page(page_widget):
|
||||||
return page_widget.child.child
|
return page_widget.child.child
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user