diff options
author | vaxerski <[email protected]> | 2023-03-07 14:24:04 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-03-07 14:24:10 +0000 |
commit | a85a6fa6c8ff9e51ba774cec112b408bce601451 (patch) | |
tree | 6f12069350772ee3beffcf229bba1a5f9ee9a5ea | |
parent | b11e2eaa3b4a87d004616d635e167bea29fa3dc7 (diff) | |
download | Hyprland-a85a6fa6c8ff9e51ba774cec112b408bce601451.tar.gz Hyprland-a85a6fa6c8ff9e51ba774cec112b408bce601451.zip |
Dwindle: Added default_split_ratio
-rw-r--r-- | src/config/ConfigManager.cpp | 1 | ||||
-rw-r--r-- | src/layout/DwindleLayout.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 0d183c27..84239a2e 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -124,6 +124,7 @@ void CConfigManager::setDefaultVars() { configValues["dwindle:split_width_multiplier"].floatValue = 1.0f; configValues["dwindle:no_gaps_when_only"].intValue = 0; configValues["dwindle:use_active_for_splits"].intValue = 1; + configValues["dwindle:default_split_ratio"].floatValue = 1.f; configValues["master:special_scale_factor"].floatValue = 0.8f; configValues["master:mfact"].floatValue = 0.55f; diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 513969d5..37a7bf81 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -219,7 +219,8 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) { const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); - static auto* const PUSEACTIVE = &g_pConfigManager->getConfigValuePtr("dwindle:use_active_for_splits")->intValue; + static auto* const PUSEACTIVE = &g_pConfigManager->getConfigValuePtr("dwindle:use_active_for_splits")->intValue; + static auto* const PDEFAULTSPLIT = &g_pConfigManager->getConfigValuePtr("dwindle:default_split_ratio")->floatValue; // Populate the node with our window's data PNODE->workspaceID = pWindow->m_iWorkspaceID; @@ -317,6 +318,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) { NEWPARENT->workspaceID = OPENINGON->workspaceID; NEWPARENT->pParent = OPENINGON->pParent; NEWPARENT->isNode = true; // it is a node + NEWPARENT->splitRatio = std::clamp(*PDEFAULTSPLIT, 0.1f, 1.9f); const auto PWIDTHMULTIPLIER = &g_pConfigManager->getConfigValuePtr("dwindle:split_width_multiplier")->floatValue; |