about summary refs log tree commit diff stats
path: root/src/tracker_panel.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-03-07 14:33:11 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2025-03-07 14:33:11 -0500
commitba59d40760e2a5a11bfbe2f7cf6b0e2a71b590d7 (patch)
treeb261336945f9f9a5c5c33d5160a039445ba297ea /src/tracker_panel.cpp
parentc3849f011be0ecfbf359a163e5e2423272c0c3d0 (diff)
downloadlingo-ap-tracker-ba59d40760e2a5a11bfbe2f7cf6b0e2a71b590d7.tar.gz
lingo-ap-tracker-ba59d40760e2a5a11bfbe2f7cf6b0e2a71b590d7.tar.bz2
lingo-ap-tracker-ba59d40760e2a5a11bfbe2f7cf6b0e2a71b590d7.zip
Better high-DPI handling for rest of app
Diffstat (limited to 'src/tracker_panel.cpp')
-rw-r--r--src/tracker_panel.cpp15
1 files changed, 12 insertions, 3 deletions
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; }
66 66
67void TrackerPanel::SetSavedataPath(std::string savedata_path) { 67void TrackerPanel::SetSavedataPath(std::string savedata_path) {
68 if (!savedata_path_) { 68 if (!savedata_path_) {
69 wxButton *refresh_button = 69 refresh_button_ = new wxButton(this, wxID_ANY, "Refresh");
70 new wxButton(this, wxID_ANY, "Refresh", {15, 15}); 70 refresh_button_->Bind(wxEVT_BUTTON, &TrackerPanel::OnRefreshSavedata, this);
71 refresh_button->Bind(wxEVT_BUTTON, &TrackerPanel::OnRefreshSavedata, this); 71 SetUpRefreshButton();
72 } 72 }
73 73
74 savedata_path_ = savedata_path; 74 savedata_path_ = savedata_path;
@@ -97,6 +97,10 @@ void TrackerPanel::RefreshSavedata() {
97void TrackerPanel::OnPaint(wxPaintEvent &event) { 97void TrackerPanel::OnPaint(wxPaintEvent &event) {
98 if (GetSize() != rendered_.GetSize()) { 98 if (GetSize() != rendered_.GetSize()) {
99 Redraw(); 99 Redraw();
100
101 if (refresh_button_ != nullptr) {
102 SetUpRefreshButton();
103 }
100 } 104 }
101 105
102 wxBufferedPaintDC dc(this); 106 wxBufferedPaintDC dc(this);
@@ -316,3 +320,8 @@ void TrackerPanel::Redraw() {
316 area.popup->SetPosition({popup_x, popup_y}); 320 area.popup->SetPosition({popup_x, popup_y});
317 } 321 }
318} 322}
323
324void TrackerPanel::SetUpRefreshButton() {
325 refresh_button_->SetSize(FromDIP(15), FromDIP(15), wxDefaultCoord,
326 wxDefaultCoord, wxSIZE_AUTO);
327}