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/tracker_panel.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/tracker_panel.cpp') diff --git a/src/tracker_panel.cpp b/src/tracker_panel.cpp index 3f51cd5..81b58cc 100644 --- a/src/tracker_panel.cpp +++ b/src/tracker_panel.cpp @@ -66,9 +66,9 @@ void TrackerPanel::SetPanelsMode() { panels_mode_ = true; } void TrackerPanel::SetSavedataPath(std::string savedata_path) { if (!savedata_path_) { - wxButton *refresh_button = - new wxButton(this, wxID_ANY, "Refresh", {15, 15}); - refresh_button->Bind(wxEVT_BUTTON, &TrackerPanel::OnRefreshSavedata, this); + refresh_button_ = new wxButton(this, wxID_ANY, "Refresh"); + refresh_button_->Bind(wxEVT_BUTTON, &TrackerPanel::OnRefreshSavedata, this); + SetUpRefreshButton(); } savedata_path_ = savedata_path; @@ -97,6 +97,10 @@ void TrackerPanel::RefreshSavedata() { void TrackerPanel::OnPaint(wxPaintEvent &event) { if (GetSize() != rendered_.GetSize()) { Redraw(); + + if (refresh_button_ != nullptr) { + SetUpRefreshButton(); + } } wxBufferedPaintDC dc(this); @@ -316,3 +320,8 @@ void TrackerPanel::Redraw() { area.popup->SetPosition({popup_x, popup_y}); } } + +void TrackerPanel::SetUpRefreshButton() { + refresh_button_->SetSize(FromDIP(15), FromDIP(15), wxDefaultCoord, + wxDefaultCoord, wxSIZE_AUTO); +} -- cgit 1.4.1