Skip to content

Commit ea5ff45

Browse files
authored
remove duplicate title bar from popout windows (#7)
1 parent 0337bfc commit ea5ff45

2 files changed

Lines changed: 1 addition & 24 deletions

File tree

src/ui/PopOutWindow.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include "theme/Theme.h"
33

44
#include <QCloseEvent>
5-
#include <QHBoxLayout>
6-
#include <QLabel>
75
#include <QMoveEvent>
86
#include <QResizeEvent>
97
#include <QSettings>
@@ -30,20 +28,6 @@ void PopOutWindow::setupUi(const QString& title) {
3028
m_mainLayout->setContentsMargins(0, 0, 0, 0);
3129
m_mainLayout->setSpacing(0);
3230

33-
m_titleBar = new QWidget(this);
34-
m_titleBar->setObjectName("PopOutTitleBar");
35-
m_titleBar->setFixedHeight(36);
36-
37-
QHBoxLayout* titleLayout = new QHBoxLayout(m_titleBar);
38-
titleLayout->setContentsMargins(12, 0, 8, 0);
39-
titleLayout->setSpacing(8);
40-
41-
m_titleLabel = new QLabel(title, m_titleBar);
42-
m_titleLabel->setProperty("role", "header");
43-
titleLayout->addWidget(m_titleLabel);
44-
45-
m_mainLayout->addWidget(m_titleBar);
46-
4731
m_contentContainer = new QWidget(this);
4832
m_contentContainer->setObjectName("PopOutContent");
4933
QVBoxLayout* contentLayout = new QVBoxLayout(m_contentContainer);
@@ -80,14 +64,11 @@ void PopOutWindow::showAndRestore() {
8064
}
8165

8266
void PopOutWindow::setMinimumContentSize(int width, int height) {
83-
setMinimumSize(width, height + m_titleBar->height());
67+
setMinimumSize(width, height);
8468
}
8569

8670
void PopOutWindow::setWindowTitle(const QString& title) {
8771
QDialog::setWindowTitle(title);
88-
if (m_titleLabel) {
89-
m_titleLabel->setText(title);
90-
}
9172
}
9273

9374
void PopOutWindow::closeEvent(QCloseEvent* event) {

src/ui/PopOutWindow.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <QPointer>
55

66
class QVBoxLayout;
7-
class QHBoxLayout;
8-
class QLabel;
97

108
namespace OpenMix {
119

@@ -43,8 +41,6 @@ class PopOutWindow : public QDialog {
4341
QString m_settingsKey;
4442
QWidget* m_content = nullptr;
4543
QVBoxLayout* m_mainLayout = nullptr;
46-
QWidget* m_titleBar = nullptr;
47-
QLabel* m_titleLabel = nullptr;
4844
QWidget* m_contentContainer = nullptr;
4945

5046
bool m_geometryLoaded = false;

0 commit comments

Comments
 (0)