diff options
Diffstat (limited to 'src/report_popup.cpp')
-rw-r--r-- | src/report_popup.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/report_popup.cpp b/src/report_popup.cpp index 74216c3..cf5b086 100644 --- a/src/report_popup.cpp +++ b/src/report_popup.cpp | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <string> | 6 | #include <string> |
7 | 7 | ||
8 | #include "global.h" | 8 | #include "global.h" |
9 | #include "icons.h" | ||
9 | #include "tracker_state.h" | 10 | #include "tracker_state.h" |
10 | 11 | ||
11 | ReportPopup::ReportPopup(wxWindow* parent) | 12 | ReportPopup::ReportPopup(wxWindow* parent) |
@@ -73,7 +74,7 @@ void ReportPopup::UpdateIndicators() { | |||
73 | int cur_height = FromDIP(10); | 74 | int cur_height = FromDIP(10); |
74 | 75 | ||
75 | for (const auto& [text, obtained] : report) { | 76 | for (const auto& [text, obtained] : report) { |
76 | wxBitmap* eye_ptr = obtained ? &checked_eye_ : &unchecked_eye_; | 77 | const wxBitmap* eye_ptr = obtained ? checked_eye_ : unchecked_eye_; |
77 | 78 | ||
78 | mem_dc.DrawBitmap(*eye_ptr, wxPoint{FromDIP(10), cur_height}); | 79 | mem_dc.DrawBitmap(*eye_ptr, wxPoint{FromDIP(10), cur_height}); |
79 | 80 | ||
@@ -104,13 +105,8 @@ void ReportPopup::OnDPIChanged(wxDPIChangedEvent& event) { | |||
104 | } | 105 | } |
105 | 106 | ||
106 | void ReportPopup::LoadIcons() { | 107 | void ReportPopup::LoadIcons() { |
107 | // TODO: We do not have to read these in and scale them for every single | 108 | unchecked_eye_ = GetTheIconCache().GetIcon("assets/unchecked.png", |
108 | // popup. | 109 | FromDIP(wxSize{32, 32})); |
109 | unchecked_eye_ = | 110 | checked_eye_ = |
110 | wxBitmap(wxImage(GetAbsolutePath("assets/unchecked.png").c_str(), | 111 | GetTheIconCache().GetIcon("assets/checked.png", FromDIP(wxSize{32, 32})); |
111 | wxBITMAP_TYPE_PNG) | ||
112 | .Scale(FromDIP(32), FromDIP(32))); | ||
113 | checked_eye_ = wxBitmap( | ||
114 | wxImage(GetAbsolutePath("assets/checked.png").c_str(), wxBITMAP_TYPE_PNG) | ||
115 | .Scale(FromDIP(32), FromDIP(32))); | ||
116 | } | 112 | } |