Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KDecoration
Commits
fac24225
Commit
fac24225
authored
Nov 22, 2020
by
Xaver Hugl
Browse files
Add a QRect to requestShowWindowMenu
parent
f6367b9d
Changes
6
Hide whitespace changes
Inline
Side-by-side
autotests/mockclient.cpp
View file @
fac24225
...
...
@@ -182,7 +182,7 @@ void MockClient::requestMinimize()
emit
minimizeRequested
();
}
void
MockClient
::
requestShowWindowMenu
()
void
MockClient
::
requestShowWindowMenu
(
const
QRect
&
rect
)
{
emit
menuRequested
();
}
...
...
autotests/mockclient.h
View file @
fac24225
...
...
@@ -45,7 +45,7 @@ public:
void
requestContextHelp
()
override
;
void
requestToggleMaximization
(
Qt
::
MouseButtons
buttons
)
override
;
void
requestMinimize
()
override
;
void
requestShowWindowMenu
()
override
;
void
requestShowWindowMenu
(
const
QRect
&
rect
)
override
;
void
requestShowApplicationMenu
(
const
QRect
&
rect
,
int
actionId
)
override
;
void
requestToggleKeepAbove
()
override
;
void
requestToggleKeepBelow
()
override
;
...
...
src/decoration.cpp
View file @
fac24225
...
...
@@ -161,10 +161,14 @@ DELEGATE(requestToggleOnAllDesktops)
DELEGATE
(
requestToggleShade
)
DELEGATE
(
requestToggleKeepAbove
)
DELEGATE
(
requestToggleKeepBelow
)
DELEGATE
(
requestShowWindowMenu
)
#undef DELEGATE
void
Decoration
::
requestShowWindowMenu
(
const
QRect
&
rect
)
{
d
->
client
->
d
->
requestShowWindowMenu
(
rect
);
}
void
Decoration
::
requestShowToolTip
(
const
QString
&
text
)
{
d
->
client
->
d
->
requestShowToolTip
(
text
);
...
...
src/decoration.h
View file @
fac24225
...
...
@@ -161,7 +161,7 @@ public Q_SLOTS:
void
requestToggleShade
();
void
requestToggleKeepAbove
();
void
requestToggleKeepBelow
();
void
requestShowWindowMenu
();
void
requestShowWindowMenu
(
const
QRect
&
rect
);
void
requestShowToolTip
(
const
QString
&
text
);
void
requestHideToolTip
();
...
...
src/decorationbutton.cpp
View file @
fac24225
...
...
@@ -56,7 +56,10 @@ void DecorationButton::Private::init()
auto
settings
=
decoration
->
settings
();
switch
(
type
)
{
case
DecorationButtonType
::
Menu
:
QObject
::
connect
(
q
,
&
DecorationButton
::
clicked
,
decoration
.
data
(),
&
Decoration
::
requestShowWindowMenu
,
Qt
::
QueuedConnection
);
QObject
::
connect
(
q
,
&
DecorationButton
::
clicked
,
decoration
.
data
(),
[
this
](
Qt
::
MouseButton
button
){
Q_UNUSED
(
button
)
decoration
->
requestShowWindowMenu
(
q
->
geometry
().
toRect
());
},
Qt
::
QueuedConnection
);
QObject
::
connect
(
q
,
&
DecorationButton
::
doubleClicked
,
decoration
.
data
(),
&
Decoration
::
requestClose
,
Qt
::
QueuedConnection
);
QObject
::
connect
(
settings
.
data
(),
&
DecorationSettings
::
closeOnDoubleClickOnMenuChanged
,
q
,
[
this
](
bool
enabled
)
{
...
...
src/private/decoratedclientprivate.h
View file @
fac24225
...
...
@@ -73,7 +73,7 @@ public:
virtual
void
requestToggleShade
()
=
0
;
virtual
void
requestToggleKeepAbove
()
=
0
;
virtual
void
requestToggleKeepBelow
()
=
0
;
virtual
void
requestShowWindowMenu
()
=
0
;
virtual
void
requestShowWindowMenu
(
const
QRect
&
rect
)
=
0
;
Decoration
*
decoration
();
Decoration
*
decoration
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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