From 4157b5d82529a2c251fb134b192d0f6f0d5a3a1c Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 18 Apr 2017 08:47:48 +0200 Subject: [PATCH] [Theme] Allow default enabled state of widget to be set in theme --- source/widgets/box.c | 2 +- source/widgets/container.c | 2 +- source/widgets/listview.c | 2 +- source/widgets/scrollbar.c | 2 +- source/widgets/textbox.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/widgets/box.c b/source/widgets/box.c index 5ee6f54e..409ebe78 100644 --- a/source/widgets/box.c +++ b/source/widgets/box.c @@ -325,7 +325,7 @@ box * box_create ( const char *name, boxType type ) b->widget.clicked = box_clicked; b->widget.motion_notify = box_motion_notify; b->widget.get_desired_height = box_get_desired_height; - b->widget.enabled = TRUE; + b->widget.enabled = rofi_theme_get_boolean ( WIDGET ( b ), "enabled", TRUE ); b->spacing = rofi_theme_get_distance ( WIDGET ( b ), "spacing", DEFAULT_SPACING ); return b; diff --git a/source/widgets/container.c b/source/widgets/container.c index 2555a3c8..143cd67a 100644 --- a/source/widgets/container.c +++ b/source/widgets/container.c @@ -123,7 +123,7 @@ container * container_create ( const char *name ) b->widget.clicked = container_clicked; b->widget.motion_notify = container_motion_notify; b->widget.get_desired_height = container_get_desired_height; - b->widget.enabled = TRUE; + b->widget.enabled = rofi_theme_get_boolean ( WIDGET ( b ), "enabled", TRUE ); return b; } diff --git a/source/widgets/listview.c b/source/widgets/listview.c index e8e17972..2d594acd 100644 --- a/source/widgets/listview.c +++ b/source/widgets/listview.c @@ -370,7 +370,7 @@ listview *listview_create ( const char *name, listview_update_callback cb, void lv->widget.clicked = listview_clicked; lv->widget.motion_notify = listview_motion_notify; lv->widget.get_desired_height = listview_get_desired_height; - lv->widget.enabled = TRUE; + lv->widget.enabled = rofi_theme_get_boolean ( WIDGET ( lv ), "enabled", TRUE ); lv->eh = eh; char *n = g_strjoin ( ".", lv->listview_name, "scrollbar", NULL ); diff --git a/source/widgets/scrollbar.c b/source/widgets/scrollbar.c index 8b2a59f1..bbb11fda 100644 --- a/source/widgets/scrollbar.c +++ b/source/widgets/scrollbar.c @@ -66,7 +66,7 @@ scrollbar *scrollbar_create ( const char *name ) sb->pos_length = 4; // Enabled by default - sb->widget.enabled = TRUE; + sb->widget.enabled = rofi_theme_get_boolean ( WIDGET ( sb ), "enabled", TRUE ); return sb; } diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index bc911d87..db9ec7c8 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -165,7 +165,7 @@ textbox* textbox_create ( const char *name, TextboxFlags flags, TextBoxFontType } // Enabled by default - tb->widget.enabled = TRUE; + tb->widget.enabled = rofi_theme_get_boolean ( WIDGET ( tb ), "enabled", TRUE ); return tb; }