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
Model registry
Operate
Environments
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
eta
gajim
Commits
2c575169
Commit
2c575169
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
[gjc] bigger avatar now is transparent and has center the smaller avatar
parent
365204f9
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/tabbed_chat_window.py
+17
-9
17 additions, 9 deletions
src/tabbed_chat_window.py
with
17 additions
and
9 deletions
src/tabbed_chat_window.py
+
17
−
9
View file @
2c575169
## -*- Mode: python; tab-width: 4; indent-tabs-mode: t; coding: utf-8; -*-
## tabbed_chat_window.py
##
## Gajim Team:
...
...
@@ -157,7 +158,7 @@ class TabbedChatWindow(chat.Chat):
if
self
.
show_bigger_avatar_timeout_id
is
not
None
:
gobject
.
source_remove
(
self
.
show_bigger_avatar_timeout_id
)
def
show_bigger_avatar
(
self
,
widget
):
def
show_bigger_avatar
(
self
,
small_avatar
):
'''
resizes the avatar, if needed, so it has at max half the screen size
and shows it
'''
jid
=
self
.
get_active_jid
()
...
...
@@ -177,17 +178,26 @@ class TabbedChatWindow(chat.Chat):
avatar_h
=
half_scr_h
window
=
gtk
.
Window
(
gtk
.
WINDOW_POPUP
)
self
.
bigger_avatar_window
=
window
image
=
gtk
.
Image
()
image
.
set_from_pixbuf
(
avatar_pixbuf
)
window
.
add
(
image
)
window
.
set_position
(
gtk
.
WIN_POS_MOUSE
)
pixmap
,
mask
=
avatar_pixbuf
.
render_pixmap_and_mask
()
window
.
set_size_request
(
avatar_w
,
avatar_h
)
# we should make the cursor visible
# gtk+ doesn't make use of the motion notify on gtkwindow by default
# so this line adds that
window
.
set_events
(
gtk
.
gdk
.
POINTER_MOTION_MASK
)
window
.
realize
(
)
window
.
set_app_paintable
(
True
)
window
.
realize
()
window
.
window
.
set_back_pixmap
(
pixmap
,
False
)
# make it transparent
window
.
window
.
shape_combine_mask
(
mask
,
0
,
0
)
# make the bigger avatar window show up centered
x0
,
y0
=
small_avatar
.
window
.
get_origin
()
x0
+=
small_avatar
.
allocation
.
x
y0
+=
small_avatar
.
allocation
.
y
center_x
=
x0
+
(
small_avatar
.
allocation
.
width
/
2
)
center_y
=
y0
+
(
small_avatar
.
allocation
.
height
/
2
)
pos_x
,
pos_y
=
center_x
-
(
avatar_w
/
2
),
center_y
-
(
avatar_h
/
2
)
window
.
move
(
pos_x
,
pos_y
)
# make the cursor invisible so we can see the image
invisible_cursor
=
gtkgui_helpers
.
get_invisible_cursor
()
window
.
window
.
set_cursor
(
invisible_cursor
)
...
...
@@ -195,8 +205,6 @@ class TabbedChatWindow(chat.Chat):
# we should hide the window
window
.
connect
(
'
leave_notify_event
'
,
self
.
on_window_avatar_leave_notify_event
)
window
.
connect
(
'
motion-notify-event
'
,
self
.
on_window_motion_notify_event
)
...
...
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