mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 09:25:59 +01:00
master: change the mfact dispatcher to use splitratio (#4766)
* master layout: change the mfact dispatcher to use splitratio * add space for concat
This commit is contained in:
parent
0c513ba91b
commit
34396f55a2
1 changed files with 1 additions and 13 deletions
|
@ -1285,19 +1285,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
|
||||||
} else if (command == "orientationcycle") {
|
} else if (command == "orientationcycle") {
|
||||||
runOrientationCycle(header, &vars, 1);
|
runOrientationCycle(header, &vars, 1);
|
||||||
} else if (command == "mfact") {
|
} else if (command == "mfact") {
|
||||||
if (vars.size() >= 2) {
|
g_pKeybindManager->m_mDispatchers["splitratio"](vars[1] + " " + vars[2]);
|
||||||
float newMfact = 0;
|
|
||||||
try {
|
|
||||||
newMfact = std::stof(vars[1]);
|
|
||||||
} catch (std::exception& e) {
|
|
||||||
Debug::log(ERR, "Argument is invalid: {}", e.what());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
for (auto& nd : m_lMasterNodesData) {
|
|
||||||
if (nd.isMaster)
|
|
||||||
nd.percMaster = std::clamp(newMfact, 0.05f, 0.95f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (command == "rollnext") {
|
} else if (command == "rollnext") {
|
||||||
const auto PWINDOW = header.pWindow;
|
const auto PWINDOW = header.pWindow;
|
||||||
const auto PNODE = getNodeFromWindow(PWINDOW);
|
const auto PNODE = getNodeFromWindow(PWINDOW);
|
||||||
|
|
Loading…
Reference in a new issue