summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-17 11:34:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-17 16:05:01 +0200
commit95401c5b3eef03497af6a85afc6e907c659ef6f7 (patch)
tree06391a7e69fc37f38a5e3a703424f965d8f348f3 /vcl
parent408ea1f0d449fdcd2ddaa50155c7a1a26a048ca8 (diff)
tweak combobox vs comboboxtext
Change-Id: I3e183d2cc0b0372b961b295801887bc4aadeb3b3 Reviewed-on: https://gerrit.libreoffice.org/60574 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 93f23b2b0e8e..28492d27d0dc 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4673,7 +4673,8 @@ public:
, m_nChangedSignalId(g_signal_connect(m_pComboBox, "changed", G_CALLBACK(signalChanged), this))
, m_nPopupShownSignalId(g_signal_connect(m_pComboBox, "notify::popup-shown", G_CALLBACK(signalPopupShown), this))
{
- if (!has_entry())
+ GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBox));
+ if (!g_list_length(cells))
{
//Always use the same text column renderer layout
GtkCellRenderer* text_renderer = gtk_cell_renderer_text_new();
@@ -4685,7 +4686,6 @@ public:
{
// 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
- GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBox));
GtkCellRenderer* cell = static_cast<GtkCellRenderer*>(cells->data);
g_object_set(G_OBJECT(cell), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr);
if (g_list_length(cells) == 2)
@@ -4695,8 +4695,8 @@ public:
//column will be after it, but we want it before
gtk_cell_layout_reorder(GTK_CELL_LAYOUT(m_pComboBox), cell, 1);
}
- g_list_free(cells);
}
+ g_list_free(cells);
if (GtkEntry* pEntry = get_entry())
{