diff --git a/src/widget/contentlayout.cpp b/src/widget/contentlayout.cpp index 150444e5b..d65d40835 100644 --- a/src/widget/contentlayout.cpp +++ b/src/widget/contentlayout.cpp @@ -96,13 +96,12 @@ void ContentLayout::init() mainHead->layout()->setSpacing(0); mainHead->setMouseTracking(true); - mainHLine = new QFrame(); - mainHLine->setFrameShape(QFrame::HLine); - mainHLine->setFrameShadow(QFrame::Plain); - QPalette palette = mainHLine->palette(); + mainHLine.setFrameShape(QFrame::HLine); + mainHLine.setFrameShadow(QFrame::Plain); + QPalette palette = mainHLine.palette(); palette.setBrush(QPalette::WindowText, QBrush(QColor(193, 193, 193))); palette.setBrush(QPalette::WindowText, QBrush(QColor(193, 193, 193))); - mainHLine->setPalette(palette); + mainHLine.setPalette(palette); mainContent = new QWidget(); mainContent->setLayout(new QVBoxLayout); @@ -120,7 +119,10 @@ void ContentLayout::init() mainContent->setStyleSheet(Style::getStylesheet(":ui/settings/mainContent.css")); #endif + mainHLineLayout.addWidget(&mainHLine); + mainHLineLayout.addSpacing(5); + addWidget(mainHead); - addWidget(mainHLine); + addLayout(&mainHLineLayout); addWidget(mainContent); } diff --git a/src/widget/contentlayout.h b/src/widget/contentlayout.h index 6955ca63e..be69decc5 100644 --- a/src/widget/contentlayout.h +++ b/src/widget/contentlayout.h @@ -21,8 +21,7 @@ #define CONTENTLAYOUT_H #include - -class QFrame; +#include class ContentLayout : public QVBoxLayout { @@ -33,8 +32,9 @@ public: void clear(); + QFrame mainHLine; + QHBoxLayout mainHLineLayout; QWidget* mainContent; - QFrame* mainHLine; QWidget* mainHead; private: