event-editor/event-editor-dialog: Explicitly grab focus on summary section
As described in the previous commit, this approach is more predictable because the focus is decided in the same place. The focus grabbing behavior is set after notifying the `GcalEventEditorDialog:event` property as otherwise it would not select the entire text in some occasions. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
This commit is contained in:
@@ -696,9 +696,6 @@ gcal_event_editor_dialog_set_event (GcalEventEditorDialog *self,
|
||||
self->event_is_new = new_event;
|
||||
gtk_widget_set_visible (self->delete_group, !new_event && self->writable);
|
||||
|
||||
if (!self->writable)
|
||||
gtk_widget_grab_focus (self->done_button);
|
||||
|
||||
/* fill attendees list */
|
||||
self->attendees_model = gcal_event_get_attendees (self->event);
|
||||
|
||||
@@ -713,5 +710,10 @@ out:
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_EVENT]);
|
||||
|
||||
if (self->writable)
|
||||
gtk_widget_grab_focus (GTK_WIDGET (self->summary_section));
|
||||
else
|
||||
gtk_widget_grab_focus (self->done_button);
|
||||
|
||||
GCAL_EXIT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user