Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KAlarm
Commits
b821cd4f
Commit
b821cd4f
authored
Jul 15, 2021
by
David Jarvie
Browse files
Show context menu at correct position on Wayland
parent
103d92c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/daymatrix.cpp
View file @
b821cd4f
...
...
@@ -359,7 +359,7 @@ void DayMatrix::mousePressEvent(QMouseEvent* e)
{
if
(
i
<
mSelStart
||
i
>
mSelEnd
)
setMouseSelection
(
i
,
i
,
true
);
popupMenu
();
popupMenu
(
e
->
globalPos
()
);
}
else
if
(
e
->
button
()
==
Qt
::
LeftButton
)
{
...
...
@@ -374,13 +374,13 @@ void DayMatrix::mousePressEvent(QMouseEvent* e)
}
}
void
DayMatrix
::
popupMenu
()
void
DayMatrix
::
popupMenu
(
const
QPoint
&
pos
)
{
NewAlarmAction
newAction
(
false
,
QString
(),
nullptr
);
QMenu
*
popup
=
newAction
.
menu
();
connect
(
&
newAction
,
&
NewAlarmAction
::
selected
,
this
,
&
DayMatrix
::
newAlarm
);
connect
(
&
newAction
,
&
NewAlarmAction
::
selectedTemplate
,
this
,
&
DayMatrix
::
newAlarmFromTemplate
);
popup
->
exec
(
QCursor
::
pos
()
);
popup
->
exec
(
pos
);
}
void
DayMatrix
::
mouseReleaseEvent
(
QMouseEvent
*
e
)
...
...
src/daymatrix.h
View file @
b821cd4f
...
...
@@ -93,7 +93,7 @@ private:
bool
recalculateToday
();
QString
getHolidayLabel
(
int
offset
)
const
;
void
setMouseSelection
(
int
start
,
int
end
,
bool
emitSignal
);
void
popupMenu
();
// pop up a context menu for creating a new alarm
void
popupMenu
(
const
QPoint
&
);
// pop up a context menu for creating a new alarm
int
getDayIndex
(
const
QPoint
&
)
const
;
// get index of the day located at a point in the matrix
// If changes are pending, recalculates which days in the matrix have
...
...
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