unhighlight rows on change

xkb
sezanzeb 4 years ago committed by sezanzeb
parent f5ffd0b1e7
commit 4c9384f7e3

@ -111,6 +111,10 @@ class Row(Gtk.ListBoxRow):
"""Mark this row as changed."""
self.get_style_context().add_class('changed')
def unhighlight(self):
"""Mark this row as unchanged."""
self.get_style_context().remove_class('changed')
def on_character_input_change(self, entry):
keycode = self.get_keycode()
character = self.get_character()

@ -170,6 +170,11 @@ class Window:
key_list.forall(key_list.remove)
custom_mapping.empty()
def unhighlight_all_rows(self):
"""Remove all rows from the mappings table."""
key_list = self.get('key_list')
key_list.forall(lambda row: row.unhighlight())
def on_apply_system_layout_clicked(self, button):
"""Load the mapping."""
setxkbmap(self.selected_device, None)
@ -315,3 +320,4 @@ class Window:
)
custom_mapping.changed = False
self.unhighlight_all_rows()

Loading…
Cancel
Save