diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-30 11:21:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-31 15:07:28 +0100 |
commit | e5876404a3a70754b8a49aa0f405847b3fad96d8 (patch) | |
tree | e304840ac0d6cde2232e373aa950afd1d1fa7cef /bin | |
parent | 912bc5d73736a90b108fc4c72eb64ad70845ce30 (diff) |
uniformly allow focus into GtkToolbar
Change-Id: I110daf882d9196cf7552e43a157ba4ae73fd670b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124458
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ui-rules-enforcer.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py index c9c0d7d22bfc..718bb82bd35b 100755 --- a/bin/ui-rules-enforcer.py +++ b/bin/ui-rules-enforcer.py @@ -424,6 +424,30 @@ def enforce_active_in_group_consistency(current): active.text = "True" current.insert(insertpos, active) +def enforce_toolbar_can_focus(current): + can_focus = None + istoolbar = current.get('class') == "GtkToolbar" + insertpos = 0 + for child in current: + enforce_toolbar_can_focus(child) + if not istoolbar: + continue + if child.tag == "property": + insertpos = insertpos + 1; + attributes = child.attrib + if attributes.get("name") == "can-focus" or attributes.get("name") == "can_focus": + can_focus = child + + if istoolbar: + if can_focus == None: + can_focus = etree.Element("property") + attributes = can_focus.attrib + attributes["name"] = "can-focus" + can_focus.text = "True" + current.insert(insertpos, can_focus) + else: + can_focus.text = "True" + def enforce_entry_text_column_id_column_for_gtkcombobox(current): entrytextcolumn = None idcolumn = None @@ -496,6 +520,7 @@ enforce_entry_text_column_id_column_for_gtkcombobox(root) remove_double_buffered(root) remove_skip_pager_hint(root) remove_toolbutton_focus(root) +enforce_toolbar_can_focus(root) with open(sys.argv[1], 'wb') as o: # without encoding='unicode' (and the matching encode("utf8")) we get &#XXXX replacements for non-ascii characters |