Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SDK
KCacheGrind
Commits
0df27b4a
Commit
0df27b4a
authored
Sep 21, 2020
by
Calvin Buckley
🤔
Committed by
Albert Astals Cid
Nov 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dock icon menu now lists windows
parent
4652a798
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
qcachegrind/qcgtoplevel.cpp
qcachegrind/qcgtoplevel.cpp
+30
-8
qcachegrind/qcgtoplevel.h
qcachegrind/qcgtoplevel.h
+4
-2
No files found.
qcachegrind/qcgtoplevel.cpp
View file @
0df27b4a
...
...
@@ -642,6 +642,13 @@ void QCGTopLevel::createMenu()
this
->
windowMenu
->
addAction
(
_zoomAction
);
connect
(
this
->
windowMenu
,
&
QMenu
::
aboutToShow
,
this
,
&
QCGTopLevel
::
windowListAboutToShow
);
connect
(
this
->
windowMenu
,
&
QMenu
::
triggered
,
this
,
&
QCGTopLevel
::
windowListTriggered
);
// right-clicking the dock icon should be a window list
this
->
macDockMenu
=
new
QMenu
(
this
);
connect
(
this
->
macDockMenu
,
&
QMenu
::
aboutToShow
,
this
,
&
QCGTopLevel
::
macDockMenuAboutToShow
);
// it can reuse the same events, it just needs a diff menu structure
connect
(
this
->
macDockMenu
,
&
QMenu
::
triggered
,
this
,
&
QCGTopLevel
::
windowListTriggered
);
this
->
macDockMenu
->
setAsDockMenu
();
#endif
QMenu
*
helpMenu
=
mBar
->
addMenu
(
tr
(
"&Help"
));
...
...
@@ -1848,20 +1855,14 @@ void QCGTopLevel::partsUnhideAllSlot()
#endif
}
void
QCGTopLevel
::
w
indowList
AboutToShow
(
)
void
QCGTopLevel
::
insertW
indowList
(
QMenu
*
menu
)
{
windowMenu
->
clear
();
windowMenu
->
addAction
(
_minimizeAction
);
windowMenu
->
addAction
(
_zoomAction
);
windowMenu
->
addSeparator
();
auto
windowList
=
QApplication
::
topLevelWidgets
();
for
(
int
i
=
0
;
i
<
windowList
.
size
();
i
++
)
{
QWidget
*
topLevelRaw
=
windowList
[
i
];
if
(
QCGTopLevel
*
topLevel
=
qobject_cast
<
QCGTopLevel
*>
(
topLevelRaw
))
{
QString
windowTitle
=
topLevel
->
windowTitle
();
QAction
*
windowItem
=
windowM
enu
->
addAction
(
windowTitle
);
QAction
*
windowItem
=
m
enu
->
addAction
(
windowTitle
);
windowItem
->
setData
(
QVariant
::
fromValue
(
topLevel
));
if
(
topLevel
==
this
)
{
windowItem
->
setCheckable
(
true
);
...
...
@@ -1871,6 +1872,27 @@ void QCGTopLevel::windowListAboutToShow()
}
}
void
QCGTopLevel
::
windowListAboutToShow
()
{
windowMenu
->
clear
();
windowMenu
->
addAction
(
_minimizeAction
);
windowMenu
->
addAction
(
_zoomAction
);
windowMenu
->
addSeparator
();
insertWindowList
(
windowMenu
);
}
void
QCGTopLevel
::
macDockMenuAboutToShow
()
{
macDockMenu
->
clear
();
insertWindowList
(
macDockMenu
);
macDockMenu
->
addSeparator
();
macDockMenu
->
addAction
(
_newAction
);
}
void
QCGTopLevel
::
forwardAboutToShow
()
{
QMenu
*
popup
=
_forwardAction
->
menu
();
...
...
qcachegrind/qcgtoplevel.h
View file @
0df27b4a
...
...
@@ -139,6 +139,8 @@ public Q_SLOTS:
void
groupingAboutToShow
();
void
windowListTriggered
(
QAction
*
);
void
windowListAboutToShow
();
void
macDockMenuAboutToShow
();
void
insertWindowList
(
QMenu
*
);
bool
setEventType
(
EventType
*
);
bool
setEventType2
(
EventType
*
);
...
...
@@ -229,11 +231,11 @@ private:
QAction
*
_groupingMenuAction
,
*
_closeAction
;
QAction
*
_splittedToggleAction
,
*
_splitDirectionToggleAction
;
QAction
*
_layoutNext
,
*
_layoutPrev
,
*
_layoutRemove
,
*
_layoutDup
;
QAction
*
_layoutRestore
,
*
_layoutSave
;
QAction
*
_layoutRestore
,
*
_layoutSave
,
*
_toolbarToggleAction
;
QAction
*
_upAction
,
*
_forwardAction
,
*
_backAction
;
QAction
*
_configureAction
,
*
_aboutAction
,
*
_aboutQtAction
;
QAction
*
_minimizeAction
,
*
_zoomAction
;
QMenu
*
windowMenu
;
QMenu
*
windowMenu
,
*
macDockMenu
;
QComboBox
*
_eventTypeBox
;
TraceFunction
*
_function
;
...
...
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