mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Fixed toolbar's disabled button color.
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/mstream.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/toolbar.h>
|
||||
#include <wx/utils.h>
|
||||
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
@ -75,6 +76,19 @@ wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
|
||||
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
|
||||
}
|
||||
|
||||
wxBitmap CreateDisabledButtonBitmap(const wxBitmap& original)
|
||||
{
|
||||
wxImage image = original.ConvertToImage();
|
||||
return wxBitmap(image.ConvertToDisabled(240));
|
||||
}
|
||||
|
||||
void AddToolbarButton(wxToolBar* toolbar, int toolID, const wxString& label, const wxBitmap& bitmap, const wxString& shortHelp)
|
||||
{
|
||||
// Must explicitly set the disabled button bitmap because wxWidgets
|
||||
// incorrectly desaturates it instead of lightening it.
|
||||
toolbar->AddTool(toolID, label, bitmap, WxUtils::CreateDisabledButtonBitmap(bitmap), wxITEM_NORMAL, shortHelp);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
std::string WxStrToStr(const wxString& str)
|
||||
|
Reference in New Issue
Block a user