# HG changeset patch # User mf0102 <0102@gmx.at> # Date 1193487571 -7200 # Node ID de26ea4a42fcdd1dc55e2538b19113c72266b260 # Parent a9b7b4145664fe753186bad8af6a6432dc396896 fixed bugs in interface color changing (that was TOTALLY BROKEN and ugly code!) diff -r a9b7b4145664 -r de26ea4a42fc src/audacious/ui_preferences.c --- a/src/audacious/ui_preferences.c Sat Oct 27 07:05:12 2007 -0500 +++ b/src/audacious/ui_preferences.c Sat Oct 27 14:19:31 2007 +0200 @@ -1634,66 +1634,34 @@ } static void +reload_skin() +{ + /* reload the skin to apply the change */ + skin_reload_forced(); + ui_skinned_window_draw_all(mainwin); + ui_skinned_window_draw_all(equalizerwin); + ui_skinned_window_draw_all(playlistwin); +} + +static void on_red_scale_value_changed(GtkHScale *scale, gpointer data) { - //GladeXML *xml = prefswin_get_xml(); - //GtkWidget *widget; - gint value; - - value = gtk_range_get_value(GTK_RANGE(scale)); - - if (value != cfg.colorize_r) - { - cfg.colorize_r = value; - - /* reload the skin to apply the change */ - skin_reload_forced(); - ui_skinned_window_draw_all(mainwin); - ui_skinned_window_draw_all(equalizerwin); - ui_skinned_window_draw_all(playlistwin); - } + cfg.colorize_r = gtk_range_get_value(GTK_RANGE(scale)); + reload_skin(); } static void on_green_scale_value_changed(GtkHScale *scale, gpointer data) { - //GladeXML *xml = prefswin_get_xml(); - //GtkWidget *widget; - gint value; - - value = gtk_range_get_value(GTK_RANGE(scale)); - - if (value != cfg.colorize_r) - { - cfg.colorize_g = value; - - /* reload the skin to apply the change */ - skin_reload_forced(); - ui_skinned_window_draw_all(mainwin); - ui_skinned_window_draw_all(equalizerwin); - ui_skinned_window_draw_all(playlistwin); - } + cfg.colorize_g = gtk_range_get_value(GTK_RANGE(scale)); + reload_skin(); } static void on_blue_scale_value_changed(GtkHScale *scale, gpointer data) { - //GladeXML *xml = prefswin_get_xml(); - //GtkWidget *widget; - gint value; - - value = gtk_range_get_value(GTK_RANGE(scale)); - - if (value != cfg.colorize_r) - { - cfg.colorize_b = value; - - /* reload the skin to apply the change */ - skin_reload_forced(); - ui_skinned_window_draw_all(mainwin); - ui_skinned_window_draw_all(equalizerwin); - ui_skinned_window_draw_all(playlistwin); - } + cfg.colorize_b = gtk_range_get_value(GTK_RANGE(scale)); + reload_skin(); } static void