Skip to content

Commit

Permalink
Deduplicate title bar implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
10110111 committed Oct 29, 2023
1 parent 0a8ada8 commit b87db1a
Show file tree
Hide file tree
Showing 112 changed files with 398 additions and 5,877 deletions.
6 changes: 5 additions & 1 deletion data/gui/normalStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,12 @@ QMenu::item:selected { /* when user selects item using mouse or keyboard */
* Windows
*/

QFrame#TitleBar {
QFrame#titleBar {
/* Title bar on windows */
min-width: 16px;
min-height: 25px;
max-height: 25px;
margin: 0;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop: 0 rgb(41, 47, 50), stop:1 rgb(31, 33, 36));
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/AngleMeasure/src/gui/AngleMeasureDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ void AngleMeasureDialog::createDialogContent()
connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));

connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

connectBoolProperty(ui->panAndSelectCheckBox, "AngleMeasure.flagPanAndSelect");
connectBoolProperty(ui->followCursorCheckBox, "AngleMeasure.flagFollowCursor");
Expand Down
104 changes: 4 additions & 100 deletions plugins/AngleMeasure/src/gui/angleMeasureDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -30,106 +30,10 @@
<number>0</number>
</property>
<item>
<widget class="BarFrame" name="TitleBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="TitleBar" name="titleBar">
<property name="title">
<string>Angle Measure Plug-in Configuration</string>
</property>
<property name="minimumSize">
<size>
<width>530</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<layout class="QHBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="stelWindowTitle">
<property name="text">
<string>Angle Measure Plug-in Configuration</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="StelCloseButton" name="closeStelWindow">
<property name="minimumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
Expand Down Expand Up @@ -458,7 +362,7 @@
</widget>
<customwidgets>
<customwidget>
<class>BarFrame</class>
<class>TitleBar</class>
<extends>QFrame</extends>
<header>Dialog.hpp</header>
<container>1</container>
Expand Down
4 changes: 2 additions & 2 deletions plugins/ArchaeoLines/src/gui/ArchaeoLinesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void ArchaeoLinesDialog::createDialogContent()
connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));

connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

connectIntProperty(ui->lineWidthSpinBox, "ArchaeoLines.lineWidth");

Expand Down
4 changes: 2 additions & 2 deletions plugins/ArchaeoLines/src/gui/ArchaeoLinesDialogLocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void ArchaeoLinesDialogLocations::createDialogContent()
connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));

connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

//initialize list model
allModel = new QStringListModel(this);
Expand Down
104 changes: 4 additions & 100 deletions plugins/ArchaeoLines/src/gui/archaeoLinesDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -30,106 +30,10 @@
<number>0</number>
</property>
<item>
<widget class="BarFrame" name="TitleBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="TitleBar" name="titleBar">
<property name="title">
<string>ArchaeoLines Plug-in Configuration</string>
</property>
<property name="minimumSize">
<size>
<width>530</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<layout class="QHBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="stelWindowTitle">
<property name="text">
<string>ArchaeoLines Plug-in Configuration</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="StelCloseButton" name="closeStelWindow">
<property name="minimumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
Expand Down Expand Up @@ -930,7 +834,7 @@
</widget>
<customwidgets>
<customwidget>
<class>BarFrame</class>
<class>TitleBar</class>
<extends>QFrame</extends>
<header>Dialog.hpp</header>
<container>1</container>
Expand Down
Loading

0 comments on commit b87db1a

Please sign in to comment.