diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-07-18 09:10:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-07-18 12:02:56 +0200 |
commit | 9e9138c09bd3d05ff45a6aabf574af897ef93a1e (patch) | |
tree | 52aeebe1c9fdecfb4dd58a7f714cd16ef02bf389 /vcl/unx/gtk3 | |
parent | 753314b102979b628d7ba77fb856a6e20771db33 (diff) |
only ellipize menubutton label when requesting narrower size
Change-Id: I32f4856756910ec1db8d37854b6e57dbec5aae76
Reviewed-on: https://gerrit.libreoffice.org/57617
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index bde669c26d0c..2a524619e480 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3067,7 +3067,6 @@ public: m_pBox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); m_pLabel = GTK_LABEL(gtk_label_new_with_mnemonic(sLabel.getStr())); - gtk_label_set_ellipsize(m_pLabel, PANGO_ELLIPSIZE_MIDDLE); gtk_label_set_mnemonic_widget(m_pLabel, GTK_WIDGET(m_pMenuButton)); gtk_box_pack_start(m_pBox, GTK_WIDGET(m_pLabel), false, false, 0); @@ -3076,6 +3075,13 @@ public: gtk_widget_show_all(GTK_WIDGET(m_pBox)); } + virtual void set_size_request(int nWidth, int nHeight) override + { + // tweak the label to get a narrower size to stick + gtk_label_set_ellipsize(m_pLabel, PANGO_ELLIPSIZE_MIDDLE); + gtk_widget_set_size_request(m_pWidget, nWidth, nHeight); + } + virtual void set_label(const OUString& rText) override { ::set_label(m_pLabel, rText); |