Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a4201a09
Commit
a4201a09
authored
May 20, 2013
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revised the UI for styling QGC again. I think it's a little clearer now.
parent
2a0f669b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
73 deletions
+127
-73
MainWindow.cc
src/ui/MainWindow.cc
+1
-1
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+3
-16
QGCSettingsWidget.ui
src/ui/QGCSettingsWidget.ui
+123
-56
No files found.
src/ui/MainWindow.cc
View file @
a4201a09
...
...
@@ -1228,7 +1228,7 @@ bool MainWindow::loadStyle(QGC_MAINWINDOW_STYLE style, QString cssFile)
default:
style
=
QGC_MAINWINDOW_STYLE_DARK
;
case
QGC_MAINWINDOW_STYLE_DARK
:
s
tyleFileName
=
":files/styles/style-dark.css"
;
darkS
tyleFileName
=
":files/styles/style-dark.css"
;
break
;
case
QGC_MAINWINDOW_STYLE_LIGHT
:
styleFileName
=
":files/styles/style-light.css"
;
...
...
src/ui/QGCSettingsWidget.cc
View file @
a4201a09
...
...
@@ -17,9 +17,6 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
{
ui
->
setupUi
(
this
);
// Set the frame holding the options for the custom style frame to hidden by default
ui
->
customStyleFrame
->
setVisible
(
false
);
// Add all protocols
QList
<
ProtocolInterface
*>
protocols
=
LinkManager
::
instance
()
->
getProtocols
();
foreach
(
ProtocolInterface
*
protocol
,
protocols
)
{
...
...
@@ -53,7 +50,8 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
MainWindow
::
QGC_MAINWINDOW_STYLE
style
=
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)
MainWindow
::
instance
()
->
getStyle
();
ui
->
styleChooser
->
setCurrentIndex
(
style
);
connect
(
ui
->
styleChooser
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
styleChanged
(
int
)));
connect
(
ui
->
customStyleFileButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
selectStylesheet
()));
connect
(
ui
->
darkStyleCustomButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
selectStylesheet
()));
connect
(
ui
->
lightStyleCustomButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
selectStylesheet
()));
// Close / destroy
connect
(
ui
->
buttonBox
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
deleteLater
()));
...
...
@@ -128,18 +126,7 @@ bool QGCSettingsWidget::updateStyle()
}
void
QGCSettingsWidget
::
styleChanged
(
int
index
)
{
// If a custom style is selected, enable the advanced view for the custom stylesheet. Otherwise,
// make sure it's hidden.
if
(
index
==
2
||
index
==
3
)
{
ui
->
customStyleFrame
->
setVisible
(
true
);
}
else
{
ui
->
customStyleFrame
->
setVisible
(
false
);
}
{
// And trigger a style update.
updateStyle
();
}
\ No newline at end of file
src/ui/QGCSettingsWidget.ui
View file @
a4201a09
...
...
@@ -6,12 +6,12 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
535
</width>
<height>
427
</height>
<width>
392
</width>
<height>
313
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"
Preferred"
vsizetype=
"Minimum
"
>
<sizepolicy
hsizetype=
"
MinimumExpanding"
vsizetype=
"MinimumExpanding
"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
...
...
@@ -73,75 +73,142 @@
</widget>
</item>
<item>
<widget
class=
"QFrame"
name=
"styleFrame"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
<string>
Style
</string>
</property>
<property
name=
"frameShape"
>
<enum>
QFrame::Box
</enum>
</property>
<property
name=
"frameShadow"
>
<enum>
QFrame::Sunken
</enum>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_5"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<property
name=
"sizeConstraint"
>
<enum>
QLayout::SetMinimumSize
</enum>
</property>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Minimum"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Use:
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<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=
"QComboBox"
name=
"styleChooser"
>
<item>
<property
name=
"text"
>
<string>
Dark (for indoor use)
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Light (for outdoor use)
</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<
widget
class=
"QComboBox"
name=
"styleChooser
"
>
<
layout
class=
"QHBoxLayout"
name=
"DarkStyleLayout
"
>
<item>
<property
name=
"text"
>
<string>
Dark (for indoor use)
</string>
</property>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Minimum"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Dark:
</string>
</property>
</widget>
</item>
<item>
<property
name=
"text"
>
<string>
Light (for outdoor use)
</string>
</property>
<widget
class=
"QLineEdit"
name=
"darkStyleFile"
/>
</item>
<item>
<property
name=
"text"
>
<string>
Custom dark (for indoor use)
</string>
</property>
<widget
class=
"QPushButton"
name=
"darkStyleCustomButton"
>
<property
name=
"text"
>
<string>
Custom
</string>
</property>
</widget>
</item>
<item>
<property
name=
"text"
>
<string>
Custom light (for outdoor use)
</string>
</property>
<widget
class=
"QPushButton"
name=
"darkStyleDefaultButton"
>
<property
name=
"text"
>
<string>
Default
</string>
</property>
</widget>
</item>
</
widge
t>
</
layou
t>
</item>
<item>
<widget
class=
"QFrame"
name=
"customStyleFrame"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"frameShape"
>
<enum>
QFrame::NoFrame
</enum>
</property>
<property
name=
"frameShadow"
>
<enum>
QFrame::Plain
</enum>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<item>
<widget
class=
"QLineEdit"
name=
"lineEdit"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"customStyleFileButton"
>
<property
name=
"text"
>
<string>
Select
</string>
</property>
</widget>
</item>
</layout>
</widget>
<layout
class=
"QHBoxLayout"
name=
"LightStyleLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Minimum"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Light:
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"lightStyleFile"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"lightStyleCustomButton"
>
<property
name=
"text"
>
<string>
Custom
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"lightStyleDefaultButton"
>
<property
name=
"text"
>
<string>
Default
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
0
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment