X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b976323b04593bf2f642d8bdf36b39a346d840dc..2e61f6814126617f286fad69f614cccd86db6412:/src/gtk/colordlg.cpp?ds=inline diff --git a/src/gtk/colordlg.cpp b/src/gtk/colordlg.cpp index 4c14ef5dfc..34e9c118fe 100644 --- a/src/gtk/colordlg.cpp +++ b/src/gtk/colordlg.cpp @@ -107,7 +107,7 @@ void wxColourDialog::ColourDataToDialog() wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors)); GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel)); - g_object_set(settings, "gtk-color-palette", pal, NULL); + g_object_set(settings, "gtk-color-palette", pal.c_str(), NULL); } void wxColourDialog::DialogToColourData() @@ -117,7 +117,7 @@ void wxColourDialog::DialogToColourData() GdkColor clr; gtk_color_selection_get_current_color(sel, &clr); - m_data.SetColour(wxColour(clr.red >> 8, clr.green >> 8, clr.blue >> 8)); + m_data.SetColour(wxColour(clr)); // Extract custom palette: @@ -131,9 +131,7 @@ void wxColourDialog::DialogToColourData() { for (int i = 0; i < wxMin(n_colors, 16); i++) { - m_data.SetCustomColour(i, wxColour(colors[i].red >> 8, - colors[i].green >> 8, - colors[i].blue >> 8)); + m_data.SetCustomColour(i, wxColour(colors[i])); } g_free(colors); }