Skip to content

Commit

Permalink
Revert "De-duplicate code (aardappel#511)"
Browse files Browse the repository at this point in the history
This reverts commit 2dbc174.
  • Loading branch information
arizvisa committed Aug 30, 2024
1 parent db1860f commit 13eed2c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/myframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand 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);
Expand All @@ -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);
Expand Down

0 comments on commit 13eed2c

Please sign in to comment.