changeset 2668:a1431a900f28

introduce ui_skinned_button_set_inside
author Tomasz Mon <desowin@gmail.com>
date Fri, 30 May 2008 21:02:12 +0200
parents 84d34cd6aa71
children ed0ad7b373d3
files src/skins/ui_equalizer.c src/skins/ui_main.c src/skins/ui_playlist.c src/skins/ui_skinned_button.c src/skins/ui_skinned_button.h
diffstat 5 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/ui_equalizer.c	Fri May 30 06:09:16 2008 +0300
+++ b/src/skins/ui_equalizer.c	Fri May 30 21:02:12 2008 +0200
@@ -430,13 +430,13 @@
     ui_skinned_toggle_button_setup(equalizerwin_on, SKINNED_WINDOW(equalizerwin)->fixed,
                                    14, 18, 25, 12, 10, 119, 128, 119, 69, 119, 187, 119, SKIN_EQMAIN);
     g_signal_connect(equalizerwin_on, "clicked", equalizerwin_on_pushed, NULL);
-    UI_SKINNED_BUTTON(equalizerwin_on)->inside = aud_cfg->equalizer_active;
+    ui_skinned_button_set_inside(equalizerwin_on, aud_cfg->equalizer_active);
 
     equalizerwin_auto = ui_skinned_button_new();
     ui_skinned_toggle_button_setup(equalizerwin_auto, SKINNED_WINDOW(equalizerwin)->fixed,
                                    39, 18, 33, 12, 35, 119, 153, 119, 94, 119, 212, 119, SKIN_EQMAIN);
     g_signal_connect(equalizerwin_auto, "clicked", equalizerwin_auto_pushed, NULL);
-    UI_SKINNED_BUTTON(equalizerwin_auto)->inside = aud_cfg->equalizer_autoload;
+    ui_skinned_button_set_inside(equalizerwin_auto, aud_cfg->equalizer_autoload);
 
     equalizerwin_presets = ui_skinned_button_new();
     ui_skinned_push_button_setup(equalizerwin_presets, SKINNED_WINDOW(equalizerwin)->fixed,
@@ -564,7 +564,7 @@
         gtk_widget_set_size_request(equalizerwin, 275,
                                     (config.equalizer_shaded ? 14 : 116));
     config.equalizer_visible = TRUE;
-    UI_SKINNED_BUTTON(mainwin_eq)->inside = TRUE;
+    ui_skinned_button_set_inside(mainwin_eq, TRUE);
     gtk_widget_show_all(equalizerwin);
 
     if (!config.equalizer_shaded) {
@@ -590,7 +590,7 @@
      */
     gtk_widget_hide(equalizerwin);
     config.equalizer_visible = FALSE;
-    UI_SKINNED_BUTTON(mainwin_eq)->inside = FALSE;
+    ui_skinned_button_set_inside(mainwin_eq, FALSE);
     gtk_widget_queue_draw(mainwin_eq);
 }
 
@@ -1526,8 +1526,7 @@
 equalizer_activate(gboolean active)
 {
     aud_cfg->equalizer_active = active;
-    UI_SKINNED_BUTTON(equalizerwin_on)->inside = active;
-    gtk_widget_queue_draw(equalizerwin_on);
+    ui_skinned_button_set_inside(equalizerwin_on, active);
 
     equalizerwin_eq_changed();
 }
--- a/src/skins/ui_main.c	Fri May 30 06:09:16 2008 +0300
+++ b/src/skins/ui_main.c	Fri May 30 21:02:12 2008 +0200
@@ -2305,13 +2305,13 @@
     ui_skinned_toggle_button_setup(mainwin_eq, SKINNED_WINDOW(mainwin)->fixed,
                                    219, 58, 23, 12, 0, 61, 46, 61, 0, 73, 46, 73, SKIN_SHUFREP);
     g_signal_connect(mainwin_eq, "clicked", mainwin_equalizer_pushed_cb, NULL);
-    UI_SKINNED_BUTTON(mainwin_eq)->inside = config.equalizer_visible;
+    ui_skinned_button_set_inside(mainwin_eq, config.equalizer_visible);
 
     mainwin_pl = ui_skinned_button_new();
     ui_skinned_toggle_button_setup(mainwin_pl, SKINNED_WINDOW(mainwin)->fixed,
                                    242, 58, 23, 12, 23, 61, 69, 61, 23, 73, 69, 73, SKIN_SHUFREP);
     g_signal_connect(mainwin_pl, "clicked", mainwin_playlist_pushed_cb, NULL);
-    UI_SKINNED_BUTTON(mainwin_pl)->inside = config.playlist_visible;
+    ui_skinned_button_set_inside(mainwin_pl, config.playlist_visible);
 
     mainwin_info = ui_skinned_textbox_new(SKINNED_WINDOW(mainwin)->fixed, 112, 27, 153, 1, SKIN_TEXT);
     ui_skinned_textbox_set_scroll(mainwin_info, config.autoscroll);
@@ -2585,8 +2585,7 @@
 action_playback_repeat( GtkToggleAction * action )
 {
     aud_cfg->repeat = gtk_toggle_action_get_active( action );
-    UI_SKINNED_BUTTON(mainwin_repeat)->inside = aud_cfg->repeat;
-    gtk_widget_queue_draw(mainwin_repeat);
+    ui_skinned_button_set_inside(mainwin_repeat, aud_cfg->repeat);
 }
 
 void
@@ -2594,8 +2593,7 @@
 {
     aud_cfg->shuffle = gtk_toggle_action_get_active( action );
     aud_playlist_set_shuffle(aud_cfg->shuffle);
-    UI_SKINNED_BUTTON(mainwin_shuffle)->inside = aud_cfg->shuffle;
-    gtk_widget_queue_draw(mainwin_shuffle);
+    ui_skinned_button_set_inside(mainwin_shuffle, aud_cfg->shuffle);
 }
 
 void
--- a/src/skins/ui_playlist.c	Fri May 30 06:09:16 2008 +0300
+++ b/src/skins/ui_playlist.c	Fri May 30 21:02:12 2008 +0200
@@ -1581,8 +1581,7 @@
     gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(action) , TRUE );
 
     config.playlist_visible = TRUE;
-    UI_SKINNED_BUTTON(mainwin_pl)->inside = TRUE;
-    gtk_widget_queue_draw(mainwin_pl);
+    ui_skinned_button_set_inside(mainwin_pl, TRUE);
 
     playlistwin_set_toprow(0);
     aud_playlist_check_pos_current(aud_playlist_get_active());
@@ -1602,8 +1601,7 @@
 
     gtk_widget_hide(playlistwin);
     config.playlist_visible = FALSE;
-    UI_SKINNED_BUTTON(mainwin_pl)->inside = FALSE;
-    gtk_widget_queue_draw(mainwin_pl);
+    ui_skinned_button_set_inside(mainwin_pl, FALSE);
 
     if ( config.player_visible )
     {
--- a/src/skins/ui_skinned_button.c	Fri May 30 06:09:16 2008 +0300
+++ b/src/skins/ui_skinned_button.c	Fri May 30 21:02:12 2008 +0200
@@ -534,3 +534,11 @@
     priv->move_x += x;
     priv->move_y += y;
 }
+
+void ui_skinned_button_set_inside(GtkWidget *widget, gboolean inside) {
+    g_return_if_fail(UI_SKINNED_IS_BUTTON(widget));
+
+    UiSkinnedButton *button = UI_SKINNED_BUTTON(widget);
+    button->inside = inside;
+    gtk_widget_queue_draw(widget);
+}
--- a/src/skins/ui_skinned_button.h	Fri May 30 06:09:16 2008 +0300
+++ b/src/skins/ui_skinned_button.h	Fri May 30 21:02:12 2008 +0200
@@ -70,5 +70,6 @@
 void ui_skinned_button_set_skin_index1(GtkWidget *button, SkinPixmapId si);
 void ui_skinned_button_set_skin_index2(GtkWidget *button, SkinPixmapId si);
 void ui_skinned_button_move_relative(GtkWidget *button, gint x, gint y);
+void ui_skinned_button_set_inside(GtkWidget *widget, gboolean inside);
 
 #endif /* AUDACIOUS_UI_SKINNED_BUTTON_H */