diff --git a/data/ui/edit-dialog.ui b/data/ui/edit-dialog.ui index 22455b1d..196b9844 100644 --- a/data/ui/edit-dialog.ui +++ b/data/ui/edit-dialog.ui @@ -122,194 +122,153 @@ - vertical - 2 + true + 0 + 0 - + True - 18 - 6 - 12 + False + never + 400 + true - + True - 1.0 - 12 - Title - end - - - - - - 0 - 0 - - - - - True - 1.0 - 12 - Date - - - - - 0 - 1 - - - - - True - 1.0 - 12 - Repeat - end - - - - - 0 - 4 - - - - - True - 1.0 - 12 - start - Reminders - end - - - - - 0 - 6 - - - - - True - 1.0 - 12 - start - Notes - - - - - 0 - 8 - - - - - True - 1.0 - 12 - Location - - - - - 0 - 7 - - - - - True - True - True - True - 12 - - - - - - 1 - 0 - 4 - - - - - True - True - 12 - 6 - + 18 + 6 + 12 - + True - True - + 1.0 + 12 + Title + end + + + + + 0 + 0 + + + + + True + 1.0 + 12 + Date + + + + + 0 + 1 + True - False - - + 1.0 + 12 + Repeat + end + + + + 0 + 4 + - + + True + 1.0 + 12 + start + Reminders + end + + + + + 0 + 6 + + + + + True + 1.0 + 12 + start + Notes + + + + + 0 + 8 + + + + + True + 1.0 + 12 + Location + + + + + 0 + 7 + + + + True True - + True + True + 12 + + + + + 1 + 0 + 4 + - - - 1 - 1 - 4 - - - - - True - 1.0 - Time - - - - 0 - 2 - - - - - True True + True + 12 6 + - + True True - + @@ -320,249 +279,300 @@ - + True True - + + + 1 + 1 + 4 + - - - 1 - 2 - 4 - - - - - True - True - 12 - True - All Day - - - - - 1 - 3 - - - - - True - False - 12 - 6 - True - vertical - - - False - False - none + + True + 1.0 + Time + + 0 + 2 + - + True - True - True - alarms_popover True - False - horizontal + 6 + + + True + True + + + True False - True - 0.0 - Add reminder… + - - + True - False - pan-down-symbolic + True + - - - - 1 - 6 - 4 - - - - - - True - False - 12 - True - - - - No Repeat - Daily - Monday – Friday - Weekly - Monthly - Yearly - - no_repeat - - - - 1 - 4 - 4 - - - - - True - False - 6 - True - horizontal - - - - True - False - True - - - Forever - No. of occurrences - Until Date - - forever - - + + 1 + 2 + 4 + - - True - False - end - - - - True - number - - - - - - True - - - - - - - - 1 - 5 - 4 - - - - - True - True - 12 - find-location-symbolic - - - - - - 1 - 7 - 4 - - - - - 120 - True - True - 12 - True - in - - + True True - True - 6 - 6 - 6 - 6 - True - - - GTK_WRAP_WORD_CHAR + 12 + True + All Day + + + + 1 + 3 + - - - 1 - 8 - 4 - - - - - True - True - 12 - - - + True - Delete Event + False + 12 + 6 + True + vertical + + + + False + False + none + + + + + + True + True + True + alarms_popover + + + True + False + horizontal + + + True + False + True + 0.0 + Add reminder… + + + + + True + False + pan-down-symbolic + + + + + + + + 1 + 6 + 4 + + + + + + True + False + 12 + True + + + + No Repeat + Daily + Monday – Friday + Weekly + Monthly + Yearly + + no_repeat + + + + 1 + 4 + 4 + + + + + True + False + 6 + True + horizontal + + + + True + False + True + + + Forever + No. of occurrences + Until Date + + forever + + + + + + True + False + end + + + + True + number + + + + + + True + + + + + + + + 1 + 5 + 4 + + + + + True + True + 12 + find-location-symbolic + + + + + + 1 + 7 + 4 + + + + + 120 + True + True + 12 + True + in + + + True + True + True + 6 + 6 + 6 + 6 + True + + + GTK_WRAP_WORD_CHAR + + + + + 1 + 8 + 4 + + + + + True + True + 12 + + + + + True + Delete Event + + + + + + 0 + 9 + - - 0 - 9 + True + 1 - - True - 1 - diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c index 5a70d396..f9ecbfb9 100644 --- a/src/gcal-edit-dialog.c +++ b/src/gcal-edit-dialog.c @@ -56,6 +56,8 @@ struct _GcalEditDialog GtkWidget *title_label; GtkWidget *subtitle_label; + GtkWidget *scrolled_window; + GtkWidget *lock; GtkWidget *source_image; GtkWidget *source_label; @@ -300,6 +302,19 @@ remove_recurrence_properties (GcalEvent *event) e_cal_component_rescan (comp); } +static void +transient_size_allocate_cb (GcalEditDialog *self) +{ + GtkAllocation alloc; + GtkWindow *transient; + + transient = gtk_window_get_transient_for (GTK_WINDOW (self)); + gtk_widget_get_allocation (GTK_WIDGET (transient), &alloc); + + gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (self->scrolled_window), + MAX (400, (gint) (0.75 * alloc.height))); +} + static void update_location (GtkEntry *entry, GParamSpec *pspec, @@ -659,6 +674,12 @@ gcal_edit_dialog_constructed (GObject* object) gtk_widget_insert_action_group (GTK_WIDGET (self), "edit", G_ACTION_GROUP (self->action_group)); + + /* Watch the main window and adapt the maximum size */ + g_signal_connect_swapped (gtk_window_get_transient_for (GTK_WINDOW (self)), + "size-allocate", + G_CALLBACK (transient_size_allocate_cb), + self); } static void @@ -801,6 +822,7 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass) gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, repeat_duration_combo); gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, repeat_duration_stack); gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, repeat_limits_box); + gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, scrolled_window); gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, source_image); gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, sources_popover); gtk_widget_class_bind_template_child (widget_class, GcalEditDialog, until_date_selector);