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:
thejch 2024-04-12 17:54:18 -07:00 committed by GitHub
parent 0c513ba91b
commit 34396f55a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 13 deletions

View File

@ -1285,19 +1285,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
} else if (command == "orientationcycle") {
runOrientationCycle(header, &vars, 1);
} else if (command == "mfact") {
if (vars.size() >= 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);
}
}
g_pKeybindManager->m_mDispatchers["splitratio"](vars[1] + " " + vars[2]);
} else if (command == "rollnext") {
const auto PWINDOW = header.pWindow;
const auto PNODE = getNodeFromWindow(PWINDOW);