[PATCH 2/2] Amendments to color printing.

amit.k.chaudhuri at gmail.com amit.k.chaudhuri at gmail.com
Wed Mar 13 00:18:50 PDT 2013


From: Amit Chaudhuri <amit.k.chaudhuri at gmail.com>

Use US english spelling for 'color'.

Use a darker color for the grid on dive plot; that way we can see it.

Default to use color printing.

Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri at gmail.com>
---
 display.h |    2 +-
 print.c   |   19 +++++++++----------
 profile.c |    4 ++--
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/display.h b/display.h
index cef0ad1..c0163ae 100644
--- a/display.h
+++ b/display.h
@@ -54,7 +54,7 @@ extern void get_plot_details(struct graphics_context *gc, int time, char *buf, s
 struct options {
 	enum { PRETTY, TABLE, TWOPERPAGE } type;
 	int print_selected;
-	int colour_selected;
+	int color_selected;
 };
 
 extern char zoomed_plot, dc_number;
diff --git a/print.c b/print.c
index 7408bb6..158418b 100644
--- a/print.c
+++ b/print.c
@@ -598,9 +598,9 @@ static int show_dive_table(struct dive *dive, cairo_t *cr, PangoLayout *layout,
 static void show_dive_profile(struct dive *dive, cairo_t *cr, double w,
 	double h)
 {
-	int colour = print_options.colour_selected == 1 ? 2 : 1; /* 1 for B/W, 2 for colour */
+	int color = print_options.color_selected == 1 ? 2 : 1; /* 1 for B/W, 2 for color */
 	struct graphics_context gc = {
-		.printer = colour,
+		.printer = color,
 		.cr = cr,
 		.drawing_area = { w/20.0, h/20.0, w, h},
 	};
@@ -871,7 +871,7 @@ static void name(GtkWidget *w, gpointer data) \
 }
 
 OPTIONSELECTEDCALLBACK(print_selection_toggle, print_options.print_selected)
-OPTIONSELECTEDCALLBACK(colour_selection_toggle, print_options.colour_selected)
+OPTIONSELECTEDCALLBACK(color_selection_toggle, print_options.color_selected)
 
 
 static GtkWidget *print_dialog(GtkPrintOperation *operation, gpointer user_data)
@@ -921,13 +921,12 @@ static GtkWidget *print_dialog(GtkPrintOperation *operation, gpointer user_data)
 		gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 2);
 		g_signal_connect(G_OBJECT(button), "toggled",
 			G_CALLBACK(print_selection_toggle), NULL);
-		GtkWidget *colourButton;
-		colourButton = gtk_check_button_new_with_label(_("Print in colour"));
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(colourButton),
-			print_options.colour_selected);
-		gtk_box_pack_start(GTK_BOX(box), colourButton, FALSE, FALSE, 2);
-		g_signal_connect(G_OBJECT(colourButton), "toggled",
-			G_CALLBACK(colour_selection_toggle), NULL);
+		GtkWidget *colorButton;
+		colorButton = gtk_check_button_new_with_label(_("Print in color"));
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(colorButton),TRUE);
+		gtk_box_pack_start(GTK_BOX(box), colorButton, FALSE, FALSE, 2);
+		g_signal_connect(G_OBJECT(colorButton), "toggled",
+			G_CALLBACK(color_selection_toggle), NULL);
 	}
 
 	gtk_widget_show_all(vbox);
diff --git a/profile.c b/profile.c
index 29eda37..522e5ae 100644
--- a/profile.c
+++ b/profile.c
@@ -117,9 +117,9 @@ static const color_t profile_color[] = {
 	[SAMPLE_SHALLOW]  = {{PERSIANRED1, BLACK1_LOW_TRANS, PERSIANRED1}},
 	[SMOOTHED]        = {{REDORANGE1_HIGH_TRANS, BLACK1_LOW_TRANS, REDORANGE1_HIGH_TRANS}},
 	[MINUTE]          = {{MEDIUMREDVIOLET1_HIGHER_TRANS, BLACK1_LOW_TRANS, MEDIUMREDVIOLET1_HIGHER_TRANS}},
-	[TIME_GRID]       = {{WHITE1, TUNDORA1_MED_TRANS, WHITE1}},
+	[TIME_GRID]       = {{WHITE1, TUNDORA1_MED_TRANS, TUNDORA1_MED_TRANS}},
 	[TIME_TEXT]       = {{FORESTGREEN1, BLACK1_LOW_TRANS, FORESTGREEN1}},
-	[DEPTH_GRID]      = {{WHITE1, TUNDORA1_MED_TRANS, WHITE1}},
+	[DEPTH_GRID]      = {{WHITE1, TUNDORA1_MED_TRANS, TUNDORA1_MED_TRANS}},
 	[MEAN_DEPTH]      = {{REDORANGE1_MED_TRANS, BLACK1_LOW_TRANS, REDORANGE1_MED_TRANS}},
 	[DEPTH_BOTTOM]    = {{GOVERNORBAY1_MED_TRANS, TUNDORA1_MED_TRANS, GOVERNORBAY1_MED_TRANS}},
 	[DEPTH_TOP]       = {{MERCURY1_MED_TRANS, WHITE1_MED_TRANS, MERCURY1_MED_TRANS}},
-- 
1.7.10.4



More information about the subsurface mailing list