Suppress sub-palettes in radiopalette
This commit is contained in:
@@ -1061,16 +1061,14 @@ def share_button(activity, **kwargs):
|
||||
palette = RadioPalette()
|
||||
|
||||
private = RadioToolButton(
|
||||
icon_name='zoom-home',
|
||||
tooltip=_('Private'))
|
||||
palette.append(private)
|
||||
icon_name='zoom-home')
|
||||
palette.append(private, _('Private'))
|
||||
|
||||
neighborhood = RadioToolButton(
|
||||
icon_name='zoom-neighborhood',
|
||||
group=private,
|
||||
tooltip=_('My Neighborhood'))
|
||||
group=private)
|
||||
neighborhood.connect('clicked', neighborhood_cb)
|
||||
palette.append(neighborhood)
|
||||
palette.append(neighborhood, _('My Neighborhood'))
|
||||
|
||||
def update_share():
|
||||
neighborhood.handler_block_by_func(neighborhood_cb)
|
||||
|
||||
@@ -88,12 +88,16 @@ class RadioPalette(Palette):
|
||||
self.top.show()
|
||||
self.set_content(self.top)
|
||||
|
||||
def append(self, button):
|
||||
def append(self, button, label):
|
||||
children = self.top.get_children()
|
||||
|
||||
# palette's button should not have sub-palettes
|
||||
button.palette = None
|
||||
|
||||
button.show()
|
||||
button.connect('clicked', self.__clicked_cb)
|
||||
self.top.pack_start(button, fill=False)
|
||||
button.__palette_label = label
|
||||
|
||||
if not children:
|
||||
self.__clicked_cb(button, True)
|
||||
@@ -106,7 +110,7 @@ class RadioPalette(Palette):
|
||||
if not button.get_active():
|
||||
return
|
||||
|
||||
self.set_primary_text(button.props.tooltip)
|
||||
self.set_primary_text(button.__palette_label)
|
||||
if not quiet:
|
||||
self.popdown(immediate=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user