12 Commits

Author SHA1 Message Date
Benedikt Heine
bbbddad3a7 Use structs for notifications 2018-09-16 02:58:31 +02:00
Benedikt Heine
de0f0bf3d9 Pack type RawImage into raw_image struct 2018-09-16 02:58:26 +02:00
Benedikt Heine
8399ef2d7c Better warnings for failed icons
As the get_pixbuf_from_file should retrieve a file's content, it
shouldn't fail silently, if the file isn't there.

For codepaths, which don't use the `icon_path` to search for a given
icon, it gives a clearer error message.
2018-07-06 14:20:01 +02:00
Benedikt Heine
a2b383ec0b Add Tests for tilde expansion in icons 2018-06-23 23:49:25 +02:00
Benedikt Heine
646a35d2da Do not search absolute paths in the icon_path
The icon_path has no point for searching an absolute filename. It was
actually meant to avoid the complex lookup algorithm of the icon theme
spec. And the iconname in this case should be actually just the icon's
basename when searching the path.

Concatenating icons like `~/testimg.png` with all icon paths has no
point and also an additional suffix has no point.
2018-06-19 10:37:08 +02:00
Benedikt Heine
42cc561569 Implement tilde replacing in icon names 2018-06-19 10:24:24 +02:00
Nikos Tsipinakis
2a1c4946b5 Add log message when failing to load an icon 2018-05-14 09:31:53 +03:00
Nikos Tsipinakis
806ba9b978 Add xpm to supported icon extensions
The freedesktop icon spec specifies that xpm image files should be
supported for backwards compatibility.
2018-05-14 09:31:53 +03:00
Nikos Tsipinakis
5e7f58203e Refactor hacky floating point casts
Avoid casting an int to a double for a calculation only to cast it back,
instead prefer to use integer operations where appropriate.
2018-05-14 09:30:54 +03:00
Nikos Tsipinakis
4faa9cbaaa Isolate GdkPixbuf usage to icon.c
Cleans up the clutter in draw and since only a single icon function is
called externally from icon.c it'll make things easier if we ever decide
to switch icon libraries.
2018-05-14 09:30:42 +03:00
Benedikt Heine
3bfc77864f Refactor GdkPixbuf loading
Rename both functions to make clear, what the difference between the
previous functions _from_file and _from_path is. Also remove the
superfluous `== NULL` checks as these don't match dunst's current style.
2018-05-14 09:11:25 +03:00
Nikos Tsipinakis
52055f12c7 Move icon related methods to icon.c
The first step to cleaning out x.c.
2018-05-06 13:47:20 +03:00