]> git.saurik.com Git - wxWidgets.git/commitdiff
add support for alpha in color dialog on OSX, see #14127
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 10 Mar 2013 20:36:22 +0000 (20:36 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 10 Mar 2013 20:36:22 +0000 (20:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/colordlgosx.mm

index d60418311cfab27d5264c6276de334d52c4b3aed..a8649d14c7c2a704f632756a9738308bd8c5610c 100644 (file)
@@ -111,7 +111,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
             [NSColor colorWithCalibratedRed:(CGFloat) (m_colourData.GetColour().Red() / 255.0)
                                         green:(CGFloat) (m_colourData.GetColour().Green() / 255.0)
                                         blue:(CGFloat) (m_colourData.GetColour().Blue() / 255.0)
-                                        alpha:(CGFloat) 1.0]
+                                        alpha:(CGFloat) (m_colourData.GetColour().Alpha() / 255.0)]
         ];
     else
         [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]];
@@ -167,8 +167,9 @@ int wxColourDialog::ShowModal()
     m_colourData.GetColour().Set(
                                 (unsigned char) ([theColor redComponent] * 255.0),
                                 (unsigned char) ([theColor greenComponent] * 255.0),
-                                (unsigned char) ([theColor blueComponent] * 255.0)
-                                   );
+                                (unsigned char) ([theColor blueComponent] * 255.0),
+                                (unsigned char) ([theColor alphaComponent] * 255.0)
+                                 );
 
     //Release the pool, we're done :)
     [thePool release];