From 9eaa5238ae62f499e5fcccedd5dc5779c0be3da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Tue, 3 Jul 2012 15:47:59 -0400 Subject: [PATCH] Fixed UI issue with GcalEditableReminder. There was an issue when using the 'list-add' icon for adding a new reminder. The issue is fixed, but still there's abunch of cleaning/aligning/redesigning to do there. --- src/gcal-editable-reminder.c | 41 ++++++++---------------------------- src/gcal-event-view.c | 2 ++ 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/src/gcal-editable-reminder.c b/src/gcal-editable-reminder.c index f75f117b..d64940da 100644 --- a/src/gcal-editable-reminder.c +++ b/src/gcal-editable-reminder.c @@ -109,7 +109,12 @@ gcal_editable_reminder_constructed (GObject *object) gcal_editable_set_view_widget (GCAL_EDITABLE (object), priv->view_widget); priv->edit_widget = gtk_grid_new (); - gtk_grid_set_column_spacing (GTK_GRID (priv->edit_widget), 6); + g_object_set (priv->edit_widget, + "orientation", GTK_ORIENTATION_VERTICAL, + "row-spacing", 6, + "column-spacing", 6, + "valign", GTK_ALIGN_START, + NULL); priv->left_box = gtk_grid_new (); g_object_set (priv->left_box, "orientation", GTK_ORIENTATION_VERTICAL, @@ -123,18 +128,13 @@ gcal_editable_reminder_constructed (GObject *object) 1, NULL); - priv->add_button = gtk_button_new (); + priv->add_button = gtk_button_new_with_label (_("Add reminder")); g_object_ref_sink (priv->add_button); g_object_set (priv->add_button, + "halign", GTK_ALIGN_START, "valign", GTK_ALIGN_START, - "halign", GTK_ALIGN_END, - "relief", GTK_RELIEF_NONE, NULL); - gtk_container_add ( - GTK_CONTAINER (priv->add_button), - gtk_image_new_from_icon_name ("list-add-symbolic", - GTK_ICON_SIZE_MENU)); - gtk_grid_attach (GTK_GRID (priv->edit_widget), priv->add_button, 1, 0, 1, 1); + gtk_grid_attach (GTK_GRID (priv->edit_widget), priv->add_button, 0, 1, 1, 1); g_signal_connect (priv->add_button, "clicked", G_CALLBACK (gcal_editable_reminder_add_button_clicked), @@ -383,19 +383,6 @@ gcal_editable_reminder_insert_reminder (GcalEditableReminder *editable, gtk_widget_show_all (hbox); priv->reminders = g_list_append (priv->reminders, hbox); - - /* hack for activating/deactivating first del_button */ - if (g_list_length (priv->reminders) == 1) - { - gtk_widget_set_sensitive (del_button, FALSE); - } - else - { - del_button = gtk_grid_get_child_at ( - GTK_GRID (g_list_first (priv->reminders)->data), - 3, 0); - gtk_widget_set_sensitive (del_button, TRUE); - } } static void @@ -415,16 +402,6 @@ gcal_editable_reminder_remove_reminder (GtkButton *button, { priv->reminders = g_list_remove (priv->reminders, parent); gtk_container_remove (GTK_CONTAINER (priv->left_box), parent); - - /* hack for activating/deactivating first del_button */ - if (g_list_length (priv->reminders) == 1) - { - GtkWidget *del_button; - del_button = gtk_grid_get_child_at ( - GTK_GRID (g_list_last (priv->reminders)->data), - 3, 0); - gtk_widget_set_sensitive (del_button, FALSE); - } } } diff --git a/src/gcal-event-view.c b/src/gcal-event-view.c index d79c2370..132f36fe 100644 --- a/src/gcal-event-view.c +++ b/src/gcal-event-view.c @@ -166,6 +166,7 @@ gcal_event_view_constructed (GObject *object) gtk_container_add (GTK_CONTAINER (attending_box), priv->attending_maybe); gtk_container_add (GTK_CONTAINER (attending_box), priv->attending_no); + /* Building the skel grid */ what = gtk_label_new (_("What")); gtk_widget_set_halign (what, GTK_ALIGN_END); gtk_grid_attach (GTK_GRID (object), what, 0, 0, 1, 1); @@ -196,6 +197,7 @@ gcal_event_view_constructed (GObject *object) rem = gtk_label_new (_("Reminders")); gtk_widget_set_halign (rem, GTK_ALIGN_END); gtk_widget_set_valign (rem, GTK_ALIGN_START); + gtk_widget_set_margin_top (rem, 10); gtk_grid_attach (GTK_GRID (object), rem, 0, 5, 1, 1); gtk_grid_attach (GTK_GRID (object), priv->reminders, 1, 5, 1, 1);