Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TSRh
gajim
Commits
d23612c9
Commit
d23612c9
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
implement double_click in systray. see #2932
parent
f586c8dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/systray.py
+16
-2
16 additions, 2 deletions
src/systray.py
with
16 additions
and
2 deletions
src/systray.py
+
16
−
2
View file @
d23612c9
...
...
@@ -60,6 +60,10 @@ def __init__(self):
self
.
added_hide_menuitem
=
False
self
.
img_tray
=
gtk
.
Image
()
self
.
status
=
'
offline
'
self
.
double_click
=
False
self
.
double_click_id
=
None
self
.
double_click_time
=
gtk
.
settings_get_default
().
get_property
(
'
gtk-double-click-time
'
)
self
.
xml
=
gtkgui_helpers
.
get_glade
(
'
systray_context_menu.glade
'
)
self
.
systray_context_menu
=
self
.
xml
.
get_widget
(
'
systray_context_menu
'
)
self
.
xml
.
signal_autoconnect
(
self
)
...
...
@@ -283,6 +287,10 @@ def on_quit_menuitem_activate(self, widget):
gajim
.
interface
.
roster
.
on_quit_request
()
def
on_left_click
(
self
):
self
.
double_click_id
=
None
if
self
.
double_click
:
self
.
double_click
=
False
return
win
=
gajim
.
interface
.
roster
.
window
# toggle visible/hidden for roster window
if
win
.
get_property
(
'
visible
'
)
and
win
.
get_property
(
'
has-toplevel-focus
'
):
...
...
@@ -312,10 +320,16 @@ def on_middle_click(self):
def
on_clicked
(
self
,
widget
,
event
):
self
.
on_tray_leave_notify_event
(
widget
,
None
)
if
event
.
type
==
gtk
.
gdk
.
_2BUTTON_PRESS
:
self
.
double_click
=
True
self
.
on_middle_click
()
if
event
.
type
!=
gtk
.
gdk
.
BUTTON_PRESS
:
return
if
event
.
button
==
1
:
# Left click
self
.
on_left_click
()
if
self
.
double_click_id
:
gobject
.
source_remove
(
self
.
double_click_id
)
self
.
double_click_id
=
gobject
.
timeout_add
(
self
.
double_click_time
,
self
.
on_left_click
)
elif
event
.
button
==
2
:
# middle click
self
.
on_middle_click
()
elif
event
.
button
==
3
:
# right click
...
...
@@ -405,4 +419,4 @@ def hide_icon(self):
self
.
t
=
None
self
.
unsubscribe_events
()
# vim: se ts=3:
\ No newline at end of file
# vim: se ts=3:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment