Skip to content

Commit

Permalink
fix : align of center widget
Browse files Browse the repository at this point in the history
adjust the align of cetner widget as design

Log: fix the design of center listvie
Issue: linuxdeepin/developer-center#3597
Influence: the appearance of the mainwindow of control center
Change-Id: I0971297d941397c9da8a9d431ebb7ac3be4e5b73
  • Loading branch information
Decodetalkers committed Feb 10, 2023
1 parent 84dc626 commit ccc18e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/frame/mainmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,18 @@ class MainModulePrivate
m_view->setGridSize(ListViweItemSize_IconMode);
m_view->setContentsMargins(0, 0, 0, 0);
m_view->setSpacing(20);
m_view->setAlignment(Qt::AlignCenter);
m_view->setAlignment(Qt::AlignHCenter);

while (!m_layout->isEmpty()) {
QLayoutItem *item = m_layout->takeAt(0);
if (item->widget() && item->widget() != m_view && item->widget() != m_sidebarWidget)
delete item->widget();
delete item;
}
m_layout->addWidget(m_view);
QVBoxLayout *vlayout = new QVBoxLayout;
vlayout->addSpacing(20);
vlayout->addWidget(m_view);
m_layout->addLayout(vlayout);

m_view->setMinimumWidth(0);
m_view->setMaximumWidth(QWIDGETSIZE_MAX);
Expand Down

0 comments on commit ccc18e4

Please sign in to comment.