]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/colordlg.cpp
added missing headers (patch 1774617)
[wxWidgets.git] / src / gtk / colordlg.cpp
index 4c14ef5dfc89832dfdda9ba78d6fd77022f0ab78..20bacbb9e29e9658261ac3b1bf63122f060a5856 100644 (file)
@@ -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));
 
     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);
     }
         gtk_window_set_transient_for(GTK_WINDOW(m_widget),
                                      gtk_parent);
     }
@@ -107,7 +108,7 @@ void wxColourDialog::ColourDataToDialog()
     wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors));
 
     GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel));
     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()
 }
 
 void wxColourDialog::DialogToColourData()
@@ -117,7 +118,7 @@ void wxColourDialog::DialogToColourData()
 
     GdkColor clr;
     gtk_color_selection_get_current_color(sel, &clr);
 
     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:
 
 
     // Extract custom palette:
 
@@ -131,9 +132,7 @@ void wxColourDialog::DialogToColourData()
     {
         for (int i = 0; i < wxMin(n_colors, 16); i++)
         {
     {
         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);
     }
         }
         g_free(colors);
     }