mirror of
https://github.com/hyprwm/Hypr.git
synced 2026-05-05 06:37:59 +02:00
turns out relative workspace is already there lol
This commit is contained in:
parent
26ad632b60
commit
4c1007224e
4 changed files with 11 additions and 25 deletions
|
|
@ -213,15 +213,6 @@ void KeybindManager::changeworkspace(std::string arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void KeybindManager::changetorelativeworkspace(std::string arg) {
|
||||
if (arg == "+")
|
||||
g_pWindowManager->relativeWorkspace(1);
|
||||
if (arg == "-")
|
||||
g_pWindowManager->relativeWorkspace(-1);
|
||||
|
||||
// Debug::log(LOG, "Changing the current workspace by " + arg + "1");
|
||||
}
|
||||
|
||||
void KeybindManager::changetolastworkspace(std::string arg) {
|
||||
Debug::log(LOG, "Changing the current workspace to the last workspace");
|
||||
g_pWindowManager->changeToLastWorkspace();
|
||||
|
|
@ -287,7 +278,7 @@ void KeybindManager::toggleActiveWindowFloating(std::string arg) {
|
|||
}
|
||||
|
||||
void KeybindManager::changeSplitRatio(std::string args) {
|
||||
g_pWindowManager->changeSplitRatioCurrent(args[0]);
|
||||
g_pWindowManager->changeSplitRatioCurrent(args);
|
||||
}
|
||||
|
||||
void KeybindManager::togglePseudoActive(std::string args) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <string.h>
|
||||
#include <iostream>
|
||||
|
||||
// Default values
|
||||
void ConfigManager::init() {
|
||||
configValues["border_size"].intValue = 1;
|
||||
configValues["gaps_in"].intValue = 5;
|
||||
|
|
@ -54,7 +55,7 @@ void ConfigManager::init() {
|
|||
configValues["animations:enabled"].intValue = 0;
|
||||
configValues["animations:cheap"].intValue = 1;
|
||||
configValues["animations:borders"].intValue = 1;
|
||||
configValues["animations:workspaces"].intValue = 0;
|
||||
configValues["animations:workspaces"].intValue = 1;
|
||||
|
||||
configValues["autogenerated"].intValue = 0;
|
||||
|
||||
|
|
@ -131,7 +132,6 @@ void handleBind(const std::string& command, const std::string& value) {
|
|||
if (HANDLER == "movetoworkspace") dispatcher = KeybindManager::movetoworkspace;
|
||||
if (HANDLER == "movetorelativeworkspace") dispatcher = KeybindManager::movetorelativeworkspace;
|
||||
if (HANDLER == "workspace" || HANDLER == "ws") dispatcher = KeybindManager::changeworkspace;
|
||||
if (HANDLER == "relativeworkspace") dispatcher = KeybindManager::changetorelativeworkspace;
|
||||
if (HANDLER == "lastworkspace") dispatcher = KeybindManager::changetolastworkspace;
|
||||
if (HANDLER == "togglefloating") dispatcher = KeybindManager::toggleActiveWindowFloating;
|
||||
if (HANDLER == "splitratio") dispatcher = KeybindManager::changeSplitRatio;
|
||||
|
|
|
|||
|
|
@ -1761,12 +1761,6 @@ void CWindowManager::moveActiveFocusTo(char dir) {
|
|||
QueuedPointerWarp = Vector2D(NEIGHBOR->getPosition() + (NEIGHBOR->getSize() / 2.f));
|
||||
}
|
||||
|
||||
void CWindowManager::relativeWorkspace(int relativenum) {
|
||||
if (activeWorkspaceID + relativenum < lowerWorkspaceLimit) return;
|
||||
if (activeWorkspaceID + relativenum > upperWorkspaceLimit) return;
|
||||
changeWorkspaceByID(activeWorkspaceID + relativenum);
|
||||
}
|
||||
|
||||
void CWindowManager::changeWorkspaceByID(int ID) {
|
||||
|
||||
activeWorkspaceID = ID;
|
||||
|
|
@ -2576,7 +2570,7 @@ SMonitor* CWindowManager::getMonitorFromCoord(const Vector2D coord) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void CWindowManager::changeSplitRatioCurrent(const char& dir) {
|
||||
void CWindowManager::changeSplitRatioCurrent(std::string& dir) {
|
||||
|
||||
const auto CURRENT = getWindowFromDrawable(LastWindow);
|
||||
|
||||
|
|
@ -2593,14 +2587,15 @@ void CWindowManager::changeSplitRatioCurrent(const char& dir) {
|
|||
}
|
||||
|
||||
switch(dir) {
|
||||
case '+':
|
||||
PARENT->setSplitRatio(PARENT->getSplitRatio() + 0.1f);
|
||||
case "+":
|
||||
PARENT->setSplitRatio(PARENT->getSplitRatio() + 0.05f);
|
||||
break;
|
||||
case '-':
|
||||
PARENT->setSplitRatio(PARENT->getSplitRatio() - 0.1f);
|
||||
case "-":
|
||||
PARENT->setSplitRatio(PARENT->getSplitRatio() - 0.05f);
|
||||
break;
|
||||
default:
|
||||
Debug::log(ERR, "changeSplitRatioCurrent called with an invalid dir!");
|
||||
PARENT->setSplitRatio(PARENT->getSplitRatio() + std::stof(dir));
|
||||
// Debug::log(ERR, "changeSplitRatioCurrent called with an invalid dir!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public:
|
|||
|
||||
bool shouldBeManaged(const int&);
|
||||
|
||||
void changeSplitRatioCurrent(const char& dir);
|
||||
void changeSplitRatioCurrent(std::string& dir);
|
||||
|
||||
void processCursorDeltaOnWindowResizeTiled(CWindow*, const Vector2D&);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue