Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norstbox
gajim
Commits
30f7f7be
Commit
30f7f7be
authored
Apr 07, 2006
by
Yann Leboulanger
Browse files
don't rescale image when size is < 1
parent
c0bcd072
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gtkgui_helpers.py
View file @
30f7f7be
...
...
@@ -401,13 +401,15 @@ def _get_fade_color(treeview, selected, focused):
int
(
bg
.
blue
*
p
+
fg
.
blue
*
q
))
def
get_scaled_pixbuf
(
pixbuf
,
kind
):
'''returns scaled pixbuf, keeping ratio etc
'''returns scaled pixbuf, keeping ratio etc
or None
kind is either "chat" or "roster" or "notification" or "tooltip"'''
# resize to a width / height for the avatar not to have distortion
# (keep aspect ratio)
width
=
gajim
.
config
.
get
(
kind
+
'_avatar_width'
)
height
=
gajim
.
config
.
get
(
kind
+
'_avatar_height'
)
if
width
<
1
or
height
<
1
:
return
None
# Pixbuf size
pix_width
=
pixbuf
.
get_width
()
...
...
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