ocarina: Smaller progress bar
I learned how to set custom gtk_rc styles to configure the idle task progress bar. Now that it's smaller, I also moved it to the very bottom of the window. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
a33e1e6d8d
commit
97fcff5c18
|
@ -95,8 +95,6 @@ static GtkWidget *make_controls()
|
|||
dur_label = gtk_label_new("");
|
||||
gtk_scale_set_draw_value(GTK_SCALE(track_progress), FALSE);
|
||||
|
||||
idle_progress = gtk_progress_bar_new();
|
||||
gtk_box_pack_start(GTK_BOX(box), idle_progress, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(box), pos_label, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(box), track_progress, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(box), dur_label, FALSE, FALSE, 0);
|
||||
|
@ -119,18 +117,31 @@ namespace ocarina
|
|||
GtkWidget *body::footer_init()
|
||||
{
|
||||
GtkWidget *footer = gtk_vbox_new(FALSE, 0);
|
||||
GtkWidget *bottom_box = gtk_hbox_new(FALSE, 0);
|
||||
GtkWidget *controls = make_controls();
|
||||
notebook = gtk_notebook_new();
|
||||
|
||||
idle_progress = gtk_progress_bar_new();
|
||||
gtk_rc_parse_string(
|
||||
"style \"idle-progress-style\"\n"
|
||||
"{\n"
|
||||
" GtkProgressBar::min-horizontal-bar-height = 10\n"
|
||||
" GtkProgressBar::min-horizontal-bar-width = 75\n"
|
||||
"}\n"
|
||||
"widget \"*.ocarina-idle-progress\" style \"idle-progress-style\"");
|
||||
gtk_widget_set_name(idle_progress, "ocarina-idle-progress");
|
||||
|
||||
length_label = gtk_label_new("");
|
||||
gtk_misc_set_alignment(GTK_MISC(length_label), 1.0, 0.0);
|
||||
gtk_box_pack_start(GTK_BOX(bottom_box), idle_progress, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(bottom_box), length_label, TRUE, TRUE, 0);
|
||||
|
||||
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
|
||||
g_object_set(notebook, "tab-border", 0, NULL);
|
||||
|
||||
gtk_misc_set_alignment(GTK_MISC(length_label), 1.0, 0.0);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(footer), controls, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(footer), notebook, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(footer), length_label, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(footer), bottom_box, FALSE, FALSE, 0);
|
||||
|
||||
add_page("Now Playing", now_playing_page());
|
||||
add_page("Library", library_page());
|
||||
|
@ -138,6 +149,7 @@ namespace ocarina
|
|||
|
||||
gtk_widget_show(footer);
|
||||
gtk_widget_show(notebook);
|
||||
gtk_widget_show(bottom_box);
|
||||
gtk_widget_show(length_label);
|
||||
return footer;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue