Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JuK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
JuK
Commits
6e7b2a3e
Commit
6e7b2a3e
authored
Feb 08, 2004
by
Cristian Tibirna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CT: associate play/pause toggling with MMB on systray icon
svn path=/trunk/kdemultimedia/juk/; revision=286299
parent
304c8bc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
systemtray.cpp
systemtray.cpp
+30
-6
systemtray.h
systemtray.h
+1
-0
No files found.
systemtray.cpp
View file @
6e7b2a3e
...
...
@@ -200,6 +200,30 @@ void SystemTray::wheelEvent(QWheelEvent *e)
e
->
accept
();
}
/*
* Reimplemented this in order to use the middle mouse button
*/
void
SystemTray
::
mousePressEvent
(
QMouseEvent
*
e
)
{
switch
(
e
->
button
()
)
{
case
LeftButton
:
case
RightButton
:
KSystemTray
::
mousePressEvent
(
e
);
break
;
case
MidButton
:
if
(
!
rect
().
contains
(
e
->
pos
()
)
)
return
;
if
(
m_pauseAction
->
isEnabled
()
)
m_pauseAction
->
activate
();
else
m_playAction
->
activate
();
break
;
default:
// nothing
break
;
}
}
/*
* This function copies the entirety of src into dest, starting in
* dest at x and y. This function exists because I was unable to find
...
...
@@ -209,12 +233,12 @@ void SystemTray::wheelEvent(QWheelEvent *e)
static
bool
copyImage
(
QImage
&
dest
,
QImage
&
src
,
int
x
,
int
y
)
{
if
(
dest
.
depth
()
!=
src
.
depth
())
return
false
;
return
false
;
if
((
x
+
src
.
width
())
>=
dest
.
width
())
return
false
;
if
((
y
+
src
.
height
())
>=
dest
.
height
())
return
false
;
// We want to use KIconEffect::overlay to do this, since it handles
// alpha, but the images need to be the same size. We can handle that.
...
...
@@ -225,24 +249,24 @@ static bool copyImage(QImage &dest, QImage &src, int x, int y)
// etc.
large_src
.
detach
();
// However, we do have to specifically ensure that setAlphaBuffer is set
// to false
large_src
.
setAlphaBuffer
(
false
);
large_src
.
fill
(
0
);
// All transparent pixels
large_src
.
setAlphaBuffer
(
true
);
int
w
=
src
.
width
();
int
h
=
src
.
height
();
for
(
int
dx
=
0
;
dx
<
w
;
dx
++
)
for
(
int
dy
=
0
;
dy
<
h
;
dy
++
)
large_src
.
setPixel
(
dx
+
x
,
dy
+
y
,
src
.
pixel
(
dx
,
dy
));
// Apply effect to image
KIconEffect
::
overlay
(
dest
,
large_src
);
return
true
;
}
...
...
systemtray.h
View file @
6e7b2a3e
...
...
@@ -44,6 +44,7 @@ private:
virtual
void
wheelEvent
(
QWheelEvent
*
e
);
void
createPopup
(
const
QString
&
songName
,
bool
addButtons
=
true
);
void
setToolTip
(
const
QString
&
tip
=
QString
::
null
);
void
mousePressEvent
(
QMouseEvent
*
);
QPixmap
createPixmap
(
const
QString
&
pixName
);
QPixmap
m_playPix
;
...
...
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