Use more native appearance in the generic wxInfoBar implementation.
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
This commit is contained in:
@@ -78,19 +78,18 @@ bool wxInfoBarGeneric::Create(wxWindow *parent, wxWindowID winid)
|
|||||||
// the icon is not shown unless it's assigned a valid bitmap
|
// the icon is not shown unless it's assigned a valid bitmap
|
||||||
m_icon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap);
|
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 = new wxStaticText(this, wxID_ANY, "");
|
||||||
m_text->SetFont(m_text->GetFont().Bold().Larger());
|
|
||||||
|
|
||||||
m_button = new wxBitmapButton
|
m_button = new wxBitmapButton
|
||||||
(
|
(
|
||||||
this,
|
this,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
wxArtProvider::GetBitmap(wxART_CROSS_MARK),
|
wxArtProvider::GetBitmap(wxART_CLOSE, wxART_MENU),
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxBORDER_NONE
|
wxBORDER_NONE
|
||||||
);
|
);
|
||||||
|
m_button->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
|
||||||
m_button->SetToolTip(_("Hide this notification message."));
|
m_button->SetToolTip(_("Hide this notification message."));
|
||||||
|
|
||||||
// center the text inside the sizer with an icon to the left of it and a
|
// 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
|
// NB: AddButton() relies on the button being the last control in the sizer
|
||||||
// and being preceded by a spacer
|
// and being preceded by a spacer
|
||||||
wxSizer * const sizer = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer * const sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
sizer->Add(m_icon, wxSizerFlags().Centre().Border());
|
||||||
|
sizer->Add(m_text, wxSizerFlags().Centre());
|
||||||
sizer->AddStretchSpacer();
|
sizer->AddStretchSpacer();
|
||||||
sizer->Add(m_icon, wxSizerFlags().Centre().DoubleBorder());
|
sizer->Add(m_button, wxSizerFlags().Centre().Border());
|
||||||
sizer->Add(m_text, wxSizerFlags().Centre().DoubleBorder());
|
|
||||||
sizer->AddStretchSpacer();
|
|
||||||
sizer->Add(m_button, wxSizerFlags().Centre().DoubleBorder());
|
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -219,7 +217,9 @@ void wxInfoBarGeneric::ShowMessage(const wxString& msg, int flags)
|
|||||||
}
|
}
|
||||||
else // do show an icon
|
else // do show an icon
|
||||||
{
|
{
|
||||||
m_icon->SetBitmap(wxArtProvider::GetMessageBoxIcon(icon));
|
m_icon->SetBitmap(wxArtProvider::GetBitmap(
|
||||||
|
wxArtProvider::GetMessageBoxIconId(flags),
|
||||||
|
wxART_MENU));
|
||||||
m_icon->Show();
|
m_icon->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user