Skip to content

Commit

Permalink
Zoom menu gets a checkmark (#1099)
Browse files Browse the repository at this point in the history
Shoudl have done this when fixing clap first but make it a separate
commit. Closes #1094
  • Loading branch information
baconpaul authored Aug 13, 2024
1 parent 6d3efc7 commit dffbfda
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src-ui/components/SCXTEditorMenus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ void SCXTEditor::addZoomMenu(juce::PopupMenu &p, bool addTitle)
}
for (auto v : {75, 100, 125, 150, 200})
{
p.addItem(juce::String(v) + "%", [w = juce::Component::SafePointer(this), v]() {
if (w)
w->setZoomFactor(v * 0.01);
});
bool checked = (std::fabs(zoomFactor * 100 - v) < 1);
p.addItem(juce::String(v) + "%", true, checked,
[w = juce::Component::SafePointer(this), v]() {
if (w)
w->setZoomFactor(v * 0.01);
});
}

auto r = juce::PopupMenu();
Expand Down

0 comments on commit dffbfda

Please sign in to comment.