summaryrefslogtreecommitdiff
path: root/vcl/uiconfig
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-09 11:41:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-16 20:28:24 +0200
commitbc0e0f633b05c4f91b6695488fc9e5c127507ba5 (patch)
treecca168c8aced9207ffa877693b856440764de341 /vcl/uiconfig
parentde1dadd591862e38242cc2de7a4a658a9a8b67ac (diff)
tdf#131120 use a replacement for GtkComboBox
the problems with GtkComboBox we have are: 1) https://gitlab.gnome.org/GNOME/gtk/issues/1910 has_entry long menus take forever to appear (tdf#125388) on measuring each row, the GtkComboBox GtkTreeMenu will call its area_apply_attributes_cb function on the row, but that calls gtk_tree_menu_get_path_item which then loops through each child of the menu looking for the widget of the row, so performance drops to useless. All area_apply_attributes_cb does it set menu item sensitivity, so block it from running with fragile hackery which assumes that the unwanted callback is the only one with a 2) https://gitlab.gnome.org/GNOME/gtk/issues/94 when a super tall combobox menu is activated, and the selected entry is sufficiently far down the list, then the menu doesn't appear under wayland 3) https://gitlab.gnome.org/GNOME/gtk/issues/310 no typeahead support 4) we want to be able to control the width of the button, but have a drop down menu which is not limited to the width of the button 5) https://bugs.documentfoundation.org/show_bug.cgi?id=131120 super tall menu doesn't appear under X sometimes In general we often pack a lot into the comboboxes and the default ones don't like that. Overlay scrolling is turned off for the GtkTreeView replacement because otherwise there are null-derefs in gtk on indicator->scrollbar on repeated reopenings Change-Id: I1b6164020996377341b5992d593a027b76021f65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91990 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/uiconfig')
-rw-r--r--vcl/uiconfig/ui/combobox.ui103
1 files changed, 103 insertions, 0 deletions
diff --git a/vcl/uiconfig/ui/combobox.ui b/vcl/uiconfig/ui/combobox.ui
new file mode 100644
index 000000000000..167ae1a7f5ac
--- /dev/null
+++ b/vcl/uiconfig/ui/combobox.ui
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.2 -->
+<interface domain="vcl">
+ <requires lib="gtk+" version="3.18"/>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <child>
+ <object class="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="no_show_all">True</property>
+ <property name="activates_default">True</property>
+ <style>
+ <class name="combo"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="always_show_image">True</property>
+ <property name="draw_indicator">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImage" id="arrow">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">pan-down-symbolic</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <style>
+ <class name="combo"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <style>
+ <class name="linked"/>
+ </style>
+ </object>
+ <object class="GtkWindow" id="popup">
+ <property name="name">gtk-combobox-popup-window</property>
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="type_hint">combo</property>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <property name="overlay_scrolling">False</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <property name="enable_search">False</property>
+ <property name="search_column">0</property>
+ <property name="hover_selection">True</property>
+ <property name="show_expanders">False</property>
+ <property name="activate_on_single_click">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>