From ae499287c6df77b791cced4a97a4d2ed45a5d370 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Fri, 30 Aug 2024 17:40:44 -0500 Subject: [PATCH] Revert "De-duplicate code (#511)" This reverts commit 2dbc174ecf9186898dfbc59b28e01dff369c8f20. --- src/myframe.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/myframe.h b/src/myframe.h index fa4bbe48..3c830d14 100755 --- a/src/myframe.h +++ b/src/myframe.h @@ -180,9 +180,12 @@ struct MyFrame : wxFrame { icons.AddIcon(iconbig); SetIcons(icons); - RenderFolderIcon(); + wxImage foldiconi; line_nw.LoadFile(GetDataPath(L"images/render/line_nw.png"), wxBITMAP_TYPE_PNG); line_sw.LoadFile(GetDataPath(L"images/render/line_sw.png"), wxBITMAP_TYPE_PNG); + foldiconi.LoadFile(GetDataPath(L"images/nuvola/fold.png")); + foldicon = wxBitmap(foldiconi); + ScaleBitmap(foldicon, FromDIP(1.0) / 3.0, foldicon); if (sys->singletray) tbi.Connect(wxID_ANY, wxEVT_TASKBAR_LEFT_UP, @@ -1136,13 +1139,6 @@ struct MyFrame : wxFrame { ReFocus(); } - void RenderFolderIcon() { - wxImage foldiconi; - foldiconi.LoadFile(GetDataPath(L"images/nuvola/fold.png")); - foldicon = wxBitmap(foldiconi); - ScaleBitmap(foldicon, FromDIP(1.0) / 3.0, foldicon); - } - void OnDPIChanged(wxDPIChangedEvent &dce) { { // block all other events until we finished preparing wxEventBlocker blocker(this); @@ -1157,7 +1153,10 @@ struct MyFrame : wxFrame { }, sys->imagelist[i]); } } // wait until all tasks are finished - RenderFolderIcon(); + wxImage foldiconi; + foldiconi.LoadFile(GetDataPath(L"images/nuvola/fold.png")); + foldicon = wxBitmap(foldiconi); + ScaleBitmap(foldicon, FromDIP(1.0) / 3.0, foldicon); if (nb) { loop(i, nb->GetPageCount()) { TSCanvas *p = (TSCanvas *)nb->GetPage(i);