ocarina: Move some buttons to the header

I think these buttons work better in the page header, rather than in the
footer with the controls.
This commit is contained in:
Bryan Schumaker 2011-11-13 12:34:57 -05:00
parent 364b3a7c65
commit f7bd0d873f
2 changed files with 11 additions and 17 deletions

View File

@ -5,7 +5,7 @@
static GtkWidget *controls = NULL;
static GtkWidget *make_bottom_row()
static GtkWidget *make_buttons()
{
GtkWidget *buttons = gtk_hbox_new(FALSE, 0);
gtk_widget_show(buttons);
@ -20,25 +20,15 @@ static GtkWidget *make_bottom_row()
return buttons;
}
static GtkWidget *make_top_row()
{
GtkWidget *buttons = gtk_hbox_new(FALSE, 0);
box_pack_end(buttons, make_volume_button(), FALSE, FALSE, 0);
box_pack_end(buttons, make_random_button(), FALSE, FALSE, 0);
box_pack_end(buttons, make_open_button(), FALSE, FALSE, 0);
gtk_widget_show_all(buttons);
return buttons;
}
static void make_controls()
{
controls = gtk_vbox_new(FALSE, 0);
gtk_widget_show(controls);
box_pack_start(controls, make_top_row(), TRUE, FALSE, 0);
box_pack_start(controls, make_bottom_row(), TRUE, FALSE, 0);
/*
* Putting the button hbox into a vbox will keep them from
* expanding vertically to take up all the space.
*/
box_pack_start(controls, make_buttons(), TRUE, FALSE, 0);
}
GtkWidget *get_controls()

View File

@ -1,5 +1,6 @@
#include <ocarina/header.h>
#include <ocarina/button.h>
#include "header.h"
static GtkWidget *header = NULL;
@ -9,7 +10,10 @@ static void make_header()
GtkWidget *sep = gtk_hseparator_new();
GtkWidget *content = gtk_hbox_new(FALSE, 0);
box_pack_start(content, get_entry(), TRUE, TRUE, 0);
box_pack_start(content, get_entry(), TRUE, TRUE, 0);
box_pack_start(content, make_open_button(), FALSE, FALSE, 0);
box_pack_start(content, make_random_button(), FALSE, FALSE, 0);
box_pack_start(content, make_volume_button(), FALSE, FALSE, 0);
header = gtk_vbox_new(FALSE, 0);
box_pack_start(header, content, FALSE, FALSE, 0);