diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-06 23:52:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-09 18:18:46 +0200 |
commit | 0cde3c332d2cc5c470998b6c1ba39705c64621b5 (patch) | |
tree | 2e912ef434ee35d35f89872f75aa7282f5fa9b59 /vcl | |
parent | 5c9fe8c42f5b51debe58b4806c57b0784d99665a (diff) |
tdf#120371 follow GNOME HIG on tab placement on mega tab notebooks
tradionally we do double/triple decker tab dialogs when there are a lot of tabs,
that option isn't available with native gtk3 notebooks.
Instead follow
https://developer.gnome.org/hig-book/unstable/controls-notebooks.html.en#controls-too-many-tabs
and when there are > 6 tabs position them at-left
Change-Id: I8e6ca78abeec3c1fa9f616c21f21fd7367be2ec9
Reviewed-on: https://gerrit.libreoffice.org/61487
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.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index b71ba4a72f5b..cef3d1d04e40 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2808,12 +2808,21 @@ private: return -1; } + // https://developer.gnome.org/hig-book/unstable/controls-notebooks.html.en#controls-too-many-tabs + // tdf#120371 If you have more than about six tabs in a notebook ... place + // the list control on the left-hand side of the window + void update_tab_pos() + { + gtk_notebook_set_tab_pos(m_pNotebook, get_n_pages() > 6 ? GTK_POS_LEFT : GTK_POS_TOP); + } + public: GtkInstanceNotebook(GtkNotebook* pNotebook, bool bTakeOwnership) : GtkInstanceContainer(GTK_CONTAINER(pNotebook), bTakeOwnership) , m_pNotebook(pNotebook) , m_nSignalId(g_signal_connect(pNotebook, "switch-page", G_CALLBACK(signalSwitchPage), this)) { + update_tab_pos(); } virtual int get_current_page() const override @@ -2879,6 +2888,7 @@ public: { disable_notify_events(); gtk_notebook_remove_page(m_pNotebook, get_page_number(rIdent)); + update_tab_pos(); enable_notify_events(); } |