Commit 07335315d93d53777faa517dd024e5d81ee99590

Authored by Perry Werneck
1 parent e51354ff
Exists in master and in 1 other branch develop

Color selection updated.

src/dialogs/colors.c
@@ -128,6 +128,22 @@ @@ -128,6 +128,22 @@
128 128
129 } 129 }
130 130
  131 + LIB3270_EXPORT void v3270_color_selection_reset(GtkWidget *widget)
  132 + {
  133 + V3270ColorSelection * sel = GTK_V3270_COLOR_SELECTION(widget);
  134 +
  135 + int f;
  136 + for(f=0;f<V3270_COLOR_COUNT;f++)
  137 + v3270_set_color(sel->terminal,f,sel->saved+f);
  138 +
  139 + update_color_chooser(sel,sel->selected);
  140 +
  141 + v3270_reload(sel->terminal);
  142 + gtk_widget_queue_draw(sel->terminal);
  143 +
  144 + }
  145 +
  146 +
131 #if USE_GTK_COLOR_CHOOSER 147 #if USE_GTK_COLOR_CHOOSER
132 static void color_activated(GtkColorChooser *chooser, GdkRGBA *clr, V3270ColorSelection *widget) 148 static void color_activated(GtkColorChooser *chooser, GdkRGBA *clr, V3270ColorSelection *widget)
133 { 149 {
src/include/v3270/colorscheme.h
@@ -65,6 +65,7 @@ @@ -65,6 +65,7 @@
65 LIB3270_EXPORT void v3270_color_scheme_set_text(GtkWidget *widget, const gchar *colors); 65 LIB3270_EXPORT void v3270_color_scheme_set_text(GtkWidget *widget, const gchar *colors);
66 66
67 LIB3270_EXPORT GtkWidget * v3270_color_selection_new(GtkWidget *widget); 67 LIB3270_EXPORT GtkWidget * v3270_color_selection_new(GtkWidget *widget);
  68 + LIB3270_EXPORT void v3270_color_selection_reset(GtkWidget *widget);
68 69
69 G_END_DECLS 70 G_END_DECLS
70 71
src/testprogram/testprogram.c
@@ -161,6 +161,7 @@ static void color_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) @@ -161,6 +161,7 @@ static void color_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
161 else 161 else
162 { 162 {
163 g_message("Cancel"); 163 g_message("Cancel");
  164 + v3270_color_selection_reset(colors);
164 } 165 }
165 166
166 gtk_widget_destroy(dialog); 167 gtk_widget_destroy(dialog);
@@ -42,6 +42,9 @@ @@ -42,6 +42,9 @@
42 <Add option="`pkg-config --libs gtk+-3.0 lib3270`" /> 42 <Add option="`pkg-config --libs gtk+-3.0 lib3270`" />
43 <Add option="-fPIC" /> 43 <Add option="-fPIC" />
44 </Linker> 44 </Linker>
  45 + <Unit filename="src/dialogs/colors.c">
  46 + <Option compilerVar="CC" />
  47 + </Unit>
45 <Unit filename="src/dialogs/colorscheme.c"> 48 <Unit filename="src/dialogs/colorscheme.c">
46 <Option compilerVar="CC" /> 49 <Option compilerVar="CC" />
47 </Unit> 50 </Unit>