gui/queue: No need to change random image sensitivity
GtkThemes should be taking care of this indicator for us. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
9d279fe21e
commit
ae916eaf40
12
gui/queue.c
12
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) {
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue