mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
Allow shrinking the main window
The welcome screen's minimum size is quite large. This change allows the window to be smaller than the welcome screen when the welcome screen is not visible. BUG: 478577 Before and after screenshot: ![Before and after screenshot](/uploads/71f685c89a7324444b89e1abd0592b80/image.png)
This commit is contained in:
parent
1cbb5f0e00
commit
db2246f777
1 changed files with 16 additions and 1 deletions
|
@ -70,6 +70,21 @@ static const char *const SESSION_TAB_KEY = "ActiveTab";
|
||||||
static constexpr char SIDEBAR_LOCKED_KEY[] = "LockSidebar";
|
static constexpr char SIDEBAR_LOCKED_KEY[] = "LockSidebar";
|
||||||
static constexpr char SIDEBAR_VISIBLE_KEY[] = "ShowSidebar";
|
static constexpr char SIDEBAR_VISIBLE_KEY[] = "ShowSidebar";
|
||||||
|
|
||||||
|
class ResizableStackedWidget : public QStackedWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QSize sizeHint() const override
|
||||||
|
{
|
||||||
|
return currentWidget()->sizeHint();
|
||||||
|
}
|
||||||
|
QSize minimumSizeHint() const override
|
||||||
|
{
|
||||||
|
return currentWidget()->minimumSizeHint();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Groups sidebar containers in a QDockWidget.
|
* Groups sidebar containers in a QDockWidget.
|
||||||
*
|
*
|
||||||
|
@ -184,7 +199,7 @@ Shell::Shell(const QString &serializedOptions)
|
||||||
KParts::ReadWritePart *const firstPart = m_partFactory->create<KParts::ReadWritePart>(this);
|
KParts::ReadWritePart *const firstPart = m_partFactory->create<KParts::ReadWritePart>(this);
|
||||||
if (firstPart) {
|
if (firstPart) {
|
||||||
// Setup the central widget
|
// Setup the central widget
|
||||||
m_centralStackedWidget = new QStackedWidget();
|
m_centralStackedWidget = new ResizableStackedWidget();
|
||||||
setCentralWidget(m_centralStackedWidget);
|
setCentralWidget(m_centralStackedWidget);
|
||||||
|
|
||||||
// Setup the welcome screen
|
// Setup the welcome screen
|
||||||
|
|
Loading…
Reference in a new issue