Fix stuff regarding icons

- fix icon_path string calculations
- add default settings to config.def.h
This commit is contained in:
Gjum 2014-02-26 18:52:36 +01:00
parent c2801181f8
commit d9e68803dc
4 changed files with 7 additions and 7 deletions

View File

@ -50,6 +50,9 @@ char *dmenu = "/usr/bin/dmenu";
char *browser = "/usr/bin/firefox";
/* path to default icons */
char *icon_path = "/usr/share/icons/gnome/32x32/status/";
/* follow focus to different monitor and display notifications there?
* possible values:
* FOLLOW_NONE

View File

@ -142,7 +142,7 @@
show_icons = no
# Path to default icons.
icon_path = /usr/share/icons/gnome/32x32/status/%s.png
icon_path = /usr/share/icons/gnome/32x32/status/
[frame]
width = 3

View File

@ -283,7 +283,9 @@ int notification_init(notification * n, int id)
/* Add icon path if relative */
if (strlen(n->icon) > 0 && n->icon[0] != '/' && n->icon[0] != '~') {
n->icon = string_replace("%s", n->icon, settings.icon_path);
char *new = g_strconcat(settings.icon_path, n->icon, ".png", NULL);
free(n->icon);
n->icon = new;
}
n->msg = string_replace("%a", n->appname, g_strdup(n->format));

5
x.c
View File

@ -205,11 +205,6 @@ static dimension_t calculate_dimensions(GSList *layouts)
dim.h += (g_slist_length(layouts) - 1) * settings.separator_height;
dim.h += g_slist_length(layouts) * settings.padding * 2;
/* text_width: width of the widest content so far
* total_width: width of the widest notification so far, with padding
* dim.w: width of the window, with frame
* Also call r_setup_pango_layout() when changing text_width.
*/
int text_width = 0, total_width = 0;
for (GSList *iter = layouts; iter; iter = iter->next) {
colored_layout *cl = iter->data;