about summary refs log tree commit diff stats
path: root/src/tracker_panel.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-01-19 18:16:41 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-01-19 18:16:41 -0500
commit0a3c0c6882db2976c2b6fdbebbc127747ed63703 (patch)
tree53d568418f3eb15c149bf7d60d93433e572fa7db /src/tracker_panel.cpp
parent402d559af2a727f106fa7fa59132b6710a5ae84e (diff)
downloadlingo-ap-tracker-0a3c0c6882db2976c2b6fdbebbc127747ed63703.tar.gz
lingo-ap-tracker-0a3c0c6882db2976c2b6fdbebbc127747ed63703.tar.bz2
lingo-ap-tracker-0a3c0c6882db2976c2b6fdbebbc127747ed63703.zip
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.
Diffstat (limited to 'src/tracker_panel.cpp')
-rw-r--r--src/tracker_panel.cpp10
1 files changed, 6 insertions, 4 deletions
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) {
35} 35}
36 36
37void TrackerPanel::UpdateIndicators() { 37void TrackerPanel::UpdateIndicators() {
38 Redraw();
39
40 for (AreaIndicator &area : areas_) { 38 for (AreaIndicator &area : areas_) {
41 area.popup->UpdateIndicators(); 39 area.popup->UpdateIndicators();
42 } 40 }
41
42 Redraw();
43} 43}
44 44
45void TrackerPanel::OnPaint(wxPaintEvent &event) { 45void TrackerPanel::OnPaint(wxPaintEvent &event) {
@@ -178,8 +178,10 @@ void TrackerPanel::Redraw() {
178 int popup_y = 178 int popup_y =
179 final_y + map_area.map_y * final_width / image_size.GetWidth(); 179 final_y + map_area.map_y * final_width / image_size.GetWidth();
180 180
181 area.popup->SetMaxSize(panel_size); 181 area.popup->SetClientSize(
182 area.popup->GetSizer()->Fit(area.popup); 182 area.popup->GetVirtualSize().GetWidth(),
183 std::min(panel_size.GetHeight(),
184 area.popup->GetVirtualSize().GetHeight()));
183 185
184 if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) { 186 if (popup_x + area.popup->GetSize().GetWidth() > panel_size.GetWidth()) {
185 popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth(); 187 popup_x = panel_size.GetWidth() - area.popup->GetSize().GetWidth();