calendar-row: Port to AdwActionRow

`AdwSwitchRow` doesn't allow us to add widgets before the switch as a suffix, which will be required for further use.
This commit is contained in:
Hari Rana
2023-08-07 23:15:22 +00:00
committed by Georges Basile Stavracas Neto
parent 1cfc83ece9
commit db8127e79a
2 changed files with 11 additions and 2 deletions
+8 -1
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="AdwSwitchRow" id="row">
<object class="AdwActionRow" id="row">
<property name="use-markup">False</property>
<property name="activatable">True</property>
<child type="prefix">
<object class="GtkImage" id="icon">
<property name="pixel-size">24</property>
@@ -11,6 +12,12 @@
</object>
</child>
<child type="suffix">
<object class="GtkSwitch" id="switch">
<property name="valign">center</property>
</object>
</child>
<child type="suffix">
<object class="GtkImage">
<property name="halign">end</property>
@@ -75,6 +75,7 @@ make_calendar_row (GcalCalendarsPage *self,
GcalManager *manager;
GtkWidget *icon;
GtkWidget *row;
GtkWidget *sw;
manager = gcal_context_get_manager (self->context);
get_source_parent_name_color (manager, gcal_calendar_get_source (calendar), &parent_name, NULL);
@@ -111,7 +112,8 @@ make_calendar_row (GcalCalendarsPage *self,
0);
/* visibility switch */
g_object_bind_property (calendar, "visible", row, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
sw = GTK_WIDGET (gtk_builder_get_object (builder, "switch"));
g_object_bind_property (calendar, "visible", sw, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
/* parent source name label */
adw_action_row_set_subtitle (ADW_ACTION_ROW (row), parent_name);