diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-11 12:54:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-11 12:54:25 +0000 |
commit | 2f43a08768d0d8b8ff47b354557c25dd8e911e58 (patch) | |
tree | 24b84b17d8eef22eb29c194253169e3401b6e719 | |
parent | dc593219471375bd8fb306159d90481efe3457ac (diff) | |
download | gnunet-gtk-2f43a08768d0d8b8ff47b354557c25dd8e911e58.tar.gz gnunet-gtk-2f43a08768d0d8b8ff47b354557c25dd8e911e58.zip |
fix buttons for gtk 3
-rw-r--r-- | src/fs/gnunet-fs-gtk-anonymity_spin_buttons.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/fs/gnunet-fs-gtk-anonymity_spin_buttons.c b/src/fs/gnunet-fs-gtk-anonymity_spin_buttons.c index 69b951fa..6b2009a7 100644 --- a/src/fs/gnunet-fs-gtk-anonymity_spin_buttons.c +++ b/src/fs/gnunet-fs-gtk-anonymity_spin_buttons.c | |||
@@ -26,7 +26,7 @@ | |||
26 | * value reaches zero. | 26 | * value reaches zero. |
27 | */ | 27 | */ |
28 | #include "gnunet-fs-gtk-common.h" | 28 | #include "gnunet-fs-gtk-common.h" |
29 | 29 | #include <gdk/gdk.h> | |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * Spin button is changed, update its colour. | 32 | * Spin button is changed, update its colour. |
@@ -36,10 +36,8 @@ GNUNET_GTK_anonymity_spin_button_value_changed_cb (GtkWidget * w, gpointer data) | |||
36 | { | 36 | { |
37 | GtkSpinButton *spin; | 37 | GtkSpinButton *spin; |
38 | gint val; | 38 | gint val; |
39 | #if 0 | 39 | GdkRGBA bcolor; |
40 | GdkColor bcolor; | 40 | GdkRGBA fcolor; |
41 | GdkColor fcolor; | ||
42 | #endif | ||
43 | 41 | ||
44 | spin = GTK_SPIN_BUTTON (w); | 42 | spin = GTK_SPIN_BUTTON (w); |
45 | if (spin == NULL) | 43 | if (spin == NULL) |
@@ -48,29 +46,23 @@ GNUNET_GTK_anonymity_spin_button_value_changed_cb (GtkWidget * w, gpointer data) | |||
48 | return; | 46 | return; |
49 | } | 47 | } |
50 | val = gtk_spin_button_get_value_as_int (spin); | 48 | val = gtk_spin_button_get_value_as_int (spin); |
51 | if (val == 0) | 49 | if (val == 0) |
52 | { | 50 | { |
53 | #if 0 | 51 | if ((TRUE == gdk_rgba_parse (&bcolor, "red")) && |
54 | /* FIXME: port gtk_colormap_alloc_color and gdk_colormap_get_system calls to | 52 | (TRUE == gdk_rgba_parse (&fcolor, "black")) ) |
55 | Gtk3+ */ | 53 | { |
56 | if ((TRUE == gdk_color_parse ("red", &bcolor)) && | 54 | gtk_widget_override_background_color (w, GTK_STATE_NORMAL, &bcolor); |
57 | (TRUE == | 55 | gtk_widget_override_color (w, GTK_STATE_NORMAL, &fcolor); |
58 | gdk_colormap_alloc_color (gdk_colormap_get_system (), &bcolor, FALSE, | 56 | } |
59 | TRUE)) && | 57 | else |
60 | (TRUE == gdk_color_parse ("black", &fcolor)) && | ||
61 | (TRUE == | ||
62 | gdk_colormap_alloc_color (gdk_colormap_get_system (), &fcolor, FALSE, | ||
63 | TRUE))) | ||
64 | { | 58 | { |
65 | gtk_widget_modify_base (w, GTK_STATE_NORMAL, &bcolor); | 59 | GNUNET_break (0); |
66 | gtk_widget_modify_text (w, GTK_STATE_NORMAL, &fcolor); | ||
67 | } | 60 | } |
68 | #endif | ||
69 | } | 61 | } |
70 | else | 62 | else |
71 | { | 63 | { |
72 | gtk_widget_modify_base (w, GTK_STATE_NORMAL, NULL); | 64 | gtk_widget_override_background_color (w, GTK_STATE_NORMAL, NULL); |
73 | gtk_widget_modify_text (w, GTK_STATE_NORMAL, NULL); | 65 | gtk_widget_override_color (w, GTK_STATE_NORMAL, NULL); |
74 | } | 66 | } |
75 | } | 67 | } |
76 | 68 | ||