aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnia <jthidskes@live.nl>2013-04-08 22:09:23 +0200
committerUnia <jthidskes@live.nl>2013-04-08 22:09:23 +0200
commit7388a4d70ee63a666dc2376a8d447b568d2af6b8 (patch)
treed6a50f9b73c7a8d447ba99e75bfeeecc3dd1acbf
parent6c0c3899c0dc0621397c628b16c4b320c0ecc419 (diff)
changed button fg instead of bg
-rw-r--r--README.md3
-rw-r--r--gstopwatch.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/README.md b/README.md
index fc8896e..4e41a18 100644
--- a/README.md
+++ b/README.md
@@ -24,9 +24,6 @@ ToDo
----
* Fix split
-* Button background colors
- * This doesn't work in some themes, so for now we won't implement this. See:
-https://bugzilla.gnome.org/show_bug.cgi?id=656461
License
-------
diff --git a/gstopwatch.c b/gstopwatch.c
index 1a92142..d079db5 100644
--- a/gstopwatch.c
+++ b/gstopwatch.c
@@ -40,6 +40,7 @@ GtkWidget *stopwatch_display, *button_stopwatch, *button_funcs, *tree;
GtkListStore *liststore;
GtkTreeSelection *selection;
GtkTreeIter selection_iter, iter;
+GdkColor color;
gboolean stopwatch_function (void) {
gchar *markup;
@@ -75,18 +76,24 @@ void add_lap (void) {
}
void on_stopwatch_button_clicked (void) {
+ gdk_color_parse("#C73333", &color);
+
if(state == STOPPED) {
+ gtk_widget_modify_fg(GTK_WIDGET(button_stopwatch), GTK_STATE_NORMAL, &color);
gtk_button_set_label(GTK_BUTTON(button_stopwatch), "Stop");
gtk_widget_set_sensitive(GTK_WIDGET(button_funcs), TRUE);
gtk_button_set_label(GTK_BUTTON(button_funcs), "Lap");
g_timer_start(stopwatch);
state = STARTED;
} else if(state == PAUSED) {
+ gtk_widget_modify_fg(GTK_WIDGET(button_stopwatch), GTK_STATE_NORMAL, &color);
gtk_button_set_label(GTK_BUTTON(button_stopwatch), "Stop");
gtk_button_set_label(GTK_BUTTON(button_funcs), "Lap");
g_timer_continue(stopwatch);
state = STARTED;
} else if(state == STARTED) {
+ gdk_color_parse("#67953C", &color);
+ gtk_widget_modify_fg(GTK_WIDGET(button_stopwatch), GTK_STATE_NORMAL, &color);
gtk_button_set_label(GTK_BUTTON(button_stopwatch), "Continue");
gtk_widget_set_sensitive(GTK_WIDGET(button_funcs), TRUE);
gtk_button_set_label(GTK_BUTTON(button_funcs), "Reset");
@@ -120,6 +127,8 @@ int main (int argc, char *argv[]) {
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
stopwatch_display = gtk_label_new("");
button_stopwatch = gtk_button_new_with_label("Start");
+ gdk_color_parse("#67953C", &color);
+ gtk_widget_modify_fg(GTK_WIDGET(button_stopwatch), GTK_STATE_NORMAL, &color);
button_funcs = gtk_button_new_with_label("Reset");
gtk_widget_set_sensitive(button_funcs, FALSE);
scroll = gtk_scrolled_window_new (NULL, NULL);