edit-dialog: put the time selectors in a revealer
This commit is contained in:
+61
-37
@@ -120,7 +120,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="summary_label">
|
<object class="GtkLabel" id="summary_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="halign">end</property>
|
<property name="xalign">1.0</property>
|
||||||
<property name="label" translatable="yes">Title</property>
|
<property name="label" translatable="yes">Title</property>
|
||||||
<property name="ellipsize">end</property>
|
<property name="ellipsize">end</property>
|
||||||
<signal name="size-allocate" handler="fix_reminders_label_height_cb" object="reminders_label" swapped="no" after="yes" />
|
<signal name="size-allocate" handler="fix_reminders_label_height_cb" object="reminders_label" swapped="no" after="yes" />
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="dates_label">
|
<object class="GtkLabel" id="dates_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="halign">end</property>
|
<property name="xalign">1.0</property>
|
||||||
<property name="label" translatable="yes">Date</property>
|
<property name="label" translatable="yes">Date</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
@@ -147,24 +147,10 @@
|
|||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="times_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="label" translatable="yes">Time</property>
|
|
||||||
<style>
|
|
||||||
<class name="dim-label"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="reminders_label">
|
<object class="GtkLabel" id="reminders_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="halign">end</property>
|
<property name="xalign">1.0</property>
|
||||||
<property name="valign">start</property>
|
<property name="valign">start</property>
|
||||||
<property name="label" translatable="yes">Reminders</property>
|
<property name="label" translatable="yes">Reminders</property>
|
||||||
<property name="ellipsize">end</property>
|
<property name="ellipsize">end</property>
|
||||||
@@ -180,7 +166,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="notes_label">
|
<object class="GtkLabel" id="notes_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="halign">end</property>
|
<property name="xalign">1.0</property>
|
||||||
<property name="valign">start</property>
|
<property name="valign">start</property>
|
||||||
<property name="label" translatable="yes">Notes</property>
|
<property name="label" translatable="yes">Notes</property>
|
||||||
<style>
|
<style>
|
||||||
@@ -195,7 +181,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="location_label">
|
<object class="GtkLabel" id="location_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="halign">end</property>
|
<property name="xalign">1.0</property>
|
||||||
<property name="label" translatable="yes">Location</property>
|
<property name="label" translatable="yes">Location</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
@@ -257,37 +243,75 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkRevealer">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="spacing">6</property>
|
<property name="reveal_child" bind-source="all_day_check" bind-property="active" bind-flags="default|invert-boolean|sync-create" />
|
||||||
|
<signal name="notify::child-revealed" handler="update_revealer_visibility_cb" swapped="no" />
|
||||||
|
<signal name="notify::reveal-child" handler="update_revealer_visibility_cb" swapped="no" />
|
||||||
<child>
|
<child>
|
||||||
<object class="GcalTimeSelector" id="start_time_selector">
|
<object class="GtkLabel" id="times_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="xalign">1.0</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="label" translatable="yes">Time</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<style>
|
||||||
|
<class name="dim-label"/>
|
||||||
|
</style>
|
||||||
</object>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRevealer">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="reveal_child" bind-source="all_day_check" bind-property="active" bind-flags="default|invert-boolean|sync-create" />
|
||||||
|
<signal name="notify::child-revealed" handler="update_revealer_visibility_cb" swapped="no" />
|
||||||
|
<signal name="notify::reveal-child" handler="update_revealer_visibility_cb" swapped="no" />
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<child>
|
||||||
<property name="label">-</property>
|
<object class="GtkBox">
|
||||||
</object>
|
<property name="visible">True</property>
|
||||||
</child>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GcalTimeSelector" id="end_time_selector">
|
<object class="GcalTimeSelector" id="start_time_selector">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label">-</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GcalTimeSelector" id="end_time_selector">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="width">4</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|||||||
@@ -285,6 +285,15 @@ fix_reminders_label_height_cb (GtkWidget *summary_label,
|
|||||||
gtk_widget_set_size_request (reminders_label, -1, allocation->height);
|
gtk_widget_set_size_request (reminders_label, -1, allocation->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_revealer_visibility_cb (GtkRevealer *revealer)
|
||||||
|
{
|
||||||
|
if (gtk_revealer_get_reveal_child (revealer))
|
||||||
|
gtk_widget_set_visible (GTK_WIDGET (revealer), TRUE);
|
||||||
|
else if (!gtk_revealer_get_child_revealed (revealer))
|
||||||
|
gtk_widget_set_visible (GTK_WIDGET (revealer), FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_edit_dialog_get_property (GObject *object,
|
gcal_edit_dialog_get_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
@@ -432,6 +441,7 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
|
|||||||
gtk_widget_class_bind_template_callback (widget_class, gcal_edit_dialog_all_day_changed);
|
gtk_widget_class_bind_template_callback (widget_class, gcal_edit_dialog_all_day_changed);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, update_summary);
|
gtk_widget_class_bind_template_callback (widget_class, update_summary);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, update_location);
|
gtk_widget_class_bind_template_callback (widget_class, update_location);
|
||||||
|
gtk_widget_class_bind_template_callback (widget_class, update_revealer_visibility_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user