From 66a3ca63e6785b1285b7f21272d26952432fa3b1 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Fri, 28 Oct 2011 14:27:05 -0400 Subject: [PATCH] ocarina: Add a separator to the footer I think the separator looks better, and helps to show where the songlist ends and the footer begins. --- ocarina/footer/footer.cpp | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/ocarina/footer/footer.cpp b/ocarina/footer/footer.cpp index d2739e8d..a3bb8bee 100644 --- a/ocarina/footer/footer.cpp +++ b/ocarina/footer/footer.cpp @@ -4,29 +4,40 @@ static GtkWidget *footer = NULL; -static void footer_pack(GtkWidget *widget) +static void add_controls() { - box_pack_end(footer, widget, FALSE, FALSE, 0); + GtkWidget *controls = gtk_hbox_new(FALSE, 0); + gtk_widget_show(controls); + + box_pack_end(controls, make_volume_button(), FALSE, FALSE, 0); + box_pack_end(controls, make_stop_button(), FALSE, FALSE, 0); + box_pack_end(controls, make_pause_button(), FALSE, FALSE, 0); + box_pack_end(controls, make_play_button(), FALSE, FALSE, 0); + box_pack_end(controls, make_forward_button(), FALSE, FALSE, 0); + box_pack_end(controls, make_rewind_button(), FALSE, FALSE, 0); + box_pack_end(controls, make_open_button(), FALSE, FALSE, 0); + + box_pack_start(footer, controls, FALSE, FALSE, 0); } -static void make_tiny_footer() +static void make_footer() { - footer = gtk_hbox_new(FALSE, 0); - gtk_widget_show(footer); + GtkWidget *sep = gtk_hseparator_new(); + footer = gtk_vbox_new(FALSE, 0); + box_pack_start(footer, sep, FALSE, FALSE, 0); - footer_pack(make_volume_button()); - footer_pack(make_stop_button()); - footer_pack(make_pause_button()); - footer_pack(make_play_button()); - footer_pack(make_forward_button()); - footer_pack(make_rewind_button()); - footer_pack(make_open_button()); + /* + * The pause button begins life hidden, so show everything up until + * this point, and then add the controls + */ + gtk_widget_show_all(footer); + add_controls(); } GtkWidget *get_footer() { if (footer == NULL) - make_tiny_footer(); + make_footer(); g_object_ref(footer); return footer; }