Adjustable splitratio

This commit is contained in:
end-4 2023-01-23 20:10:10 +07:00
parent 4c1007224e
commit 7b7d0c848a
3 changed files with 10 additions and 29 deletions

View file

@ -1,19 +1,3 @@
<p align="center">
end-4/hyprland-is-great-but-i-want-xorg
</p>
<br/>
As the name suggests
While Wayland is the future
I still want Xorg
<br/>
# Stuff fixed/added so far
- Workspace animation direction
- Relative workspace switching
<p align="center">
<img src="https://i.imgur.com/LtC153m.png" />
<img src="https://github.com/vaxerski/Hypr/actions/workflows/c-cpp.yml/badge.svg" />

View file

@ -2570,7 +2570,7 @@ SMonitor* CWindowManager::getMonitorFromCoord(const Vector2D coord) {
return nullptr;
}
void CWindowManager::changeSplitRatioCurrent(std::string& dir) {
void CWindowManager::changeSplitRatioCurrent(std::string dir) {
const auto CURRENT = getWindowFromDrawable(LastWindow);
@ -2586,17 +2586,14 @@ void CWindowManager::changeSplitRatioCurrent(std::string& dir) {
return;
}
switch(dir) {
case "+":
PARENT->setSplitRatio(PARENT->getSplitRatio() + 0.05f);
break;
case "-":
PARENT->setSplitRatio(PARENT->getSplitRatio() - 0.05f);
break;
default:
PARENT->setSplitRatio(PARENT->getSplitRatio() + std::stof(dir));
// Debug::log(ERR, "changeSplitRatioCurrent called with an invalid dir!");
return;
if (dir == "+") {
PARENT->setSplitRatio(PARENT->getSplitRatio() + 0.05f);
}
else if (dir == "-") {
PARENT->setSplitRatio(PARENT->getSplitRatio() - 0.05f);
}
else {
PARENT->setSplitRatio(PARENT->getSplitRatio() + std::stof(dir));
}
PARENT->setSplitRatio(std::clamp(PARENT->getSplitRatio(), 0.1f, 1.9f));

View file

@ -153,7 +153,7 @@ public:
bool shouldBeManaged(const int&);
void changeSplitRatioCurrent(std::string& dir);
void changeSplitRatioCurrent(std::string dir);
void processCursorDeltaOnWindowResizeTiled(CWindow*, const Vector2D&);