Skip to content

Commit 1dc9889

Browse files
committed
GUI fixes
1 parent 3e12394 commit 1dc9889

File tree

2 files changed

+17
-103
lines changed

2 files changed

+17
-103
lines changed

plugins/Planes/src/gui/PlanesDialog.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ void PlanesDialog::setBSStatus(QString status)
7676
void PlanesDialog::createDialogContent()
7777
{
7878
ui->setupUi(dialog);
79+
80+
connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
81+
connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
82+
7983
ui->dbDriver->addItem(QStringLiteral("MySQL"), QStringLiteral("QMYSQL"));
8084
ui->dbDriver->addItem(QStringLiteral("ODBC"), QStringLiteral("QODBC"));
8185
ui->dbDriver->addItem(QStringLiteral("SQLite"), QStringLiteral("QSQLITE"));
@@ -122,16 +126,13 @@ void PlanesDialog::createDialogContent()
122126
connectDoubleProperty(ui->maxVertRate, "Planes.maxVertRate");
123127
connectDoubleProperty(ui->minVertRate, "Planes.minVertRate");
124128

125-
//connectStringProperty()
126-
127129
ui->bsHost->setText(planes->getBSHost());
128130
ui->bsPort->setText(QString::number((int)planes->getBSPort()));
129131
ui->useBSDB->setChecked(planes->isDumpingOldFlights());
130132

131133
ui->bsStatus->setText(cachedBSStatus);
132134
ui->dbStatus->setText(cachedDBStatus);
133135

134-
this->connect(ui->closeStelWindow, SIGNAL(clicked()), SLOT(close()));
135136
this->connect(&StelApp::getInstance(), SIGNAL(languageChanged()), SLOT(retranslate()));
136137
this->connect(ui->col_solid, SIGNAL(clicked()), SLOT(setSolidCol()));
137138
this->connect(ui->col_height, SIGNAL(clicked()), SLOT(setHeightCol()));
@@ -166,7 +167,7 @@ void PlanesDialog::createDialogContent()
166167
connectBoolProperty(ui->connectOnStartup, "Planes.connectOnStartup");
167168
this->connect(ui->reconnectOnConnectionLoss, SIGNAL(clicked(bool)), SLOT(setReconnectOnConnectionLoss(bool)));
168169

169-
connectColorButton(ui->infoTextColorButton, "Planes.infoColor", "Planes/planes_color");
170+
ui->infoTextColorButton->setup("Planes.infoColor", "Planes/planes_color");
170171

171172
setAboutHtml();
172173
}

plugins/Planes/src/gui/PlanesDialog.ui

Lines changed: 12 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -30,97 +30,10 @@
3030
<number>0</number>
3131
</property>
3232
<item>
33-
<widget class="BarFrame" name="TitleBar">
34-
<property name="minimumSize">
35-
<size>
36-
<width>0</width>
37-
<height>25</height>
38-
</size>
39-
</property>
40-
<property name="maximumSize">
41-
<size>
42-
<width>16777215</width>
43-
<height>30</height>
44-
</size>
45-
</property>
46-
<property name="frameShape">
47-
<enum>QFrame::StyledPanel</enum>
48-
</property>
49-
<property name="frameShadow">
50-
<enum>QFrame::Raised</enum>
51-
</property>
52-
<layout class="QHBoxLayout" name="horizontalLayout">
53-
<property name="spacing">
54-
<number>0</number>
55-
</property>
56-
<property name="leftMargin">
57-
<number>0</number>
58-
</property>
59-
<property name="topMargin">
60-
<number>0</number>
61-
</property>
62-
<property name="rightMargin">
63-
<number>4</number>
64-
</property>
65-
<property name="bottomMargin">
66-
<number>0</number>
67-
</property>
68-
<item>
69-
<spacer name="horizontalSpacer">
70-
<property name="orientation">
71-
<enum>Qt::Horizontal</enum>
72-
</property>
73-
<property name="sizeHint" stdset="0">
74-
<size>
75-
<width>235</width>
76-
<height>20</height>
77-
</size>
78-
</property>
79-
</spacer>
80-
</item>
81-
<item>
82-
<widget class="QLabel" name="stelWindowTitle">
83-
<property name="text">
33+
<widget class="TitleBar" name="titleBar">
34+
<property name="title" stdset="0">
8435
<string>Planes Configuration</string>
85-
</property>
86-
</widget>
87-
</item>
88-
<item>
89-
<spacer name="horizontalSpacer_2">
90-
<property name="orientation">
91-
<enum>Qt::Horizontal</enum>
92-
</property>
93-
<property name="sizeHint" stdset="0">
94-
<size>
95-
<width>235</width>
96-
<height>20</height>
97-
</size>
98-
</property>
99-
</spacer>
100-
</item>
101-
<item>
102-
<widget class="StelCloseButton" name="closeStelWindow">
103-
<property name="minimumSize">
104-
<size>
105-
<width>16</width>
106-
<height>16</height>
107-
</size>
108-
</property>
109-
<property name="maximumSize">
110-
<size>
111-
<width>16</width>
112-
<height>16</height>
113-
</size>
114-
</property>
115-
<property name="focusPolicy">
116-
<enum>Qt::NoFocus</enum>
117-
</property>
118-
<property name="text">
119-
<string/>
120-
</property>
121-
</widget>
122-
</item>
123-
</layout>
36+
</property>
12437
</widget>
12538
</item>
12639
<item>
@@ -715,9 +628,9 @@ to the right</string>
715628
</property>
716629
<layout class="QGridLayout" name="gridLayout_3">
717630
<item row="0" column="0">
718-
<widget class="QToolButton" name="infoTextColorButton">
719-
<property name="text">
720-
<string/>
631+
<widget class="ColorButton" name="infoTextColorButton">
632+
<property name="toolTip">
633+
<string>Color for info text</string>
721634
</property>
722635
</widget>
723636
</item>
@@ -760,16 +673,16 @@ li.checked::marker { content: &quot;\2612&quot;; }
760673
</widget>
761674
<customwidgets>
762675
<customwidget>
763-
<class>BarFrame</class>
676+
<class>TitleBar</class>
764677
<extends>QFrame</extends>
765678
<header>Dialog.hpp</header>
766679
<container>1</container>
767680
</customwidget>
768-
<customwidget>
769-
<class>StelCloseButton</class>
770-
<extends>QPushButton</extends>
771-
<header>gui/StelCloseButton.hpp</header>
772-
</customwidget>
681+
<customwidget>
682+
<class>ColorButton</class>
683+
<extends>QToolButton</extends>
684+
<header>gui/ColorButton.hpp</header>
685+
</customwidget>
773686
</customwidgets>
774687
<tabstops>
775688
<tabstop>Tabs</tabstop>

0 commit comments

Comments
 (0)