From 306a0393cf3784b6e9edb2d9f4ab19f44c6d1421 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 18 Oct 2007 19:23:28 +0300 Subject: [PATCH] Cosmetic changes to UI --- src/ui-common.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/ui-common.c b/src/ui-common.c index da1a9ba..dfaf65a 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -531,17 +531,6 @@ _menu_map = menu; #endif } -static void -toolbar_progress_init(void) -{ -GtkToolItem *item; - -item=gtk_tool_item_new(); -_progress_item=gtk_progress_bar_new(); -gtk_container_add(item, _progress_item); -gtk_toolbar_insert(GTK_TOOLBAR (toolbar), item, -1); -} - void mapper_init_variables(void) { @@ -643,6 +632,7 @@ GtkWidget *gpsvbox, *headingvbox; GtkNotebook *notebook; GdkColor color; GError *error = NULL; +GtkToolItem *item; #ifdef WITH_HILDON /* Initialize _program. */ @@ -690,7 +680,12 @@ g_assert(menu_bar); toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar"); g_assert(toolbar); -toolbar_progress_init(); + +item=gtk_tool_item_new(); +_progress_item=gtk_progress_bar_new(); +gtk_tool_item_set_expand(item, TRUE); +gtk_container_add(item, _progress_item); +gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1); /* Notebook with different views */ notebook = gtk_notebook_new(); @@ -700,20 +695,28 @@ info_banner.container=gtk_hbox_new(FALSE, 0); info_banner.location=gtk_label_new(""); info_banner.speed=gtk_label_new(""); info_banner.distance=gtk_label_new(""); + gtk_label_set_max_width_chars(GTK_LABEL(info_banner.speed), 10); gtk_label_set_width_chars(GTK_LABEL(info_banner.speed), 14); -gtk_box_pack_start(GTK_BOX(info_banner.container), info_banner.speed, FALSE, FALSE, 0); +gtk_label_set_max_width_chars(GTK_LABEL(info_banner.distance), 14); +gtk_label_set_width_chars(GTK_LABEL(info_banner.distance), 18); + +gtk_misc_set_alignment(GTK_MISC(info_banner.location), 0.f, 0.5f); +gtk_misc_set_alignment(GTK_MISC(info_banner.speed), 1.f, 0.5f); +gtk_misc_set_alignment(GTK_MISC(info_banner.distance), 1.f, 0.5f); + gtk_box_pack_start(GTK_BOX(info_banner.container), info_banner.location, TRUE, TRUE, 0); -gtk_box_pack_start(GTK_BOX(info_banner.container), info_banner.distance, FALSE, FALSE, 0); +gtk_box_pack_end(GTK_BOX(info_banner.container), info_banner.speed, FALSE, FALSE, 0); +gtk_box_pack_end(GTK_BOX(info_banner.container), info_banner.distance, FALSE, FALSE, 0); vbox_main = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(_window), vbox_main); #ifdef WITH_HILDON /* Create and add widgets and supporting data. */ -gtk_box_pack_start(GTK_BOX(vbox_main), notebook, TRUE, TRUE, 0); -gtk_box_pack_start(GTK_BOX(vbox_main), info_banner.container, FALSE, FALSE, 0); -hildon_program_set_common_toolbar(_program, toolbar); +gtk_box_pack_start(GTK_BOX(vbox_main), GTK_WIDGET(notebook), TRUE, TRUE, 0); +gtk_box_pack_start(GTK_BOX(vbox_main), GTK_WIDGET(info_banner.container), FALSE, FALSE, 0); +hildon_program_set_common_toolbar(_program, GTK_TOOLBAR(toolbar)); { GtkMenu *hmenu; hmenu = GTK_MENU(gtk_menu_new()); -- 2.39.5