summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <[email protected]>2014-11-03 23:57:44 +0200
committerraveit65 <[email protected]>2017-05-24 19:30:27 +0200
commitd0ffc53f1202accf116fb777d66f24058e7d38b6 (patch)
tree1723a0f4d11ebd01fb3090dd3cd3a3e446317157
parentcaba1515ac4a97695824913726793be16a4891f0 (diff)
downloadmate-panel-d0ffc53f1202accf116fb777d66f24058e7d38b6.tar.bz2
mate-panel-d0ffc53f1202accf116fb777d66f24058e7d38b6.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
-rw-r--r--applets/clock/calendar-window.c17
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",