Force all title controls on one side.
This commit is contained in:
parent
d805dca4c7
commit
ad334fe450
1 changed files with 17 additions and 0 deletions
|
|
@ -170,6 +170,23 @@ void TitleControls::updateControlsPosition() {
|
|||
const auto controlsLayout = TitleControlsLayout();
|
||||
auto controlsLeft = controlsLayout.left;
|
||||
auto controlsRight = controlsLayout.right;
|
||||
const auto moveFromTo = [&](auto &from, auto &to) {
|
||||
for (const auto control : from) {
|
||||
if (!ranges::contains(to, control)) {
|
||||
to.push_back(control);
|
||||
}
|
||||
}
|
||||
from.clear();
|
||||
};
|
||||
if (ranges::contains(controlsLeft, Control::Close)) {
|
||||
moveFromTo(controlsRight, controlsLeft);
|
||||
} else if (ranges::contains(controlsRight, Control::Close)) {
|
||||
moveFromTo(controlsLeft, controlsRight);
|
||||
} else if (controlsLeft.size() > controlsRight.size()) {
|
||||
moveFromTo(controlsRight, controlsLeft);
|
||||
} else {
|
||||
moveFromTo(controlsLeft, controlsRight);
|
||||
}
|
||||
|
||||
const auto controlPresent = [&](Control control) {
|
||||
return ranges::contains(controlsLeft, control)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue