From ba59d40760e2a5a11bfbe2f7cf6b0e2a71b590d7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 7 Mar 2025 14:33:11 -0500 Subject: Better high-DPI handling for rest of app --- src/subway_map.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/subway_map.cpp') diff --git a/src/subway_map.cpp b/src/subway_map.cpp index c554b16..f742d12 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp @@ -50,7 +50,7 @@ SubwayMap::SubwayMap(wxWindow *parent) : wxPanel(parent, wxID_ANY) { Bind(wxEVT_LEFT_DOWN, &SubwayMap::OnMouseClick, this); Bind(wxEVT_TIMER, &SubwayMap::OnTimer, this); - zoom_slider_ = new wxSlider(this, wxID_ANY, 0, 0, 8, {15, 15}); + zoom_slider_ = new wxSlider(this, wxID_ANY, 0, 0, 8, FromDIP(wxPoint{15, 15})); zoom_slider_->Bind(wxEVT_SLIDER, &SubwayMap::OnZoomSlide, this); help_button_ = new wxButton(this, wxID_ANY, "Help"); @@ -252,6 +252,9 @@ void SubwayMap::OnPaint(wxPaintEvent &event) { SetZoomPos({zoom_x_, zoom_y_}); SetUpHelpButton(); + + zoom_slider_->SetSize(FromDIP(15), FromDIP(15), wxDefaultCoord, + wxDefaultCoord, wxSIZE_AUTO); } wxBufferedPaintDC dc(this); @@ -620,6 +623,8 @@ void SubwayMap::Redraw() { } void SubwayMap::SetUpHelpButton() { + help_button_->SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, + wxDefaultCoord, wxSIZE_AUTO); help_button_->SetPosition({ GetSize().GetWidth() - help_button_->GetSize().GetWidth() - 15, 15, -- cgit 1.4.1