Skip to content
Permalink
Browse files

Don't allow temporal dock to be shrunk shorter than its contents

  • Loading branch information
nyalldawson committed Mar 22, 2021
1 parent 1af9376 commit 70b1dce45641fcb72fe2bb67f85095d905913ef4
@@ -90,6 +90,11 @@ Returns the panel currently shown in the stack.
.. versionadded:: 3.0
%End

virtual QSize sizeHint() const;

virtual QSize minimumSizeHint() const;


public slots:

void acceptCurrentPanel();
@@ -90,6 +90,20 @@ QgsPanelWidget *QgsPanelWidgetStack::currentPanel()
return qobject_cast<QgsPanelWidget *>( mStackedWidget->currentWidget() );
}

QSize QgsPanelWidgetStack::sizeHint() const
{
if ( QWidget *widget = mStackedWidget->currentWidget() )
return widget->sizeHint();
return QWidget::sizeHint();
}

QSize QgsPanelWidgetStack::minimumSizeHint() const
{
if ( QWidget *widget = mStackedWidget->currentWidget() )
return widget->minimumSizeHint();
return QWidget::minimumSizeHint();
}

void QgsPanelWidgetStack::acceptCurrentPanel()
{
// You can't accept the main panel.
@@ -91,6 +91,9 @@ class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWi
*/
QgsPanelWidget *currentPanel();

QSize sizeHint() const override;
QSize minimumSizeHint() const override;

public slots:

/**
@@ -2,14 +2,6 @@
<ui version="4.0">
<class>QgsTemporalControllerWidgetBase</class>
<widget class="QgsPanelWidget" name="QgsTemporalControllerWidgetBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>747</width>
<height>131</height>
</rect>
</property>
<property name="windowTitle">
<string>QgsDockWidget</string>
</property>
@@ -122,14 +114,8 @@
</item>
<item>
<widget class="QStackedWidget" name="mNavigationModeStackedWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="p1">
<layout class="QVBoxLayout" name="verticalLayoutP1">
@@ -525,6 +511,19 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>

0 comments on commit 70b1dce

Please sign in to comment.