[gnome-calendar] edit-dialog: fix Reminders dim label size
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] edit-dialog: fix Reminders dim label size
- Date: Wed, 6 Jul 2016 15:38:09 +0000 (UTC)
commit c406b604e239fd11e4d30551e03e0dc5d91369b5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Jul 6 12:38:09 2016 -0300
edit-dialog: fix Reminders dim label size
data/ui/edit-dialog.ui | 4 +++-
src/gcal-edit-dialog.c | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/data/ui/edit-dialog.ui b/data/ui/edit-dialog.ui
index fe0a378..4d59374 100644
--- a/data/ui/edit-dialog.ui
+++ b/data/ui/edit-dialog.ui
@@ -64,6 +64,7 @@
<property name="halign">end</property>
<property name="label" translatable="yes">Title</property>
<property name="ellipsize">end</property>
+ <signal name="size-allocate" handler="fix_reminders_label_height_cb"
object="reminders_label" swapped="no" after="yes" />
<style>
<class name="dim-label"/>
</style>
@@ -102,9 +103,10 @@
</packing>
</child>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="reminders_label">
<property name="visible">True</property>
<property name="halign">end</property>
+ <property name="valign">start</property>
<property name="label" translatable="yes">Reminders</property>
<property name="ellipsize">end</property>
<style>
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 9727802..5c7b227 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -272,6 +272,14 @@ sort_alarms_func (GtkListBoxRow *a,
}
static void
+fix_reminders_label_height_cb (GtkWidget *summary_label,
+ GdkRectangle *allocation,
+ GtkWidget *reminders_label)
+{
+ gtk_widget_set_size_request (reminders_label, -1, allocation->height);
+}
+
+static void
gcal_edit_dialog_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -411,6 +419,7 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
/* callbacks */
gtk_widget_class_bind_template_callback (widget_class, add_alarm_button_clicked);
+ gtk_widget_class_bind_template_callback (widget_class, fix_reminders_label_height_cb);
gtk_widget_class_bind_template_callback (widget_class, gcal_edit_dialog_action_button_clicked);
gtk_widget_class_bind_template_callback (widget_class, gcal_edit_dialog_all_day_changed);
gtk_widget_class_bind_template_callback (widget_class, update_summary);
@@ -656,6 +665,13 @@ remove_button_clicked (GtkButton *button,
gcal_manager_update_event (self->manager, event);
gtk_widget_destroy (row);
+
+ /*
+ * In order to not allocate a spacing between the listbox and the
+ * add alarms button, we should always keep the listbox:visible property
+ * updated.
+ */
+ gtk_widget_set_visible (self->alarms_listbox, gcal_event_has_alarms (self->event));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]