about summary refs log tree commit diff stats
path: root/src/area_popup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/area_popup.cpp')
-rw-r--r--src/area_popup.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/area_popup.cpp b/src/area_popup.cpp index aabf20b..9cc1208 100644 --- a/src/area_popup.cpp +++ b/src/area_popup.cpp
@@ -7,6 +7,7 @@
7#include "ap_state.h" 7#include "ap_state.h"
8#include "game_data.h" 8#include "game_data.h"
9#include "global.h" 9#include "global.h"
10#include "icons.h"
10#include "tracker_config.h" 11#include "tracker_config.h"
11#include "tracker_panel.h" 12#include "tracker_panel.h"
12#include "tracker_state.h" 13#include "tracker_state.h"
@@ -129,7 +130,7 @@ void AreaPopup::UpdateIndicators() {
129 (location.hunt && AP_HasCheckedHuntPanel(location.ap_location_id)); 130 (location.hunt && AP_HasCheckedHuntPanel(location.ap_location_id));
130 } 131 }
131 132
132 wxBitmap* eye_ptr = checked ? &checked_eye_ : &unchecked_eye_; 133 const wxBitmap* eye_ptr = checked ? checked_eye_ : unchecked_eye_;
133 134
134 mem_dc.DrawBitmap(*eye_ptr, {FromDIP(10), cur_height}); 135 mem_dc.DrawBitmap(*eye_ptr, {FromDIP(10), cur_height});
135 136
@@ -155,7 +156,7 @@ void AreaPopup::UpdateIndicators() {
155 mem_dc.SetTextForeground(*text_color); 156 mem_dc.SetTextForeground(*text_color);
156 157
157 bool checked = reachable && AP_IsPaintingChecked(painting.internal_id); 158 bool checked = reachable && AP_IsPaintingChecked(painting.internal_id);
158 wxBitmap* eye_ptr = checked ? &checked_eye_ : &unchecked_eye_; 159 const wxBitmap* eye_ptr = checked ? checked_eye_ : unchecked_eye_;
159 mem_dc.DrawBitmap(*eye_ptr, {FromDIP(10), cur_height}); 160 mem_dc.DrawBitmap(*eye_ptr, {FromDIP(10), cur_height});
160 161
161 wxSize item_extent = mem_dc.GetTextExtent(painting.display_name); 162 wxSize item_extent = mem_dc.GetTextExtent(painting.display_name);
@@ -182,13 +183,8 @@ void AreaPopup::OnDPIChanged(wxDPIChangedEvent& event) {
182} 183}
183 184
184void AreaPopup::LoadIcons() { 185void AreaPopup::LoadIcons() {
185 // TODO: We do not have to read these in and scale them for every single 186 unchecked_eye_ = GetTheIconCache().GetIcon("assets/unchecked.png",
186 // popup. 187 FromDIP(wxSize{32, 32}));
187 unchecked_eye_ = 188 checked_eye_ =
188 wxBitmap(wxImage(GetAbsolutePath("assets/unchecked.png").c_str(), 189 GetTheIconCache().GetIcon("assets/checked.png", FromDIP(wxSize{32, 32}));
189 wxBITMAP_TYPE_PNG)
190 .Scale(FromDIP(32), FromDIP(32)));
191 checked_eye_ = wxBitmap(
192 wxImage(GetAbsolutePath("assets/checked.png").c_str(), wxBITMAP_TYPE_PNG)
193 .Scale(FromDIP(32), FromDIP(32)));
194} 190}