diff --git a/0001-Resolves-tdf-122467-drop-down-field-name-is-too-narr.patch b/0001-Resolves-tdf-122467-drop-down-field-name-is-too-narr.patch new file mode 100644 index 0000000..278a518 --- /dev/null +++ b/0001-Resolves-tdf-122467-drop-down-field-name-is-too-narr.patch @@ -0,0 +1,209 @@ +From 42b3f8f57ad7cdb26fb8acb139c71ae1470a0b94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 9 Jan 2019 09:48:07 +0000 +Subject: [PATCH] Resolves: tdf#122467 drop down field name is too narrow + +ellipise only when we have to + +Change-Id: I79820dc84fc9ac0a755700c70bca9edbb14cf371 +Reviewed-on: https://gerrit.libreoffice.org/66001 +Tested-by: Jenkins +Reviewed-by: Adolfo Jayme Barrientos +--- + dbaccess/uiconfig/ui/queryfilterdialog.ui | 20 ++++++++-------- + vcl/unx/gtk3/gtk3gtkinst.cxx | 28 +++++++++++++++-------- + 2 files changed, 29 insertions(+), 19 deletions(-) + +diff --git a/dbaccess/uiconfig/ui/queryfilterdialog.ui b/dbaccess/uiconfig/ui/queryfilterdialog.ui +index a52ea3651ba3..46164e2f503d 100644 +--- a/dbaccess/uiconfig/ui/queryfilterdialog.ui ++++ b/dbaccess/uiconfig/ui/queryfilterdialog.ui +@@ -99,7 +99,6 @@ + True + False + Operator +- end + 0 + + +@@ -112,7 +111,6 @@ + True + False + Field name +- end + + + 1 +@@ -124,7 +122,6 @@ + True + False + Condition +- end + + + 2 +@@ -135,7 +132,7 @@ + + True + False +- True ++ 0 + + - none - + +@@ -150,6 +147,7 @@ + True + False + True ++ 0 + + = + <> +@@ -172,7 +170,7 @@ + + True + False +- True ++ 0 + + - none - + +@@ -186,7 +184,7 @@ + + True + False +- True ++ 0 + + - none - + +@@ -201,6 +199,7 @@ + True + False + True ++ 0 + + + 2 +@@ -212,6 +211,7 @@ + True + False + True ++ 0 + + + 2 +@@ -223,7 +223,6 @@ + True + False + Value +- end + + + 3 +@@ -234,6 +233,7 @@ + + True + True ++ True + True + + +@@ -245,6 +245,7 @@ + + True + True ++ True + True + + +@@ -256,6 +257,7 @@ + + True + True ++ True + True + + +@@ -267,7 +269,7 @@ + + True + False +- True ++ 0 + + AND + OR +@@ -282,7 +284,7 @@ + + True + False +- True ++ 0 + + AND + OR +diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx +index 0165b6888864..c440cd45189e 100644 +--- a/vcl/unx/gtk3/gtk3gtkinst.cxx ++++ b/vcl/unx/gtk3/gtk3gtkinst.cxx +@@ -6348,6 +6348,7 @@ class GtkInstanceComboBox : public GtkInstanceContainer, public vcl::ISearchable + private: + GtkComboBox* m_pComboBox; + GtkTreeModel* m_pTreeModel; ++ GtkCellRenderer* m_pTextRenderer; + GtkMenu* m_pMenu; + std::unique_ptr m_xSorter; + vcl::QuickSelectionEngine m_aQuickSelectionEngine; +@@ -6660,23 +6661,19 @@ public: + if (!g_list_length(cells)) + { + //Always use the same text column renderer layout +- GtkCellRenderer* text_renderer = gtk_cell_renderer_text_new(); +- gtk_cell_layout_pack_end(GTK_CELL_LAYOUT(m_pComboBox), text_renderer, true); +- gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(m_pComboBox), text_renderer, "text", 0, nullptr); +- g_object_set(G_OBJECT(text_renderer), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr); ++ m_pTextRenderer = gtk_cell_renderer_text_new(); ++ gtk_cell_layout_pack_end(GTK_CELL_LAYOUT(m_pComboBox), m_pTextRenderer, true); ++ gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(m_pComboBox), m_pTextRenderer, "text", 0, nullptr); + } + else + { +- // this bit isn't great, I really want to be able to ellipse the text in the comboboxtext itself and let +- // the popup menu render them in full, in the interim allow the text to wrap in both cases +- GtkCellRenderer* cell = static_cast(cells->data); +- g_object_set(G_OBJECT(cell), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr); ++ m_pTextRenderer = static_cast(cells->data); + if (g_list_length(cells) == 2) + { + //The ComboBox is always going to show the column associated with + //the entry when there is one, left to its own devices this image + //column will be after it, but we want it before +- gtk_cell_layout_reorder(GTK_CELL_LAYOUT(m_pComboBox), cell, 1); ++ gtk_cell_layout_reorder(GTK_CELL_LAYOUT(m_pComboBox), m_pTextRenderer, 1); + } + } + g_list_free(cells); +@@ -6723,7 +6720,18 @@ public: + GtkCellRenderer* cell = static_cast(cells->data); + GtkRequisition size; + gtk_cell_renderer_get_preferred_size(cell, m_pWidget, &size, nullptr); +- gtk_cell_renderer_set_fixed_size(cell, nWidth, size.height); ++ if (nWidth < size.width) ++ { ++ // this bit isn't great, I really want to be able to ellipse the text in the comboboxtext itself and let ++ // the popup menu render them in full, in the interim ellipse both ++ g_object_set(G_OBJECT(m_pTextRenderer), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr); ++ gtk_cell_renderer_set_fixed_size(cell, nWidth, size.height); ++ } ++ else ++ { ++ g_object_set(G_OBJECT(m_pTextRenderer), "ellipsize", PANGO_ELLIPSIZE_NONE, nullptr); ++ gtk_cell_renderer_set_fixed_size(cell, size.width, size.height); ++ } + g_list_free(cells); + + gtk_widget_set_size_request(m_pWidget, nWidth, nHeight); +-- +2.21.0.rc1 + diff --git a/0001-menu-of-currency-combobox-in-format-cells-is-too-nar.patch b/0001-menu-of-currency-combobox-in-format-cells-is-too-nar.patch index cb25935..b8a8107 100644 --- a/0001-menu-of-currency-combobox-in-format-cells-is-too-nar.patch +++ b/0001-menu-of-currency-combobox-in-format-cells-is-too-nar.patch @@ -1,4 +1,4 @@ -From 88d65608a2bea19d803da47b0b75b7d3a3b86531 Mon Sep 17 00:00:00 2001 +From c73a30d4574d0a8baeb3945190c93b952b2d4b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 21 Feb 2019 15:57:22 +0000 Subject: [PATCH] menu of currency combobox in format-cells is too narrow @@ -18,26 +18,28 @@ in the widest menu we can get. Change-Id: Ie3e9960a320a70471ac21d2a88f32632cafa951f --- - vcl/unx/gtk3/gtk3gtkinst.cxx | 28 +++++++++++++++++++++++++--- - 1 file changed, 25 insertions(+), 3 deletions(-) + vcl/unx/gtk3/gtk3gtkinst.cxx | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx -index 808c1c6..b0e1573 100644 +index 253698f..e71aec7 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx -@@ -6732,9 +6732,31 @@ public: +@@ -6729,20 +6729,31 @@ public: // tweak the cell render to get a narrower size to stick GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBox)); GtkCellRenderer* cell = static_cast(cells->data); - GtkRequisition size; - gtk_cell_renderer_get_preferred_size(cell, m_pWidget, &size, nullptr); -- gtk_cell_renderer_set_fixed_size(cell, nWidth, size.height); +- if (nWidth < size.width) + + if (nWidth != -1) -+ { -+ // this bit isn't great, I really want to be able to ellipse the text in the comboboxtext itself and let + { + // this bit isn't great, I really want to be able to ellipse the text in the comboboxtext itself and let +- // the popup menu render them in full, in the interim ellipse both + // the popup menu render them in full, in the interim ellipse both of them -+ g_object_set(G_OBJECT(m_pTextRenderer), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr); + g_object_set(G_OBJECT(m_pTextRenderer), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr); +- gtk_cell_renderer_set_fixed_size(cell, nWidth, size.height); + + // to find out how much of the width of the combobox belongs to the cell, set + // the cell and widget to the min cell width and see what the difference is @@ -50,12 +52,13 @@ index 808c1c6..b0e1573 100644 + // now set the cell to the max width which it can be within the + // requested widget width + gtk_cell_renderer_set_fixed_size(cell, nWidth - nNonCellWidth, -1); -+ } -+ else -+ { -+ g_object_set(G_OBJECT(m_pTextRenderer), "ellipsize", PANGO_ELLIPSIZE_NONE, nullptr); + } + else + { + g_object_set(G_OBJECT(m_pTextRenderer), "ellipsize", PANGO_ELLIPSIZE_NONE, nullptr); +- gtk_cell_renderer_set_fixed_size(cell, size.width, size.height); + gtk_cell_renderer_set_fixed_size(cell, -1, -1); -+ } + } + g_list_free(cells); diff --git a/libreoffice.spec b/libreoffice.spec index 5a14d59..688748e 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -241,7 +241,8 @@ Patch1: 0001-Resolves-rhbz-1432468-disable-opencl-by-default.patch Patch2: 0001-Upgrade-external-boost-to-Boost-1.69.0.patch Patch3: 0001-Resolves-tdf-122623-theme-unwanted-tab-into-invisibi.patch Patch4: 0001-tdf-122393-move-to-overflow-row-on-using-left-right-.patch -Patch5: 0001-menu-of-currency-combobox-in-format-cells-is-too-nar.patch +Patch5: 0001-Resolves-tdf-122467-drop-down-field-name-is-too-narr.patch +Patch6: 0001-menu-of-currency-combobox-in-format-cells-is-too-nar.patch %if 0%{?rhel} # not upstreamed