From: Kaj-Michael Lang Date: Thu, 14 Jun 2007 22:04:48 +0000 (+0300) Subject: Use gtk_color_button X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed644fa669aa0b6213cf09c0d1110dd03be9c841;p=mapper Use gtk_color_button --- diff --git a/src/settings-gui.c b/src/settings-gui.c index fefb468..c5a46b9 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -202,7 +202,7 @@ settings_dialog_colors_reset(GtkWidget * widget, ColorsDialogInfo * cdi) if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) { gint i; for (i = 0; i < COLORABLE_ENUM_COUNT; i++) { - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi->col[i]), &COLORABLE_DEFAULT[i]); } @@ -228,8 +228,7 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) GTK_RESPONSE_ACCEPT, NULL); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), - btn_defaults = - gtk_button_new_with_label(_("Reset..."))); + btn_defaults = gtk_button_new_with_label(_("Reset..."))); g_signal_connect(G_OBJECT(btn_defaults), "clicked", G_CALLBACK(settings_dialog_colors_reset), &cdi); @@ -237,7 +236,7 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), - table = gtk_table_new(4, 3, FALSE), TRUE, TRUE, 0); + table = gtk_table_new(4, 3, TRUE), TRUE, TRUE, 0); /* GPS. */ gtk_table_attach(GTK_TABLE(table), @@ -245,19 +244,19 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) 0, 1, 0, 1, GTK_FILL, 0, 2, 4); gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); gtk_table_attach(GTK_TABLE(table), - cdi.col[COLORABLE_MARK] = hildon_color_button_new(), + cdi.col[COLORABLE_MARK] = gtk_color_button_new(), 1, 2, 0, 1, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_MARK]), &_color[COLORABLE_MARK]); gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK_VELOCITY] = - hildon_color_button_new(), 2, 3, 0, 1, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_new(), 2, 3, 0, 1, 0, 0, 2, 4); + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_MARK_VELOCITY]), &_color[COLORABLE_MARK_VELOCITY]); gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_MARK_OLD] = - hildon_color_button_new(), 3, 4, 0, 1, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_new(), 3, 4, 0, 1, 0, 0, 2, 4); + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_MARK_OLD]), &_color[COLORABLE_MARK_OLD]); @@ -267,19 +266,19 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) 0, 1, 1, 2, GTK_FILL, 0, 2, 4); gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); gtk_table_attach(GTK_TABLE(table), - cdi.col[COLORABLE_TRACK] = hildon_color_button_new(), + cdi.col[COLORABLE_TRACK] = gtk_color_button_new(), 1, 2, 1, 2, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_TRACK]), &_color[COLORABLE_TRACK]); gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK_MARK] = - hildon_color_button_new(), 2, 3, 1, 2, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_new(), 2, 3, 1, 2, 0, 0, 2, 4); + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_TRACK_MARK]), &_color[COLORABLE_TRACK_MARK]); gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_TRACK_BREAK] = - hildon_color_button_new(), 3, 4, 1, 2, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_new(), 3, 4, 1, 2, 0, 0, 2, 4); + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_TRACK_BREAK]), &_color[COLORABLE_TRACK_BREAK]); @@ -289,19 +288,19 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) 0, 1, 2, 3, GTK_FILL, 0, 2, 4); gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); gtk_table_attach(GTK_TABLE(table), - cdi.col[COLORABLE_ROUTE] = hildon_color_button_new(), + cdi.col[COLORABLE_ROUTE] = gtk_color_button_new(), 1, 2, 2, 3, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_ROUTE]), &_color[COLORABLE_ROUTE]); gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE_WAY] = - hildon_color_button_new(), 2, 3, 2, 3, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_new(), 2, 3, 2, 3, 0, 0, 2, 4); + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_ROUTE_WAY]), &_color[COLORABLE_ROUTE_WAY]); gtk_table_attach(GTK_TABLE(table), cdi.col[COLORABLE_ROUTE_BREAK] = - hildon_color_button_new(), 3, 4, 2, 3, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_new(), 3, 4, 2, 3, 0, 0, 2, 4); + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_ROUTE_BREAK]), &_color[COLORABLE_ROUTE_BREAK]); @@ -311,9 +310,9 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) 0, 1, 3, 4, GTK_FILL, 0, 2, 4); gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); gtk_table_attach(GTK_TABLE(table), - cdi.col[COLORABLE_POI] = hildon_color_button_new(), + cdi.col[COLORABLE_POI] = gtk_color_button_new(), 1, 2, 3, 4, 0, 0, 2, 4); - hildon_color_button_set_color(HILDON_COLOR_BUTTON + gtk_color_button_set_color(GTK_COLOR_BUTTON (cdi.col[COLORABLE_POI]), &_color[COLORABLE_POI]); @@ -322,61 +321,44 @@ gboolean settings_dialog_colors(GtkWidget * widget, GtkWidget * parent) while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { GdkColor *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi.col[COLORABLE_MARK])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_MARK]),color); _color[COLORABLE_MARK] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi. - col - [COLORABLE_MARK_VELOCITY])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_MARK_VELOCITY]) ,color); _color[COLORABLE_MARK_VELOCITY] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi. - col[COLORABLE_MARK_OLD])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_MARK_OLD]),color); _color[COLORABLE_MARK_OLD] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi.col[COLORABLE_TRACK])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_TRACK]),color); _color[COLORABLE_TRACK] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi. - col[COLORABLE_TRACK_MARK])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_TRACK_MARK]),color); _color[COLORABLE_TRACK_MARK] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi. - col[COLORABLE_TRACK_BREAK])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_TRACK_BREAK]),color); _color[COLORABLE_TRACK_BREAK] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi.col[COLORABLE_ROUTE])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_ROUTE]),color); _color[COLORABLE_ROUTE] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi. - col[COLORABLE_ROUTE_WAY])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_ROUTE_WAY]),color); _color[COLORABLE_ROUTE_WAY] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi. - col[COLORABLE_ROUTE_BREAK])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_ROUTE_BREAK]),color); _color[COLORABLE_ROUTE_BREAK] = *color; - color = - hildon_color_button_get_color(HILDON_COLOR_BUTTON - (cdi.col[COLORABLE_POI])); + gtk_color_button_get_color(GTK_COLOR_BUTTON + (cdi.col[COLORABLE_POI]),color); _color[COLORABLE_POI] = *color; update_gcs(); @@ -695,11 +677,11 @@ gboolean settings_dialog() /* POI page */ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table = gtk_table_new(2, 3, FALSE), - label = gtk_label_new(_("POI"))); + label = gtk_label_new(_("Database"))); - /* POI database. */ + /* Database. */ gtk_table_attach(GTK_TABLE(table), - label = gtk_label_new(_("POI database")), + label = gtk_label_new(_("Database")), 0, 1, 1, 2, GTK_FILL, 0, 2, 4); gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); gtk_table_attach(GTK_TABLE(table),