X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ed97f493ab59a3fc510b50bad9e1cc8648fc490f..1722a3f626f7b29b42a22fc6329ce12fb5e8ed90:/src/gtk/colordlg.cpp diff --git a/src/gtk/colordlg.cpp b/src/gtk/colordlg.cpp index b264c991ca..20bacbb9e2 100644 --- a/src/gtk/colordlg.cpp +++ b/src/gtk/colordlg.cpp @@ -41,9 +41,10 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) wxString title(_("Choose colour")); m_widget = gtk_color_selection_dialog_new(wxGTK_CONV(title)); - if (parent) + m_parent = GetParentForModalDialog(parent); + if ( m_parent ) { - GtkWindow* gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(parent->m_widget) ); + GtkWindow* gtk_parent = GTK_WINDOW( gtk_widget_get_toplevel(m_parent->m_widget) ); gtk_window_set_transient_for(GTK_WINDOW(m_widget), gtk_parent); } @@ -117,7 +118,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 +132,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); }