]> err.no Git - mapper/commitdiff
Use a hpaned for info/map view.
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 14 Jun 2007 13:37:19 +0000 (16:37 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 14 Jun 2007 13:37:19 +0000 (16:37 +0300)
src/cb.c
src/maemo-osso.c
src/ui-common.c
src/ui-common.h

index b4ba737a3d452c983b101366f37840e92e29cf32..7d91d982edf55f7919fb06a64111d95c12fdc7a8 100644 (file)
--- 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;
 
index 1bbcb151da6b55c45814fc32384d860244eeef99..646b086a0bbddfedfcdd2d87e41264f82557ed2d 100644 (file)
@@ -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);
index eb5440137e6380ed50976a5743cd682fc1dcd842..fa455f1a63ef89e94c6b7c0b9c4dfe3e5d26fede 100644 (file)
@@ -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. */
index 13d0f0ea87758b383c1733f91e5ee848aea5882b..71c4a835a8fb064dcf51f31e1d3dfa4477e2f29a 100644 (file)
@@ -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;