Kaydet (Commit) aed4d485 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#117737 combobox menu misplaced if wrap-width set

so use ellipsize instead and set the height to one single line

Change-Id: Icb124669410c041880ce468f3cf56fdb4bc1c9f1
Reviewed-on: https://gerrit.libreoffice.org/54751Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2624869b
......@@ -4017,7 +4017,7 @@ public:
// the popup menu render them in full, in the interim allow the text to wrap in both cases
GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBoxText));
GtkCellRenderer* cell = static_cast<GtkCellRenderer*>(cells->data);
g_object_set(G_OBJECT(cell), "wrap-width", 3, nullptr);
g_object_set(G_OBJECT(cell), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr);
g_list_free(cells);
if (GtkEntry* pEntry = get_entry())
......@@ -4053,7 +4053,9 @@ public:
// tweak the cell render to get a narrower size to stick
GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBoxText));
GtkCellRenderer* cell = static_cast<GtkCellRenderer*>(cells->data);
gtk_cell_renderer_set_fixed_size(cell, nWidth, -1);
GtkRequisition size;
gtk_cell_renderer_get_preferred_size(cell, m_pWidget, &size, nullptr);
gtk_cell_renderer_set_fixed_size(cell, nWidth, size.height);
g_list_free(cells);
gtk_widget_set_size_request(m_pWidget, nWidth, nHeight);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment