Bug #2662: Can't expand/contract items when a gramplet has been detached
svn: r11777
This commit is contained in:
parent
663d7abbd7
commit
79b25acf9c
@ -165,7 +165,7 @@ class GrampletWindow(ManagedWindow.ManagedWindow):
|
|||||||
def __init__(self, gramplet):
|
def __init__(self, gramplet):
|
||||||
self.title = gramplet.title + " " + _("Gramplet")
|
self.title = gramplet.title + " " + _("Gramplet")
|
||||||
self.gramplet = gramplet
|
self.gramplet = gramplet
|
||||||
ManagedWindow.ManagedWindow.__init__(self, gramplet.uistate, [], gramplet)
|
ManagedWindow.ManagedWindow.__init__(self, gramplet.uistate, [], self.__class__)
|
||||||
self.set_window(gtk.Dialog("",gramplet.uistate.window,
|
self.set_window(gtk.Dialog("",gramplet.uistate.window,
|
||||||
gtk.DIALOG_DESTROY_WITH_PARENT,
|
gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||||
(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)),
|
(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)),
|
||||||
@ -176,7 +176,16 @@ class GrampletWindow(ManagedWindow.ManagedWindow):
|
|||||||
# add gramplet:
|
# add gramplet:
|
||||||
self.gramplet.mainframe.reparent(self.window.vbox)
|
self.gramplet.mainframe.reparent(self.window.vbox)
|
||||||
self.window.connect('response', self.handle_response)
|
self.window.connect('response', self.handle_response)
|
||||||
self.window.show()
|
# HACK: must show window to make it work right:
|
||||||
|
self.show()
|
||||||
|
# But that shows everything, hide them here:
|
||||||
|
self.gramplet.gvclose.hide()
|
||||||
|
self.gramplet.gvstate.hide()
|
||||||
|
self.gramplet.gvproperties.hide()
|
||||||
|
if self.gramplet.pui and len(self.gramplet.pui.option_dict) > 0:
|
||||||
|
self.gramplet.gvoptions.show()
|
||||||
|
else:
|
||||||
|
self.gramplet.gvoptions.hide()
|
||||||
|
|
||||||
def handle_response(self, object, response):
|
def handle_response(self, object, response):
|
||||||
if response in [gtk.RESPONSE_CLOSE, gtk.STOCK_CLOSE]:
|
if response in [gtk.RESPONSE_CLOSE, gtk.STOCK_CLOSE]:
|
||||||
@ -518,11 +527,6 @@ class GuiGramplet:
|
|||||||
def detach(self):
|
def detach(self):
|
||||||
# hide buttons:
|
# hide buttons:
|
||||||
self.set_state("windowed")
|
self.set_state("windowed")
|
||||||
self.gvclose.hide()
|
|
||||||
self.gvstate.hide()
|
|
||||||
self.gvproperties.hide()
|
|
||||||
if self.pui and len(self.pui.option_dict) > 0:
|
|
||||||
self.gvoptions.show()
|
|
||||||
self.viewpage.detached_gramplets.append(self)
|
self.viewpage.detached_gramplets.append(self)
|
||||||
# make a window, and attach it there
|
# make a window, and attach it there
|
||||||
self.detached_window = GrampletWindow(self)
|
self.detached_window = GrampletWindow(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user