Browse Source

Add 150% and 250% options to "View > UI scale" menu.

tags/v2.6.3
Andrew Belt 1 month ago
parent
commit
f8df60a9e6
1 changed files with 13 additions and 4 deletions
  1. +13
    -4
      src/app/MenuBar.cpp

+ 13
- 4
src/app/MenuBar.cpp View File

@@ -422,10 +422,19 @@ struct ViewButton : MenuButton {
}
}));

menu->addChild(createIndexPtrSubmenuItem(string::translate("MenuBar.view.pixelRatio"), {
string::translate("MenuBar.view.pixelRatio.auto"),
"100%", "200%", "300%"
}, &settings::pixelRatio));
static const std::vector<float> pixelRatios = {0, 1, 1.5, 2, 2.5, 3};
std::vector<std::string> pixelRatioLabels;
for (float pixelRatio : pixelRatios) {
pixelRatioLabels.push_back(pixelRatio == 0.f ? string::translate("MenuBar.view.pixelRatio.auto") : string::f("%0.f%%", pixelRatio * 100.f));
}
menu->addChild(createIndexSubmenuItem(string::translate("MenuBar.view.pixelRatio"), pixelRatioLabels, [=]() -> size_t {
auto it = std::find(pixelRatios.begin(), pixelRatios.end(), settings::pixelRatio);
if (it == pixelRatios.end())
return -1;
return it - pixelRatios.begin();
}, [=](size_t i) {
settings::pixelRatio = pixelRatios[i];
}));

ZoomSlider* zoomSlider = new ZoomSlider;
zoomSlider->box.size.x = 250.0;


Loading…
Cancel
Save