Better handling of multi-monitor scaling.
This commit is contained in:
parent
65552df6ce
commit
0e2a4e3f15
|
@ -39,10 +39,11 @@ SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& a
|
||||||
{
|
{
|
||||||
if( aSize == wxDefaultSize )
|
if( aSize == wxDefaultSize )
|
||||||
{
|
{
|
||||||
wxSize defaultSize = wxButton::GetDefaultSize();
|
wxSize defaultSize = wxButton::GetDefaultSize( aParent );
|
||||||
|
|
||||||
wxSize textSize = GetTextExtent( m_label );
|
wxSize textSize = GetTextExtent( m_label );
|
||||||
SetMinSize( wxSize( textSize.GetWidth(), defaultSize.GetHeight() + 1 ) );
|
SetMinSize( wxSize( std::max( textSize.GetWidth(), defaultSize.GetWidth() + 1 ),
|
||||||
|
defaultSize.GetHeight() + 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Bind( wxEVT_PAINT, &SPLIT_BUTTON::OnPaint, this );
|
Bind( wxEVT_PAINT, &SPLIT_BUTTON::OnPaint, this );
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <widgets/std_bitmap_button.h>
|
#include <widgets/std_bitmap_button.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dcclient.h>
|
#include <wx/dcclient.h>
|
||||||
#include <wx/dcmemory.h>
|
|
||||||
#include <wx/menu.h>
|
#include <wx/menu.h>
|
||||||
#include <wx/renderer.h>
|
#include <wx/renderer.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
|
@ -40,7 +39,7 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId,
|
||||||
{
|
{
|
||||||
if( aSize == wxDefaultSize )
|
if( aSize == wxDefaultSize )
|
||||||
{
|
{
|
||||||
wxSize defaultSize = wxButton::GetDefaultSize();
|
wxSize defaultSize = wxButton::GetDefaultSize( aParent );
|
||||||
|
|
||||||
SetMinSize( wxSize( defaultSize.GetWidth() + 1, defaultSize.GetHeight() + 1 ) );
|
SetMinSize( wxSize( defaultSize.GetWidth() + 1, defaultSize.GetHeight() + 1 ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue