41
40
#include <libawn/awn-applet.h>
42
41
#include <glib/gmacros.h>
43
42
#include <glib/gerror.h>
44
#include <gconf/gconf-value.h>
46
44
#include <libawn/awn-dialog.h>
47
45
#include <libawn/awn-applet-simple.h>
169
GtkStyle *style = gtk_widget_get_style(widget);
170
GdkColor *background_color = &style->bg[GTK_STATE_NORMAL];
172
166
awn_cairo_set_source_color_with_alpha_multiplier(cr, G_daemon_config.awn_bg, windata->gradient_factor);
173
167
cairo_rectangle(cr, 0, 0,
174
168
widget->allocation.width,
588
591
WindowData *windata;
590
593
windata = g_new0(WindowData, 1);
591
windata->use_gtk_style = G_daemon_config.awn_honour_gtk;
592
594
windata->show_notification_win_title = FALSE;
593
595
windata->border_width = G_daemon_config.awn_border_width;
594
596
windata->gradient_factor = G_daemon_config.awn_gradient_factor;
754
756
windata->body_label = gtk_label_new(NULL);
756
758
windata->body_label = sexy_url_label_new();
759
g_signal_connect_swapped(G_OBJECT(windata->body_label), "url_activated",
760
G_CALLBACK(windata->url_clicked), win);
759
763
gtk_box_pack_start(GTK_BOX(vbox), windata->body_label, TRUE, TRUE, 0);
763
767
gtk_label_set_line_wrap(GTK_LABEL(windata->body_label), TRUE);
765
g_signal_connect_swapped(G_OBJECT(windata->body_label), "url_activated",
766
G_CALLBACK(windata->url_clicked), win);
768
769
atkobj = gtk_widget_get_accessible(windata->body_label);
770
771
atk_object_set_description(atkobj, "Notification body text.");
780
781
gtk_container_add(GTK_CONTAINER(alignment), windata->actions_box);
782
if (windata->use_gtk_style)
784
GtkStyle *style = gtk_widget_get_style(windata->win);
786
G_daemon_config.awn_bg = desktop_agnostic_color_new(&style->bg[GTK_STATE_NORMAL], BACKGROUND_OPACITY);
787
G_daemon_config.awn_border = desktop_agnostic_color_new(&style->fg[GTK_STATE_ACTIVE], G_MAXUSHORT);
790
783
return GTK_WINDOW(win);
856
if (windata->use_gtk_style)
858
str = g_strdup_printf("<b><big><span>%s</span></big></b>", summary);
862
str = g_strdup_printf("<b><big><span foreground=\"#%s\">%s</span></big></b>", G_daemon_config.awn_text_str, summary);
849
str = g_strdup_printf("<b><big><span foreground=\"#%s\">%s</span></big></b>", G_daemon_config.awn_text_str, summary);
866
851
gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
870
if (windata->use_gtk_style)
872
str = g_strdup_printf("%s<small><span> %s%c</span></small>%s", G_daemon_config.bold_text_body ? "<b>" : "",
873
body, endchar, G_daemon_config.bold_text_body ? "</b>" : "");
877
str = g_strdup_printf("%s<small><span foreground=\"#%s\"> %s%c\n</span></small>%s", G_daemon_config.bold_text_body ? "<b>" : "",
878
G_daemon_config.awn_text_str, body, endchar, G_daemon_config.bold_text_body ? "</b>" : "");
855
str = g_strdup_printf("%s<small><span foreground=\"#%s\"> %s%c\n</span></small>%s", G_daemon_config.bold_text_body ? "<b>" : "",
856
G_daemon_config.awn_text_str, body, endchar, G_daemon_config.bold_text_body ? "</b>" : "");
881
858
#ifdef HAVE_GTK_URL_LABEL
882
gtk_entry_set_markup(GTK_LABEL(windata->body_label), str);
859
gtk_label_set_markup(GTK_LABEL(windata->body_label), str);
884
861
sexy_url_label_set_markup(SEXY_URL_LABEL(windata->body_label), str);
892
869
G_daemon_config.awn_text_str, tmp, endchar, G_daemon_config.bold_text_body ? "</b>" : "");
894
871
#ifdef HAVE_GTK_URL_LABEL
895
gtk_entry_set_markup(GTK_LABEL(windata->body_label), str);
872
gtk_label_set_markup(GTK_LABEL(windata->body_label), str);
897
874
sexy_url_label_set_markup(SEXY_URL_LABEL(windata->body_label), str);
983
958
if (windata->timeout > 0)
985
960
gdouble pct = (gdouble)windata->remaining / (gdouble)windata->timeout;
986
gushort old_alpha = G_daemon_config.awn_border->alpha;
961
gushort old_alpha = desktop_agnostic_color_get_alpha(G_daemon_config.awn_border);
988
G_daemon_config.awn_border->alpha = G_MAXUSHORT;
963
desktop_agnostic_color_set_alpha(G_daemon_config.awn_border, G_MAXUSHORT);
989
964
// gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_ACTIVE]);
990
965
awn_cairo_set_source_color(cr, G_daemon_config.awn_border);
991
G_daemon_config.awn_border->alpha = old_alpha;
966
desktop_agnostic_color_set_alpha(G_daemon_config.awn_border, old_alpha);
992
967
cairo_move_to(cr, PIE_RADIUS, PIE_RADIUS);
993
968
cairo_arc_negative(cr, PIE_RADIUS, PIE_RADIUS, PIE_RADIUS,
994
969
-G_PI_2, -(pct * G_PI * 2) - G_PI_2);
1133
1107
x = x - WIDTH - 1;
1135
if (y + nw->allocation.height >= gdk_screen_get_height(gdk_screen_get_default()))
1109
switch (awn_applet_get_pos_type(G_daemon_config.awn_app))
1137
y = y - nw->allocation.height - 1;
1112
if (y + nw->allocation.height >= gdk_screen_get_height(gdk_screen_get_default()))
1114
y = y + nw->allocation.height - 1;
1117
case GTK_POS_BOTTOM:
1118
if (y + nw->allocation.height >= gdk_screen_get_height(gdk_screen_get_default()))
1120
y = y - nw->allocation.height - 1;
1140
1125
else if (y + nw->allocation.height >= gdk_screen_get_height(gdk_screen_get_default()))
1143
y = y - nw->allocation.height - 1;
1127
switch (awn_applet_get_pos_type(G_daemon_config.awn_app))
1130
if (y + nw->allocation.height >= gdk_screen_get_height(gdk_screen_get_default()))
1132
y = y + nw->allocation.height - 1;
1135
case GTK_POS_BOTTOM:
1136
if (y + nw->allocation.height >= gdk_screen_get_height(gdk_screen_get_default()))
1138
y = y - nw->allocation.height - 1;
1146
1144
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");