event-editor-dialog: Port Delete Event button to AdwButtonRow
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
a74e7179c1
commit
6a27049c93
@@ -52,7 +52,7 @@ struct _GcalEventEditorDialog
|
|||||||
|
|
||||||
GtkListBox *calendars_listbox;
|
GtkListBox *calendars_listbox;
|
||||||
GtkWidget *cancel_button;
|
GtkWidget *cancel_button;
|
||||||
GtkWidget *delete_button;
|
GtkWidget *delete_group;
|
||||||
GtkWidget *done_button;
|
GtkWidget *done_button;
|
||||||
GtkWidget *lock;
|
GtkWidget *lock;
|
||||||
GcalEventEditorSection *notes_section;
|
GcalEventEditorSection *notes_section;
|
||||||
@@ -332,7 +332,7 @@ on_ask_recurrence_response_delete_cb (GcalEvent *event,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_delete_button_clicked_cb (GtkButton *button,
|
on_delete_row_activated_cb (AdwButtonRow *button,
|
||||||
GcalEventEditorDialog *self)
|
GcalEventEditorDialog *self)
|
||||||
{
|
{
|
||||||
GcalRecurrenceModType mod = GCAL_RECURRENCE_MOD_THIS_ONLY;
|
GcalRecurrenceModType mod = GCAL_RECURRENCE_MOD_THIS_ONLY;
|
||||||
@@ -657,7 +657,7 @@ gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass)
|
|||||||
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, calendars_listbox);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, calendars_listbox);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, cancel_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, cancel_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, delete_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, delete_group);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, done_button);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, done_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, lock);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, lock);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, notes_section);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, notes_section);
|
||||||
@@ -673,7 +673,7 @@ gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass)
|
|||||||
|
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
gtk_widget_class_bind_template_callback (widget_class, on_cancel_button_clicked_cb);
|
gtk_widget_class_bind_template_callback (widget_class, on_cancel_button_clicked_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, on_delete_button_clicked_cb);
|
gtk_widget_class_bind_template_callback (widget_class, on_delete_row_activated_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, on_done_button_clicked_cb);
|
gtk_widget_class_bind_template_callback (widget_class, on_done_button_clicked_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -785,7 +785,7 @@ gcal_event_editor_dialog_set_event (GcalEventEditorDialog *self,
|
|||||||
set_writable (self, !gcal_calendar_is_read_only (calendar));
|
set_writable (self, !gcal_calendar_is_read_only (calendar));
|
||||||
|
|
||||||
self->event_is_new = new_event;
|
self->event_is_new = new_event;
|
||||||
gtk_widget_set_visible (self->delete_button, !new_event);
|
gtk_widget_set_visible (self->delete_group, !new_event);
|
||||||
|
|
||||||
if (!self->writable)
|
if (!self->writable)
|
||||||
gtk_widget_grab_focus (self->done_button);
|
gtk_widget_grab_focus (self->done_button);
|
||||||
|
|||||||
@@ -166,17 +166,12 @@
|
|||||||
|
|
||||||
<!-- Delete Button -->
|
<!-- Delete Button -->
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup">
|
<object class="AdwPreferencesGroup" id="delete_group">
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="delete_button">
|
<object class="AdwButtonRow">
|
||||||
<property name="halign">end</property>
|
<signal name="activated" handler="on_delete_row_activated_cb" object="GcalEventEditorDialog" swapped="no"/>
|
||||||
<signal name="clicked" handler="on_delete_button_clicked_cb" object="GcalEventEditorDialog" swapped="no"/>
|
|
||||||
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
|
||||||
<child>
|
<property name="title" translatable="yes">Delete Event</property>
|
||||||
<object class="GtkLabel" id="delete_label">
|
|
||||||
<property name="label" translatable="yes">Delete Event</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="destructive-action"/>
|
<class name="destructive-action"/>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user