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
28c13224
Commit
28c13224
authored
May 13, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for initial "View" toolbar item not being checked as active
parent
44d148df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
8 deletions
+42
-8
MainWindow.cc
src/ui/MainWindow.cc
+40
-8
QGCToolBar.cc
src/ui/QGCToolBar.cc
+2
-0
No files found.
src/ui/MainWindow.cc
View file @
28c13224
...
...
@@ -1311,14 +1311,46 @@ void MainWindow::connectCommonActions()
perspectives
->
setExclusive
(
true
);
// Mark the right one as selected
if
(
currentView
==
VIEW_ENGINEER
)
ui
.
actionEngineersView
->
setChecked
(
true
);
if
(
currentView
==
VIEW_MAVLINK
)
ui
.
actionMavlinkView
->
setChecked
(
true
);
if
(
currentView
==
VIEW_FLIGHT
)
ui
.
actionFlightView
->
setChecked
(
true
);
if
(
currentView
==
VIEW_SIMULATION
)
ui
.
actionSimulation_View
->
setChecked
(
true
);
if
(
currentView
==
VIEW_MISSION
)
ui
.
actionMissionView
->
setChecked
(
true
);
if
(
currentView
==
VIEW_CONFIGURATION
)
ui
.
actionConfiguration_2
->
setChecked
(
true
);
if
(
currentView
==
VIEW_FIRMWAREUPDATE
)
ui
.
actionFirmwareUpdateView
->
setChecked
(
true
);
if
(
currentView
==
VIEW_UNCONNECTED
)
ui
.
actionUnconnectedView
->
setChecked
(
true
);
if
(
currentView
==
VIEW_ENGINEER
)
{
ui
.
actionEngineersView
->
setChecked
(
true
);
ui
.
actionEngineersView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_MAVLINK
)
{
ui
.
actionMavlinkView
->
setChecked
(
true
);
ui
.
actionMavlinkView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_FLIGHT
)
{
ui
.
actionFlightView
->
setChecked
(
true
);
ui
.
actionFlightView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_SIMULATION
)
{
ui
.
actionSimulation_View
->
setChecked
(
true
);
ui
.
actionSimulation_View
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_MISSION
)
{
ui
.
actionMissionView
->
setChecked
(
true
);
ui
.
actionMissionView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_CONFIGURATION
)
{
ui
.
actionConfiguration_2
->
setChecked
(
true
);
ui
.
actionConfiguration_2
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_FIRMWAREUPDATE
)
{
ui
.
actionFirmwareUpdateView
->
setChecked
(
true
);
ui
.
actionFirmwareUpdateView
->
activate
(
QAction
::
Trigger
);
}
if
(
currentView
==
VIEW_UNCONNECTED
)
{
ui
.
actionUnconnectedView
->
setChecked
(
true
);
ui
.
actionUnconnectedView
->
activate
(
QAction
::
Trigger
);
}
// The UAS actions are not enabled without connection to system
ui
.
actionLiftoff
->
setEnabled
(
false
);
...
...
src/ui/QGCToolBar.cc
View file @
28c13224
...
...
@@ -197,6 +197,7 @@ void QGCToolBar::setPerspectiveChangeActions(const QList<QAction*> &actions)
first
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
first
->
setCheckable
(
true
);
connect
(
first
,
SIGNAL
(
clicked
(
bool
)),
actions
.
first
(),
SIGNAL
(
triggered
(
bool
)));
connect
(
actions
.
first
(),
SIGNAL
(
triggered
(
bool
)),
first
,
SLOT
(
setChecked
(
bool
)));
first
->
setStyleSheet
(
"QToolButton { min-width: 60px; 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; padding-left: 4px; padding-right: 8px; 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
);
...
...
@@ -212,6 +213,7 @@ 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
)));
connect
(
actions
.
at
(
i
),
SIGNAL
(
triggered
(
bool
)),
btn
,
SLOT
(
setChecked
(
bool
)));
btn
->
setStyleSheet
(
"QToolButton { min-width: 60px; 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
);
...
...
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