Skip to content

Commit

Permalink
Make the setting of status bar field width DPI aware also on DPI chan…
Browse files Browse the repository at this point in the history
…ge (#588)
  • Loading branch information
tobiolo authored Jan 9, 2024
1 parent 241c61a commit 8d8e354
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/myframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,7 @@ struct MyFrame : wxFrame {
wxStatusBar *sb = CreateStatusBar(4);
sb->SetOwnBackgroundColour(toolbgcol);
SetStatusBarPane(0);
int swidths[] = {-1, FromDIP(200), FromDIP(120), FromDIP(100)};
SetStatusWidths(4, swidths);
SetDPIAwareStatusWidths();
}

nb = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
Expand Down Expand Up @@ -1113,6 +1112,11 @@ struct MyFrame : wxFrame {
ScaleBitmap(foldicon, FromDIP(1.0) / 3.0, foldicon);
}

void SetDPIAwareStatusWidths() {
int swidths[] = {-1, FromDIP(200), FromDIP(120), FromDIP(100)};
SetStatusWidths(4, swidths);
}

void OnDPIChanged(wxDPIChangedEvent &dce) {
{ // block all other events until we finished preparing
wxEventBlocker blocker(this);
Expand All @@ -1137,6 +1141,7 @@ struct MyFrame : wxFrame {
nb->SetTabCtrlHeight(-1);
}
idd->FillBitmapVector(imagepath);
if (GetStatusBar()) SetDPIAwareStatusWidths();
}
}

Expand Down

0 comments on commit 8d8e354

Please sign in to comment.