From 0a3c0c6882db2976c2b6fdbebbc127747ed63703 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 19 Jan 2024 18:16:41 -0500 Subject: Area popups are now painted Instead of being a bunch of controls. This fixes the problem with the window being slow to drag around, and with items in lists disappearing. Overall W for me. --- src/tracker_panel.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/tracker_panel.cpp') diff --git a/src/tracker_panel.cpp b/src/tracker_panel.cpp index 81cb595..3102110 100644 --- a/src/tracker_panel.cpp +++ b/src/tracker_panel.cpp @@ -35,11 +35,11 @@ TrackerPanel::TrackerPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY) { } void TrackerPanel::UpdateIndicators() { - Redraw(); - for (AreaIndicator &area : areas_) { area.popup->UpdateIndicators(); } + + Redraw(); } void TrackerPanel::OnPaint(wxPaintEvent &event) { @@ -178,8 +178,10 @@ void TrackerPanel::Redraw() { int popup_y = final_y + map_area.map_y * final_width / image_size.GetWidth(); - area.popup->SetMaxSize(panel_size); - area.popup->GetSizer()->Fit(area.popup); + area.popup->SetClientSize( + area.popup->GetVirtualSize().GetWidth(), + std::min(panel_size.GetHeight(), + area.popup->GetVirtualSize().GetHeight())); if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) { popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth(); -- cgit 1.4.1