From 4975ef8299dd856e879593d5e76dd38dc4c6e3e1 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 6 Aug 2007 18:37:01 +0300 Subject: [PATCH] Fix menu(s) under hildon. Fix color dialog value handling. --- src/hildon-mapper.h | 13 +++++++++++-- src/settings-gui.c | 41 ++++++++++------------------------------- src/ui-common.c | 17 ++++++++--------- 3 files changed, 29 insertions(+), 42 deletions(-) diff --git a/src/hildon-mapper.h b/src/hildon-mapper.h index ddc11ba..6f64303 100644 --- a/src/hildon-mapper.h +++ b/src/hildon-mapper.h @@ -26,7 +26,14 @@ #ifdef WITH_HILDONFM #include #endif + +#ifdef WITH_DEVICE_770 +#include +#include +#endif + #else + #include #include #include @@ -34,14 +41,16 @@ #include #include #include + #ifdef WITH_HILDONFM #include #endif -#endif #ifdef WITH_DEVICE_770 #include -#include +#include +#endif + #endif #endif diff --git a/src/settings-gui.c b/src/settings-gui.c index 2279a09..989d93b 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -319,37 +319,16 @@ settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) gtk_widget_show_all(dialog); if (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { - GdkColor *color=NULL; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]),color); - _color[COLORABLE_MARK] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]) ,color); - _color[COLORABLE_MARK_VELOCITY] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]),color); - _color[COLORABLE_MARK_OLD] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]),color); - _color[COLORABLE_TRACK] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]),color); - _color[COLORABLE_TRACK_MARK] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),color); - _color[COLORABLE_TRACK_BREAK] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),color); - _color[COLORABLE_ROUTE] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),color); - _color[COLORABLE_ROUTE_WAY] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),color); - _color[COLORABLE_ROUTE_BREAK] = *color; - - gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),color); - _color[COLORABLE_POI] = *color; + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK]), &_color[COLORABLE_MARK]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]), &_color[COLORABLE_MARK_VELOCITY]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]), &_color[COLORABLE_MARK_OLD]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]), &_color[COLORABLE_TRACK]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]), &_color[COLORABLE_TRACK_MARK]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),&_color[COLORABLE_TRACK_BREAK]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),&_color[COLORABLE_ROUTE]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),&_color[COLORABLE_ROUTE_WAY]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),&_color[COLORABLE_ROUTE_BREAK]); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cdi.col[COLORABLE_POI]),&_color[COLORABLE_POI]); update_gcs(); } diff --git a/src/ui-common.c b/src/ui-common.c index 7e3d5a1..ec0c422 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -258,6 +258,7 @@ static void menu_init() GtkWidget *submenu_track; GtkWidget *submenu; GtkWidget *menu_item; + GtkWidget *file_item; printf("%s()\n", __PRETTY_FUNCTION__); /* Get the menu of our view. */ @@ -266,8 +267,6 @@ static void menu_init() #ifdef WITH_HILDON hildon_window_set_menu(HILDON_WINDOW(_window), menu); #else - GtkWidget *file_item; - file_item = gtk_menu_item_new_with_label("File"); gtk_menu_item_set_submenu(GTK_MENU_ITEM(file_item), GTK_WIDGET(menu)); gtk_menu_bar_append(GTK_MENU_BAR(_menu_bar), GTK_WIDGET(file_item)); @@ -503,14 +502,17 @@ static void menu_init() g_signal_connect(G_OBJECT(_menu_close_item), "activate", G_CALLBACK(gtk_main_quit), NULL); + gtk_widget_show_all(GTK_WIDGET(menu)); +#ifndef WITH_HILDON + gtk_widget_show_all(GTK_WIDGET(_menu_bar)); +#endif + /* Setup the context menu. */ menu = GTK_MENU(gtk_menu_new()); /* Setup the map context menu. */ - gtk_menu_append(menu, menu_item - = gtk_menu_item_new_with_label(_("Location"))); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), - submenu = gtk_menu_new()); + gtk_menu_append(menu, menu_item = gtk_menu_item_new_with_label(_("Location"))); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu = gtk_menu_new()); /* Setup the map context menu. */ gtk_menu_append(submenu, _cmenu_loc_show_latlon_item @@ -637,9 +639,6 @@ static void menu_init() G_CALLBACK(menu_cb_goto_nearpoi), NULL); gtk_widget_show_all(GTK_WIDGET(menu)); -#ifndef WITH_HILDON - gtk_widget_show_all(GTK_WIDGET(_menu_bar)); -#endif #ifdef WITH_DEVICE_770 gtk_widget_tap_and_hold_setup(_map_widget, GTK_WIDGET(menu), NULL, 0); -- 2.39.5