From de9eb877e7b8a0020044933e6d6afe29071461ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Thu, 26 Jan 2017 19:33:30 +0100 Subject: [PATCH] Fix HiDPI +/- buttons in properties on Windows Fix size to respect HiDPI scaling, instead of being tiny, and also slightly adjust spacing around the buttons to look better. --- src/propertiesdlg.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/propertiesdlg.cpp b/src/propertiesdlg.cpp index c2c7090508..ea0bc97265 100644 --- a/src/propertiesdlg.cpp +++ b/src/propertiesdlg.cpp @@ -269,22 +269,26 @@ class PropertiesDialog::PathsList : public wxPanel auto lbl = new wxStaticText(this, wxID_ANY, label); sizer->Add(lbl, wxSizerFlags().Expand()); m_list = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_EXTENDED); - sizer->Add(m_list, wxSizerFlags(1).Expand()); + sizer->Add(m_list, wxSizerFlags(1).Expand().BORDER_WIN(wxLEFT, 1)); #if defined(__WXOSX__) auto add = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("NSAddTemplate"), wxDefaultPosition, wxSize(18, 18), wxBORDER_SUNKEN); auto remove = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("NSRemoveTemplate"), wxDefaultPosition, wxSize(18,18), wxBORDER_SUNKEN); #elif defined(__WXMSW__) - auto add = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("list-add"), wxDefaultPosition, wxSize(19,19)); - auto remove = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("list-remove"), wxDefaultPosition, wxSize(19,19)); + auto add = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("list-add"), wxDefaultPosition, wxSize(PX(19),PX(19))); + auto remove = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("list-remove"), wxDefaultPosition, wxSize(PX(19),PX(19))); #elif defined(__WXGTK__) auto add = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("list-add"), wxDefaultPosition, wxDefaultSize, wxNO_BORDER); auto remove = new wxBitmapButton(this, wxID_ANY, wxArtProvider::GetBitmap("list-remove"), wxDefaultPosition, wxDefaultSize, wxNO_BORDER); #endif auto buttonSizer = new wxBoxSizer(wxHORIZONTAL); buttonSizer->Add(add); +#ifdef __WXOSX__ + buttonSizer->AddSpacer(PX(1)); +#endif buttonSizer->Add(remove); - sizer->Add(buttonSizer); + sizer->AddSpacer(PX(1)); + sizer->Add(buttonSizer, wxSizerFlags().BORDER_OSX(wxLEFT, PX(1))); SetDropTarget(new DropTarget(this));