Commit e0f6cb91 authored by Kai Willadsen's avatar Kai Willadsen

ui.statusbar: Bind button label to active highlighting language

parent 0bb9758b
......@@ -80,8 +80,15 @@ class MeldStatusBar(Gtk.Statusbar):
pop.set_position(Gtk.PositionType.TOP)
pop.add(selector)
def get_language_label(binding, language, *args):
if not language:
return _("Plain Text")
return language.get_name()
button = Gtk.MenuButton()
button.set_label("Foo")
self.bind_property(
'source-language', button, 'label', GObject.BindingFlags.DEFAULT,
get_language_label)
button.set_popover(pop)
button.show()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment