diff options
author | Alberts Muktupāvels <[email protected]> | 2014-11-03 23:57:44 +0200 |
---|---|---|
committer | lukefromdc <[email protected]> | 2017-05-21 13:47:27 -0400 |
commit | 30a6f5facd7bdb45aaeb77a51ea77f2a7f3504ba (patch) | |
tree | d7ab91b6fdab175932e0266add694dd9013f35c3 /applets/clock/calendar-window.c | |
parent | 4de86661f4a6f67285333c67342c287f99deffeb (diff) | |
download | mate-panel-30a6f5facd7bdb45aaeb77a51ea77f2a7f3504ba.tar.bz2 mate-panel-30a6f5facd7bdb45aaeb77a51ea77f2a7f3504ba.tar.xz |
clock: properly handle visibility of edit button
Fixes https://github.com/mate-desktop/mate-panel/issues/570
taken from:
https://git.gnome.org/browse/gnome-panel/commit/?id=cc99dca
Diffstat (limited to 'applets/clock/calendar-window.c')
-rw-r--r-- | applets/clock/calendar-window.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c index 4f82f67a..3c3b0566 100644 --- a/applets/clock/calendar-window.c +++ b/applets/clock/calendar-window.c @@ -185,9 +185,7 @@ create_hig_frame (CalendarWindow *calwin, GtkWidget *vbox; GtkWidget *label; GtkWidget *hbox; - GtkWidget *button; char *bold_title; - char *text; GtkWidget *expander; vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); @@ -215,7 +213,16 @@ create_hig_frame (CalendarWindow *calwin, g_signal_connect (hbox, "add", G_CALLBACK (add_child), expander); if (button_label) { + GtkWidget *button_box; + GtkWidget *button; + gchar *text; + + button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_show (button_box); + button = gtk_button_new (); + gtk_container_add (GTK_CONTAINER (button_box), button); + text = g_markup_printf_escaped ("<small>%s</small>", button_label); label = gtk_label_new (text); g_free (text); @@ -224,9 +231,13 @@ create_hig_frame (CalendarWindow *calwin, gtk_widget_show_all (button); - gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (hbox), button_box, FALSE, FALSE, 0); g_signal_connect_swapped (button, "clicked", callback, calwin); + + g_object_bind_property (expander, "expanded", + button_box, "visible", + G_BINDING_DEFAULT|G_BINDING_SYNC_CREATE); } g_settings_bind (calwin->priv->settings, key, expander, "expanded", |