Merge branch 'ui-tweaks' into 'master'

Two small UI tweaks

See merge request pwithnall/malcontent!69
This commit is contained in:
Philip Withnall 2020-05-01 15:52:54 +00:00
commit 77b8704cb4
3 changed files with 23 additions and 3 deletions

View File

@ -87,6 +87,7 @@ struct _MctUserControls
GtkPopover *oars_popover;
MctRestrictApplicationsDialog *restrict_applications_dialog;
GtkLabel *restrict_applications_description;
GtkListBoxRow *restrict_applications_row;
GtkListBox *application_usage_permissions_listbox;
GtkListBox *software_installation_permissions_listbox;
@ -134,6 +135,10 @@ static void on_restrict_applications_dialog_response_cb (GtkDialog *dialog,
gint response_id,
gpointer user_data);
static void on_application_usage_permissions_listbox_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
gpointer user_data);
static void on_set_age_action_activated (GSimpleAction *action,
GVariant *param,
gpointer user_data);
@ -654,6 +659,17 @@ on_restrict_applications_dialog_response_cb (GtkDialog *dialog,
on_restrict_applications_dialog_delete_event_cb (GTK_WIDGET (dialog), NULL, self);
}
static void
on_application_usage_permissions_listbox_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
gpointer user_data)
{
MctUserControls *self = MCT_USER_CONTROLS (user_data);
if (row == self->restrict_applications_row)
on_restrict_applications_button_clicked_cb (NULL, self);
}
static void
on_set_age_action_activated (GSimpleAction *action,
GVariant *param,
@ -1031,6 +1047,7 @@ mct_user_controls_class_init (MctUserControlsClass *klass)
gtk_widget_class_bind_template_child (widget_class, MctUserControls, oars_popover);
gtk_widget_class_bind_template_child (widget_class, MctUserControls, restrict_applications_dialog);
gtk_widget_class_bind_template_child (widget_class, MctUserControls, restrict_applications_description);
gtk_widget_class_bind_template_child (widget_class, MctUserControls, restrict_applications_row);
gtk_widget_class_bind_template_child (widget_class, MctUserControls, application_usage_permissions_listbox);
gtk_widget_class_bind_template_child (widget_class, MctUserControls, software_installation_permissions_listbox);
@ -1039,6 +1056,7 @@ mct_user_controls_class_init (MctUserControlsClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_restrict_applications_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, on_restrict_applications_dialog_delete_event_cb);
gtk_widget_class_bind_template_callback (widget_class, on_restrict_applications_dialog_response_cb);
gtk_widget_class_bind_template_callback (widget_class, on_application_usage_permissions_listbox_activated_cb);
}
static void

View File

@ -38,7 +38,8 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="selection_mode">none</property>
<property name="activate_on_single_click">False</property>
<property name="activate-on-single-click">True</property>
<signal name="row-activated" handler="on_application_usage_permissions_listbox_activated_cb" object="MctUserControls" swapped="no" />
<child>
<object class="GtkListBoxRow">
<property name="visible">True</property>
@ -124,10 +125,10 @@
</object>
</child>
<child>
<object class="GtkListBoxRow">
<object class="GtkListBoxRow" id="restrict_applications_row">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activatable">False</property>
<property name="activatable">True</property>
<property name="selectable">False</property>
<child>
<object class="GtkGrid">

View File

@ -58,6 +58,7 @@
<property name="min-content-height">350</property>
<child>
<object class="MctUserControls" id="user_controls">
<property name="halign">center</property>
<property name="visible">True</property>
<property name="margin">12</property>
<property name="dbus-connection">dbus_connection</property>