From ae916eaf402ba9b769fd5ed82bc860b7db322522 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 28 Sep 2016 09:58:29 -0400 Subject: [PATCH] gui/queue: No need to change random image sensitivity GtkThemes should be taking care of this indicator for us. Signed-off-by: Anna Schumaker --- gui/queue.c | 12 ------------ tests/gui/queue.c | 7 ------- 2 files changed, 19 deletions(-) diff --git a/gui/queue.c b/gui/queue.c index 0370289f..ed90867b 100644 --- a/gui/queue.c +++ b/gui/queue.c @@ -25,16 +25,10 @@ static void __queue_toggle_flag(bool active, GtkWidget *widget, if (gq_queue == NULL) return; - /* - * Some GTK themes have trouble with toggle buttons, - * so let's help users by changing image sensitivity. - */ if (active) queue_set_flag(gq_queue->gq_queue, flag); else queue_unset_flag(gq_queue->gq_queue, flag); - - gtk_widget_set_sensitive(widget, active); } void __queue_random(GtkToggleButton *button, gpointer data) @@ -171,12 +165,6 @@ void gui_queue_show(struct gui_queue *queue) gui_view_set_queue(NULL); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(random), has_random); - - /* - * Some GTK themes have trouble with toggle buttons, - * so let's help users know what the current state is. - */ - gtk_widget_set_sensitive(gtk_button_get_image(random), has_random); gtk_widget_set_sensitive(GTK_WIDGET(search), queue != NULL); if (queue && queue->gq_search) { diff --git a/tests/gui/queue.c b/tests/gui/queue.c index 99ee5b6d..f08d5bee 100644 --- a/tests/gui/queue.c +++ b/tests/gui/queue.c @@ -34,14 +34,12 @@ struct core_init_data init_data = { static void test_queue() { GtkToggleButton *random; - GtkWidget *random_img; struct gui_queue *gq; GtkEntry *search; struct queue q; search = GTK_ENTRY(gui_builder_widget("o_search")); random = GTK_TOGGLE_BUTTON(gui_builder_widget("o_random")); - random_img = gtk_button_get_image(GTK_BUTTON(random)); /* Test initialization */ queue_init(&q, Q_ENABLED, &test_ops, NULL); @@ -62,16 +60,13 @@ static void test_queue() gui_queue_show(gq); g_assert_false(gtk_widget_get_sensitive(GTK_WIDGET(random))); g_assert_false(gtk_toggle_button_get_active(random)); - g_assert_false(gtk_widget_get_sensitive(random_img)); g_assert_cmpstr(gtk_entry_get_text(search), ==, ""); /* Test clicking random button. */ gtk_toggle_button_set_active(random, true); - g_assert_true(gtk_widget_get_sensitive(random_img)); g_assert_true(queue_has_flag(&q, Q_RANDOM)); gtk_toggle_button_set_active(random, false); - g_assert_false(gtk_widget_get_sensitive(random_img)); g_assert_false(queue_has_flag(&q, Q_RANDOM)); /* Show a queue where random and repeat are enabled */ @@ -80,14 +75,12 @@ static void test_queue() gui_queue_show(gq); g_assert_true(gtk_widget_get_sensitive(GTK_WIDGET(random))); g_assert_true(gtk_toggle_button_get_active(random)); - g_assert_true(gtk_widget_get_sensitive(random_img)); /* Attempt to show a NULL pointer */ gui_queue_show(NULL); g_assert_false(gtk_widget_get_sensitive(GTK_WIDGET(search))); g_assert_false(gtk_widget_get_sensitive(GTK_WIDGET(random))); g_assert_false(gtk_toggle_button_get_active(random)); - g_assert_false(gtk_widget_get_sensitive(random_img)); queue_deinit(&q); g_assert_null(gui_queue(&q));