[gnome-calendar] edit-dialog : correct time row visibility
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] edit-dialog : correct time row visibility
- Date: Wed, 23 Aug 2017 00:02:23 +0000 (UTC)
commit e56bbc78a8bd6bb84800f5b6c8071d2f65c43ecb
Author: Abdullahi Usman <abdullahismn7 gmail com>
Date: Tue Aug 22 00:24:36 2017 +0100
edit-dialog : correct time row visibility
The revealer widget in edit dialog's event time interval row uses to hide the
time selector widgets when the event is checked as all-day and also reveal the
widgets when not checked as all-day.
Sometimes edit dialog may turn on the visibility of the time selector
widgets when the revealer's animation already starts, causing a flickering of the widgets.
We remove the revealer widget and leave edit dialog to toggle the
visibility of time selector widgets when needed.
https://bugzilla.gnome.org/show_bug.cgi?id=771572
data/ui/edit-dialog.ui | 72 ++++++++++++++++++------------------------------
src/gcal-edit-dialog.c | 10 ------
2 files changed, 27 insertions(+), 55 deletions(-)
---
diff --git a/data/ui/edit-dialog.ui b/data/ui/edit-dialog.ui
index b569184..9a8985d 100644
--- a/data/ui/edit-dialog.ui
+++ b/data/ui/edit-dialog.ui
@@ -287,23 +287,13 @@
</packing>
</child>
<child>
- <object class="GtkRevealer">
+ <object class="GtkLabel" id="times_label">
<property name="visible">True</property>
- <property name="margin-top">12</property>
- <property name="reveal_child" bind-source="all_day_check" bind-property="active"
bind-flags="default|invert-boolean|sync-create" />
- <property name="sensitive" bind-source="GcalEditDialog" bind-property="writable"
bind-flags="default" />
- <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>
- <object class="GtkLabel" id="times_label">
- <property name="visible">True</property>
- <property name="xalign">1.0</property>
- <property name="label" translatable="yes">Time</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
+ <property name="xalign">1.0</property>
+ <property name="label" translatable="yes">Time</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
</object>
<packing>
<property name="left_attach">0</property>
@@ -311,41 +301,33 @@
</packing>
</child>
<child>
- <object class="GtkRevealer">
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="margin-top">12</property>
- <property name="reveal_child" bind-source="all_day_check" bind-property="active"
bind-flags="default|invert-boolean|sync-create" />
- <property name="sensitive" bind-source="GcalEditDialog" bind-property="writable"
bind-flags="default" />
- <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>
<object class="GtkBox">
<property name="visible">True</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkBox">
+ <object class="GcalTimeSelector" id="start_time_selector">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <child>
- <object class="GcalTimeSelector" id="start_time_selector">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog"
swapped="yes" />
- </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>
- <signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog"
swapped="yes" />
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="sensitive" bind-source="GcalEditDialog" bind-property="writable"
bind-flags="default" />
+ <signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog"
swapped="yes" />
+ </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="sensitive" bind-source="GcalEditDialog" bind-property="writable"
bind-flags="default" />
+ <signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog"
swapped="yes" />
</object>
</child>
</object>
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index f64d37e..76ae2c9 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -357,15 +357,6 @@ fix_reminders_label_height_cb (GtkWidget *summary_label,
}
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
sync_datetimes (GcalEditDialog *self,
GParamSpec *pspec,
GtkWidget *widget)
@@ -626,7 +617,6 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
gtk_widget_class_bind_template_callback (widget_class, sync_datetimes);
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_revealer_visibility_cb);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]