summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammed Sadiq <sadiq@sadiqpk.org>2020-12-17 17:54:39 +0530
committerRobert Ancell <robert.ancell@gmail.com>2021-01-08 02:54:15 +0000
commitca7002b0ae14d62b00dd93d8dcc77ae434405852 (patch)
treeca00ed457452cc7d0c1a77f6203a39fcc03a4269
parent08defd6ec53b5d6bff880423e28ab1c65abceae5 (diff)
downloadgnome-control-center-ca7002b0ae14d62b00dd93d8dcc77ae434405852.tar.gz
list-row: Add API to set sensitivity of switch
-rw-r--r--panels/common/cc-list-row.c9
-rw-r--r--panels/common/cc-list-row.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/panels/common/cc-list-row.c b/panels/common/cc-list-row.c
index a17aadd02..f58c99c5e 100644
--- a/panels/common/cc-list-row.c
+++ b/panels/common/cc-list-row.c
@@ -388,3 +388,12 @@ cc_list_row_set_secondary_markup (CcListRow *self,
gtk_label_set_markup (self->secondary_label, markup);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SECONDARY_LABEL]);
}
+
+void
+cc_list_row_set_switch_sensitive (CcListRow *self,
+ gboolean sensitive)
+{
+ g_return_if_fail (CC_IS_LIST_ROW (self));
+
+ gtk_widget_set_sensitive (GTK_WIDGET (self->enable_switch), sensitive);
+}
diff --git a/panels/common/cc-list-row.h b/panels/common/cc-list-row.h
index 43997fa7a..54fbe07ce 100644
--- a/panels/common/cc-list-row.h
+++ b/panels/common/cc-list-row.h
@@ -41,5 +41,7 @@ void cc_list_row_set_secondary_label (CcListRow *self,
const gchar *label);
void cc_list_row_set_secondary_markup (CcListRow *self,
const gchar *markup);
+void cc_list_row_set_switch_sensitive (CcListRow *self,
+ gboolean sensitive);
G_END_DECLS