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
l-n-s
gajim
Commits
2ece342d
Commit
2ece342d
authored
6 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Notification: Use load_icon()
parent
1179333f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gajim/gtk/util.py
+5
-3
5 additions, 3 deletions
gajim/gtk/util.py
gajim/gtkgui_helpers.py
+0
-2
0 additions, 2 deletions
gajim/gtkgui_helpers.py
gajim/notify.py
+2
-2
2 additions, 2 deletions
gajim/notify.py
with
7 additions
and
7 deletions
gajim/gtk/util.py
+
5
−
3
View file @
2ece342d
...
...
@@ -98,10 +98,12 @@ def icon_exists(name: str) -> bool:
return
_icon_theme
.
has_icon
(
name
)
def
load_icon
(
icon_name
,
widget
,
size
=
16
,
pixbuf
=
False
,
flags
=
Gtk
.
IconLookupFlags
.
FORCE_SIZE
):
def
load_icon
(
icon_name
,
widget
=
None
,
size
=
16
,
pixbuf
=
False
,
scale
=
None
,
flags
=
Gtk
.
IconLookupFlags
.
FORCE_SIZE
):
if
widget
is
not
None
:
scale
=
widget
.
get_scale_factor
()
scale
=
widget
.
get_scale_factor
()
if
not
scale
:
log
.
warning
(
'
Could not determine scale factor
'
)
scale
=
1
...
...
This diff is collapsed.
Click to expand it.
gajim/gtkgui_helpers.py
+
0
−
2
View file @
2ece342d
...
...
@@ -49,8 +49,6 @@ from gajim.common.const import PEPEventType, ACTIVITIES, MOODS
log
=
logging
.
getLogger
(
'
gajim.gtkgui_helpers
'
)
gtk_icon_theme
=
Gtk
.
IconTheme
.
get_default
()
gtk_icon_theme
.
append_search_path
(
configpaths
.
get
(
'
ICONS
'
))
class
Color
:
BLACK
=
Gdk
.
RGBA
(
red
=
0
,
green
=
0
,
blue
=
0
,
alpha
=
1
)
...
...
This diff is collapsed.
Click to expand it.
gajim/notify.py
+
2
−
2
View file @
2ece342d
...
...
@@ -41,6 +41,7 @@ from gajim.common.i18n import _
from
gajim.gtk.util
import
get_icon_name
from
gajim.gtk.util
import
get_monitor_scale_factor
from
gajim.gtk.util
import
get_total_screen_geometry
from
gajim.gtk.util
import
load_icon
log
=
logging
.
getLogger
(
'
gajim.notify
'
)
...
...
@@ -175,8 +176,7 @@ class Notification:
return
scale
=
get_monitor_scale_factor
()
icon_pixbuf
=
gtkgui_helpers
.
gtk_icon_theme
.
load_icon_for_scale
(
icon_name
,
48
,
scale
,
0
)
icon_pixbuf
=
load_icon
(
icon_name
,
size
=
48
,
pixbuf
=
True
,
scale
=
scale
)
notification
=
Gio
.
Notification
()
if
title
is
not
None
:
...
...
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