Make page container hug edges of dialog <3
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user