19 |
|
|
20 |
#include "appdata.h" |
#include "appdata.h" |
21 |
|
|
22 |
|
#if !defined(USE_HILDON) || (MAEMO_VERSION_MAJOR < 5) |
23 |
void statusbar_highlight(appdata_t *appdata, gboolean highlight) { |
void statusbar_highlight(appdata_t *appdata, gboolean highlight) { |
24 |
if(highlight) { |
if(highlight) { |
25 |
GdkColor color; |
GdkColor color; |
33 |
|
|
34 |
|
|
35 |
// Set the persistent message, replacing anything currently there. |
// Set the persistent message, replacing anything currently there. |
|
|
|
36 |
void statusbar_set(appdata_t *appdata, const char *msg, gboolean highlight) { |
void statusbar_set(appdata_t *appdata, const char *msg, gboolean highlight) { |
37 |
statusbar_highlight(appdata, highlight); |
statusbar_highlight(appdata, highlight); |
38 |
|
|
118 |
return appdata->statusbar->eventbox; |
return appdata->statusbar->eventbox; |
119 |
} |
} |
120 |
|
|
121 |
|
#else |
122 |
|
void statusbar_highlight(appdata_t *appdata, gboolean highlight) { |
123 |
|
if(highlight) { |
124 |
|
GdkColor color; |
125 |
|
gdk_color_parse("red", &color); |
126 |
|
gtk_widget_modify_bg(appdata->statusbar->widget, GTK_STATE_NORMAL, &color); |
127 |
|
gtk_widget_modify_base(appdata->statusbar->widget, GTK_STATE_NORMAL, &color); |
128 |
|
gtk_widget_modify_fg(appdata->statusbar->widget, GTK_STATE_NORMAL, &color); |
129 |
|
} else |
130 |
|
gtk_widget_modify_bg(appdata->statusbar->widget, GTK_STATE_NORMAL, NULL); |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
// Set the persistent message, replacing anything currently there. |
135 |
|
void statusbar_set(appdata_t *appdata, const char *msg, gboolean highlight) { |
136 |
|
statusbar_highlight(appdata, highlight); |
137 |
|
|
138 |
|
printf("statusbar_set: %s\n", msg); |
139 |
|
|
140 |
|
if(!msg) |
141 |
|
gtk_label_set_text(GTK_LABEL(appdata->statusbar->widget), msg); |
142 |
|
else |
143 |
|
gtk_label_set_text(GTK_LABEL(appdata->statusbar->widget), msg); |
144 |
|
} |
145 |
|
|
146 |
|
GtkWidget *statusbar_new(appdata_t *appdata) { |
147 |
|
appdata->statusbar = (statusbar_t*)g_new0(statusbar_t, 1); |
148 |
|
|
149 |
|
appdata->statusbar->widget = gtk_label_new(""); |
150 |
|
return appdata->statusbar->widget; |
151 |
|
} |
152 |
|
|
153 |
|
#endif |
154 |
|
|
155 |
void statusbar_free(statusbar_t *statusbar) { |
void statusbar_free(statusbar_t *statusbar) { |
156 |
if(statusbar) |
if(statusbar) |
157 |
g_free(statusbar); |
g_free(statusbar); |
158 |
} |
} |
159 |
|
|
160 |
|
|
161 |
// vim:et:ts=8:sw=2:sts=2:ai |
// vim:et:ts=8:sw=2:sts=2:ai |