Skip to content

Commit

Permalink
Fix HiDPI +/- buttons in properties on Windows
Browse files Browse the repository at this point in the history
Fix size to respect HiDPI scaling, instead of being tiny, and also
slightly adjust spacing around the buttons to look better.
  • Loading branch information
vslavik committed Jan 26, 2017
1 parent d9bdb78 commit de9eb87
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/propertiesdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit de9eb87

Please sign in to comment.