edit-dialog: fix Reminders dim label size

This commit is contained in:
Georges Basile Stavracas Neto
2016-07-06 12:38:09 -03:00
parent 8e5fa1a10c
commit c406b604e2
2 changed files with 19 additions and 1 deletions
+3 -1
View File
@@ -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>
+16
View File
@@ -271,6 +271,14 @@ sort_alarms_func (GtkListBoxRow *a,
return minutes_a - minutes_b;
}
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,
@@ -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