From 42f6e5e2ddb7026a0ab0ddc0195c60b4f2a90d84 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 14 Jun 2007 16:37:19 +0300 Subject: [PATCH] Use a hpaned for info/map view. --- src/cb.c | 8 ++++++-- src/maemo-osso.c | 5 +++-- src/ui-common.c | 18 +++++++++--------- src/ui-common.h | 3 +++ 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/cb.c b/src/cb.c index b4ba737..7d91d98 100644 --- a/src/cb.c +++ b/src/cb.c @@ -604,10 +604,13 @@ gboolean cb_fullscreen(GtkAction * action) { printf("%s()\n", __PRETTY_FUNCTION__); - if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item)))) + if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item)))) { gtk_window_fullscreen(GTK_WINDOW(_window)); - else + gtk_widget_set_state(_toolbar_fullscreen_item, GTK_STATE_ACTIVE); + } else { gtk_window_unfullscreen(GTK_WINDOW(_window)); + gtk_widget_set_state(_toolbar_fullscreen_item, GTK_STATE_NORMAL); + } gtk_idle_add((GSourceFunc) window_present, NULL); @@ -802,6 +805,7 @@ gboolean window_cb_key_press(GtkWidget * widget, GdkEventKey * event) (_menu_ac_latlon_item), TRUE); break; + default:; } break; diff --git a/src/maemo-osso.c b/src/maemo-osso.c index 1bbcb15..646b086 100644 --- a/src/maemo-osso.c +++ b/src/maemo-osso.c @@ -38,8 +38,7 @@ void osso_cb_hw_state(osso_hw_state_t * state, gpointer data) track_add(0, FALSE); /* Pretend autoroute is in progress to avoid download. */ if (_autoroute_data.enabled) - _autoroute_data.in_progress = - TRUE; + _autoroute_data.in_progress = TRUE; } } if (_curl_sid) { @@ -50,6 +49,8 @@ void osso_cb_hw_state(osso_hw_state_t * state, gpointer data) } else if (state->save_unsaved_data_ind) { config_save(); _must_save_data = TRUE; + } else if (state->memory_low_ind) { + /* Drop any memory we can.. */ } else { if (_conn_state == RCVR_OFF && _enable_gps) { set_conn_state(RCVR_DOWN); diff --git a/src/ui-common.c b/src/ui-common.c index eb54401..fa455f1 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -753,9 +753,9 @@ g_signal_connect (item, "clicked", G_CALLBACK (cb_zoom_autozoom), NULL); item = gtk_separator_tool_item_new(); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); -item = gtk_tool_button_new_from_stock (GTK_STOCK_FULLSCREEN); -gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); -g_signal_connect (item, "clicked", G_CALLBACK (cb_fullscreen_click), NULL); +_toolbar_fullscreen_item = gtk_toggle_tool_button_new_from_stock (GTK_STOCK_FULLSCREEN); +gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), _toolbar_fullscreen_item, -1); +g_signal_connect (_toolbar_fullscreen_item, "clicked", G_CALLBACK (cb_fullscreen_click), NULL); item = gtk_separator_tool_item_new(); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); @@ -915,7 +915,7 @@ void mapper_init(gint argc, gchar ** argv) #ifdef WITH_HILDON /* Create and add widgets and supporting data. */ - hbox = gtk_hbox_new(FALSE, 0); + hbox = gtk_hpaned_new(); gtk_notebook_append_page(notebook, hbox, label); gtk_container_add(GTK_CONTAINER(_window), notebook); hildon_program_set_common_toolbar(_program, _toolbar); @@ -927,7 +927,7 @@ void mapper_init(gint argc, gchar ** argv) gtk_box_pack_start(GTK_BOX(vbox_main), _menu_bar, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_main), _toolbar, FALSE, FALSE, 0); - hbox = gtk_hbox_new(FALSE, 0); + hbox = gtk_hpaned_new(); gtk_notebook_append_page(GTK_WIDGET(notebook), hbox, label); gtk_box_pack_start(GTK_BOX(vbox_main), notebook, TRUE, TRUE, 0); @@ -937,11 +937,11 @@ void mapper_init(gint argc, gchar ** argv) gtk_widget_show_all(vbox_main); #endif + vbox = gtk_vbox_new(FALSE, 0); _gps_widget = gtk_frame_new("GPS Info"); - gtk_container_add(GTK_CONTAINER(_gps_widget), vbox = - gtk_vbox_new(FALSE, 0)); + gtk_container_add(GTK_CONTAINER(_gps_widget), vbox); gtk_widget_set_size_request(GTK_WIDGET(_gps_widget), 180, 0); - gtk_box_pack_start(GTK_BOX(hbox), _gps_widget, FALSE, TRUE, 0); + gtk_paned_add1(hbox, _gps_widget); label = gtk_label_new(" "); gtk_widget_set_size_request(GTK_WIDGET(label), -1, 10); @@ -984,7 +984,7 @@ void mapper_init(gint argc, gchar ** argv) gtk_box_pack_start(GTK_BOX(vbox), _heading_panel, TRUE, TRUE, 0); _map_widget = gtk_drawing_area_new(); - gtk_box_pack_start(GTK_BOX(hbox), _map_widget, TRUE, TRUE, 0); + gtk_paned_add2(hbox, _map_widget); gtk_widget_show_all(hbox); gps_show_info(); /* hides info, if necessary. */ diff --git a/src/ui-common.h b/src/ui-common.h index 13d0f0e..71c4a83 100644 --- a/src/ui-common.h +++ b/src/ui-common.h @@ -126,6 +126,9 @@ GtkWidget *_menu_show_velvec_item; GtkWidget *_menu_show_poi_item; GtkWidget *_menu_poi_item; +/* Toolbar items */ +GtkWidget *_toolbar_fullscreen_item; + /* Menu items for the "Auto-Center" submenu. */ GtkWidget *_menu_ac_latlon_item; GtkWidget *_menu_ac_lead_item; -- 2.39.5