]> git.saurik.com Git - wxWidgets.git/commitdiff
Use more native appearance in the generic wxInfoBar implementation.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 5 Oct 2009 22:55:57 +0000 (22:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 5 Oct 2009 22:55:57 +0000 (22:55 +0000)
Use default font for the text and left align it instead of centering.
Also use smaller bitmaps for the icon and the button.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/infobar.cpp

index 5e5a3432768492f3b47630557fc29549a382b0d2..ae85d5d9d5654aeeb1858fa810fb8bda77e786ba 100644 (file)
@@ -78,19 +78,18 @@ bool wxInfoBarGeneric::Create(wxWindow *parent, wxWindowID winid)
     // the icon is not shown unless it's assigned a valid bitmap
     m_icon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap);
 
-    // by default, the text uses a larger, more noticeable, font
     m_text = new wxStaticText(this, wxID_ANY, "");
-    m_text->SetFont(m_text->GetFont().Bold().Larger());
 
     m_button = new wxBitmapButton
                    (
                     this,
                     wxID_ANY,
-                    wxArtProvider::GetBitmap(wxART_CROSS_MARK),
+                    wxArtProvider::GetBitmap(wxART_CLOSE, wxART_MENU),
                     wxDefaultPosition,
                     wxDefaultSize,
                     wxBORDER_NONE
                    );
+    m_button->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
     m_button->SetToolTip(_("Hide this notification message."));
 
     // center the text inside the sizer with an icon to the left of it and a
@@ -99,11 +98,10 @@ bool wxInfoBarGeneric::Create(wxWindow *parent, wxWindowID winid)
     // NB: AddButton() relies on the button being the last control in the sizer
     //     and being preceded by a spacer
     wxSizer * const sizer = new wxBoxSizer(wxHORIZONTAL);
+    sizer->Add(m_icon, wxSizerFlags().Centre().Border());
+    sizer->Add(m_text, wxSizerFlags().Centre());
     sizer->AddStretchSpacer();
-    sizer->Add(m_icon, wxSizerFlags().Centre().DoubleBorder());
-    sizer->Add(m_text, wxSizerFlags().Centre().DoubleBorder());
-    sizer->AddStretchSpacer();
-    sizer->Add(m_button, wxSizerFlags().Centre().DoubleBorder());
+    sizer->Add(m_button, wxSizerFlags().Centre().Border());
     SetSizer(sizer);
 
     return true;
@@ -219,7 +217,9 @@ void wxInfoBarGeneric::ShowMessage(const wxString& msg, int flags)
     }
     else // do show an icon
     {
-        m_icon->SetBitmap(wxArtProvider::GetMessageBoxIcon(icon));
+        m_icon->SetBitmap(wxArtProvider::GetBitmap(
+                            wxArtProvider::GetMessageBoxIconId(flags),
+                          wxART_MENU));
         m_icon->Show();
     }