Make page container hug edges of dialog <3

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2025-11-23 16:25:33 +00:00
parent 40d1dccb9b
commit 2b949d5fdd
9 changed files with 28 additions and 11 deletions
+10 -4
View File
@@ -77,6 +77,8 @@ class PageEntryFilterModel : public QSortFilterProxyModel {
PageContainer::PageContainer(BasePageProvider* pageProvider, QString defaultId, QWidget* parent) : QWidget(parent)
{
createUI();
useSidebarStyle(true);
m_model = new PageModel(this);
m_proxyModel = new PageEntryFilterModel(this);
int counter = 0;
@@ -179,10 +181,10 @@ void PageContainer::createUI()
m_layout = new QGridLayout;
m_layout->addLayout(headerHLayout, 0, 1, 1, 1);
m_layout->addWidget(m_pageList, 0, 0, 2, 1);
m_layout->addWidget(m_pageList, 0, 0, 3, 1);
m_layout->addLayout(m_pageStack, 1, 1, 1, 1);
m_layout->setColumnStretch(1, 4);
m_layout->setContentsMargins(0, 0, 0, 6);
m_layout->setContentsMargins(0, 0, 0, 0);
setLayout(m_layout);
}
@@ -197,12 +199,16 @@ void PageContainer::retranslate()
void PageContainer::addButtons(QWidget* buttons)
{
m_layout->addWidget(buttons, 2, 0, 1, 2);
m_layout->addWidget(buttons, 2, 1, 1, 2);
}
void PageContainer::addButtons(QLayout* buttons)
{
m_layout->addLayout(buttons, 2, 0, 1, 2);
m_layout->addLayout(buttons, 2, 1, 1, 2);
}
void PageContainer::useSidebarStyle(bool sidebar) {
m_pageList->setProperty("_kde_side_panel_view", sidebar);
}
void PageContainer::showPage(int row)
+3
View File
@@ -61,6 +61,9 @@ class PageContainer : public QWidget, public BasePageContainer {
void addButtons(QWidget* buttons);
void addButtons(QLayout* buttons);
void useSidebarStyle(bool sidebar);
/*
* Save any unsaved state and prepare to be closed.
* @return true if everything can be saved, false if there is something that requires attention
-2
View File
@@ -89,8 +89,6 @@ class PageView : public QListView {
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
setItemDelegate(new PageViewDelegate(this));
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
// Adjust margins when using Breeze theme
setProperty("_kde_side_panel_view", true);
}
virtual QSize sizeHint() const