diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-29 16:59:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-31 15:07:12 +0100 |
commit | 912bc5d73736a90b108fc4c72eb64ad70845ce30 (patch) | |
tree | 0677a1022b6ba11d23413b477e325c1fc032622f /bin | |
parent | b73bf4a5fca4fcfff24b234a7337c7a25d75887d (diff) |
gtk[3 vs 4]: remove can-focus from GtkToolButton
so tab-cycling inside sidebar panel toolbars works as wanted
It needs to be false for gtk3 and true for gtk4, leaving it unspecified
gets a desired working default.
Change-Id: I34869d5dcffc814f62ec2b717108f90c395a067b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124446
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ui-rules-enforcer.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py index 16764533ea59..c9c0d7d22bfc 100755 --- a/bin/ui-rules-enforcer.py +++ b/bin/ui-rules-enforcer.py @@ -291,6 +291,22 @@ def remove_track_visited_links(current): if track_visited_links != None: current.remove(track_visited_links) +def remove_toolbutton_focus(current): + can_focus = None + classname = current.get('class'); + istoolbutton = classname and classname.endswith("ToolButton"); + for child in current: + remove_toolbutton_focus(child) + if not istoolbutton: + continue + if child.tag == "property": + attributes = child.attrib + if attributes.get("name") == "can_focus" or attributes.get("name") == "can-focus": + can_focus = child + + if can_focus != None: + current.remove(can_focus) + def remove_double_buffered(current): double_buffered = None for child in current: @@ -479,7 +495,7 @@ enforce_active_in_group_consistency(root) enforce_entry_text_column_id_column_for_gtkcombobox(root) remove_double_buffered(root) remove_skip_pager_hint(root) - +remove_toolbutton_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 |