[Libreoffice-commits] core.git: vcl/source vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 10 20:04:20 UTC 2020
vcl/source/window/layout.cxx | 2 +-
vcl/unx/gtk3/gtk3gtkinst.cxx | 35 +++++++++++++++++++----------------
2 files changed, 20 insertions(+), 17 deletions(-)
New commits:
commit f88c03b1d115cd09e3271b278b39bf600e21f6cd
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Nov 10 17:25:42 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Nov 10 21:03:39 2020 +0100
sync the vcl expander default with the gtk one to !m_bResizeTopLevel
Change-Id: Ia186514efa9e670ce2287201f16978fc1b0e9146
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105564
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 676fae9dbc4f..6cbc00e05e72 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1623,7 +1623,7 @@ public:
VclExpander::VclExpander(vcl::Window *pParent)
: VclBin(pParent)
- , m_bResizeTopLevel(true)
+ , m_bResizeTopLevel(false)
, m_pDisclosureButton(VclPtr<DisclosureButton>::Create(this))
{
m_pDisclosureButton->SetToggleHdl(LINK(this, VclExpander, ClickHdl));
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index db2b765841ff..83cf0aad9cec 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -16150,26 +16150,29 @@ private:
GtkInstanceExpander* pThis = static_cast<GtkInstanceExpander*>(widget);
SolarMutexGuard aGuard;
- GtkWidget *pToplevel = gtk_widget_get_toplevel(GTK_WIDGET(pExpander));
-
- // https://gitlab.gnome.org/GNOME/gtk/issues/70
- // I imagine at some point a release with a fix will be available in which
- // case this can be avoided depending on version number
- if (pToplevel && GTK_IS_WINDOW(pToplevel) && gtk_widget_get_realized(pToplevel))
+ if (gtk_expander_get_resize_toplevel(pExpander))
{
- int nToplevelWidth, nToplevelHeight;
- int nChildHeight;
+ GtkWidget *pToplevel = gtk_widget_get_toplevel(GTK_WIDGET(pExpander));
- GtkWidget* child = gtk_bin_get_child(GTK_BIN(pExpander));
- gtk_widget_get_preferred_height(child, &nChildHeight, nullptr);
- gtk_window_get_size(GTK_WINDOW(pToplevel), &nToplevelWidth, &nToplevelHeight);
+ // https://gitlab.gnome.org/GNOME/gtk/issues/70
+ // I imagine at some point a release with a fix will be available in which
+ // case this can be avoided depending on version number
+ if (pToplevel && GTK_IS_WINDOW(pToplevel) && gtk_widget_get_realized(pToplevel))
+ {
+ int nToplevelWidth, nToplevelHeight;
+ int nChildHeight;
- if (pThis->get_expanded())
- nToplevelHeight += nChildHeight;
- else
- nToplevelHeight -= nChildHeight;
+ GtkWidget* child = gtk_bin_get_child(GTK_BIN(pExpander));
+ gtk_widget_get_preferred_height(child, &nChildHeight, nullptr);
+ gtk_window_get_size(GTK_WINDOW(pToplevel), &nToplevelWidth, &nToplevelHeight);
- gtk_window_resize(GTK_WINDOW(pToplevel), nToplevelWidth, nToplevelHeight);
+ if (pThis->get_expanded())
+ nToplevelHeight += nChildHeight;
+ else
+ nToplevelHeight -= nChildHeight;
+
+ gtk_window_resize(GTK_WINDOW(pToplevel), nToplevelWidth, nToplevelHeight);
+ }
}
pThis->signal_expanded();
More information about the Libreoffice-commits
mailing list