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
aa2a9714
Commit
aa2a9714
authored
May 10, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearranged action bar, saved screen state
parent
898eddc8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
22 deletions
+52
-22
configuration.h
src/configuration.h
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+8
-4
MainWindow.ui
src/ui/MainWindow.ui
+5
-2
QGCToolBar.cc
src/ui/QGCToolBar.cc
+34
-14
QGCToolBar.h
src/ui/QGCToolBar.h
+3
-0
No files found.
src/configuration.h
View file @
aa2a9714
...
...
@@ -11,14 +11,14 @@
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 1.0.
6
(beta)"
#define QGC_APPLICATION_VERSION "v. 1.0.
7
(beta)"
namespace
QGC
{
const
QString
APPNAME
=
"QGROUNDCONTROL"
;
const
QString
COMPANYNAME
=
"QGROUNDCONTROL"
;
const
int
APPLICATIONVERSION
=
10
6
;
// 1.0.6
const
int
APPLICATIONVERSION
=
10
7
;
// 1.0.7
}
#endif // QGC_CONFIGURATION_H
src/ui/MainWindow.cc
View file @
aa2a9714
...
...
@@ -161,17 +161,21 @@ MainWindow::MainWindow(QWidget *parent):
// Load Toolbar
toolBar
=
new
QGCToolBar
(
this
);
this
->
addToolBar
(
toolBar
);
// Add actions (inverted order due to insert)
// Add actions for average users (displayed next to each other)
QList
<
QAction
*>
actions
;
actions
<<
ui
.
actionMissionView
;
actions
<<
ui
.
actionFlightView
;
actions
<<
ui
.
actionEngineersView
;
actions
<<
ui
.
actionSimulation_View
;
actions
<<
ui
.
actionConfiguration_2
;
toolBar
->
setPerspectiveChangeActions
(
actions
);
// Add actions for advanced users (displayed in dropdown under "advanced")
QList
<
QAction
*>
advancedActions
;
advancedActions
<<
ui
.
actionSimulation_View
;
advancedActions
<<
ui
.
actionEngineersView
;
toolBar
->
setPerspectiveChangeAdvancedActions
(
advancedActions
);
customStatusBar
=
new
QGCStatusBar
(
this
);
setStatusBar
(
customStatusBar
);
statusBar
()
->
setSizeGripEnabled
(
true
);
...
...
src/ui/MainWindow.ui
View file @
aa2a9714
...
...
@@ -51,7 +51,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
800
</width>
<height>
2
1
</height>
<height>
2
2
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuMGround"
>
...
...
@@ -480,7 +480,10 @@
<normaloff>
:/files/images/categories/preferences-system.svg
</normaloff>
:/files/images/categories/preferences-system.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Configuration
</string>
<string>
Config
</string>
</property>
<property
name=
"toolTip"
>
<string>
Configuration options of the vehicle.
</string>
</property>
</action>
<action
name=
"actionAdvanced_Mode"
>
...
...
src/ui/QGCToolBar.cc
View file @
aa2a9714
...
...
@@ -186,7 +186,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
{
if
(
actions
.
count
()
>
1
)
{
QButtonGroup
*
group
=
new
QButtonGroup
(
this
);
group
=
new
QButtonGroup
(
this
);
group
->
setExclusive
(
true
);
QToolButton
*
first
=
new
QToolButton
(
this
);
...
...
@@ -197,11 +197,11 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
first
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
first
->
setCheckable
(
true
);
connect
(
first
,
SIGNAL
(
clicked
(
bool
)),
actions
.
first
(),
SIGNAL
(
triggered
(
bool
)));
first
->
setStyleSheet
(
"QToolButton { min-width:
7
0px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 8px; margin-right: 0px; border-radius: 0px; border : 0px solid blue; border-bottom-left-radius: 6px; border-top-left-radius: 6px; border-left: 1px solid #484848; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
first
->
setStyleSheet
(
"QToolButton { min-width:
6
0px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 8px; margin-right: 0px; border-radius: 0px; border : 0px solid blue; border-bottom-left-radius: 6px; border-top-left-radius: 6px; border-left: 1px solid #484848; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
addWidget
(
first
);
group
->
addButton
(
first
);
for
(
int
i
=
1
;
i
<
actions
.
count
()
-
1
;
i
++
)
for
(
int
i
=
1
;
i
<
actions
.
count
();
i
++
)
{
// Add last button
QToolButton
*
btn
=
new
QToolButton
(
this
);
...
...
@@ -212,23 +212,22 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
btn
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
btn
->
setCheckable
(
true
);
connect
(
btn
,
SIGNAL
(
clicked
(
bool
)),
actions
.
at
(
i
),
SIGNAL
(
triggered
(
bool
)));
btn
->
setStyleSheet
(
"QToolButton { min-width:
7
0px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: -2px; margin-right: -2px; padding-left: 0px; padding-right: 0px; border-radius: 0px; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
btn
->
setStyleSheet
(
"QToolButton { min-width:
6
0px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: -2px; margin-right: -2px; padding-left: 0px; padding-right: 0px; border-radius: 0px; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
addWidget
(
btn
);
group
->
addButton
(
btn
);
}
// Add last button
QToolButton
*
last
=
new
QTool
Button
(
this
);
advancedButton
=
new
QPush
Button
(
this
);
// Add first button
last
->
setIcon
(
actions
.
last
()
->
icon
());
last
->
setText
(
actions
.
last
()
->
text
());
last
->
setToolTip
(
actions
.
last
()
->
toolTip
());
last
->
setCheckable
(
true
);
connect
(
last
,
SIGNAL
(
clicked
(
bool
)),
actions
.
last
(),
SIGNAL
(
triggered
(
bool
)));
last
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
last
->
setStyleSheet
(
"QToolButton { min-width: 70px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 0px; margin-right: 8px; padding-left: 0px; padding-right: 0px; border-radius: 0px; border : 0px solid blue; border-bottom-right-radius: 6px; border-top-right-radius: 6px; border-right: 1px solid #484848; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QToolButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
addWidget
(
last
);
group
->
addButton
(
last
);
advancedButton
->
setIcon
(
QIcon
(
":/files/images/apps/utilities-system-monitor.svg"
));
advancedButton
->
setText
(
tr
(
"Pro"
));
advancedButton
->
setToolTip
(
tr
(
"Options for advanced users"
));
advancedButton
->
setCheckable
(
true
);
// advancedButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
advancedButton
->
setStyleSheet
(
"QPushButton { min-width: 60px; font-weight: bold; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); margin-left: 0px; margin-right: 13px; padding-left: 0px; padding-right: 8px; border-radius: 0px; border : 0px solid blue; border-bottom-right-radius: 6px; border-top-right-radius: 6px; border-right: 1px solid #484848; border-top: 1px solid #484848; border-bottom: 1px solid #484848; } QPushButton:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
addWidget
(
advancedButton
);
group
->
addButton
(
advancedButton
);
}
else
{
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"Not enough perspective change actions provided"
;
}
...
...
@@ -237,6 +236,27 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
createUI
();
}
void
QGCToolBar
::
setPerspectiveChangeAdvancedActions
(
const
QList
<
QAction
*>
&
actions
)
{
if
(
actions
.
count
()
>
1
)
{
QMenu
*
menu
=
new
QMenu
(
advancedButton
);
for
(
int
i
=
0
;
i
<
actions
.
count
();
i
++
)
{
menu
->
addAction
(
actions
.
at
(
i
));
}
menu
->
setStyleSheet
(
"QMenu { font-weight: bold; min-width: 70px; color: #222222; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A2A3A4, stop: 1 #B6B7B8); border: 1px solid #484848; } QMenu:checked { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #555555, stop: 1 #787878); color: #DDDDDD; }"
);
advancedButton
->
setMenu
(
menu
);
}
else
{
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"Not enough perspective change actions provided"
;
}
}
void
QGCToolBar
::
setActiveUAS
(
UASInterface
*
active
)
{
// Do nothing if system is the same or NULL
...
...
src/ui/QGCToolBar.h
View file @
aa2a9714
...
...
@@ -40,6 +40,7 @@ class QGCToolBar : public QToolBar
public:
explicit
QGCToolBar
(
QWidget
*
parent
=
0
);
void
setPerspectiveChangeActions
(
const
QList
<
QAction
*>
&
action
);
void
setPerspectiveChangeAdvancedActions
(
const
QList
<
QAction
*>
&
action
);
~
QGCToolBar
();
public
slots
:
...
...
@@ -112,6 +113,8 @@ protected:
bool
systemArmed
;
LinkInterface
*
currentLink
;
QAction
*
firstAction
;
QPushButton
*
advancedButton
;
QButtonGroup
*
group
;
};
#endif // QGCTOOLBAR_H
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