Properly format code.

This commit is contained in:
Marcus Kellerman 2023-02-27 17:59:43 -08:00
parent 2d758dfd96
commit 570757fd6f

View file

@ -46,7 +46,7 @@ SMasterWorkspaceData* CHyprMasterLayout::getMasterWorkspaceData(const int& ws) {
PWORKSPACEDATA->orientation = ORIENTATION_RIGHT; PWORKSPACEDATA->orientation = ORIENTATION_RIGHT;
} else if (*orientation == "bottom") { } else if (*orientation == "bottom") {
PWORKSPACEDATA->orientation = ORIENTATION_BOTTOM; PWORKSPACEDATA->orientation = ORIENTATION_BOTTOM;
} else if (*orientation == "left"){ } else if (*orientation == "left") {
PWORKSPACEDATA->orientation = ORIENTATION_LEFT; PWORKSPACEDATA->orientation = ORIENTATION_LEFT;
} else { } else {
PWORKSPACEDATA->orientation = ORIENTATION_CENTER; PWORKSPACEDATA->orientation = ORIENTATION_CENTER;
@ -58,7 +58,6 @@ std::string CHyprMasterLayout::getLayoutName() {
return "Master"; return "Master";
} }
SMasterNodeData* CHyprMasterLayout::getMasterNodeOnWorkspace(const int& ws) { SMasterNodeData* CHyprMasterLayout::getMasterNodeOnWorkspace(const int& ws) {
for (auto& n : m_lMasterNodesData) { for (auto& n : m_lMasterNodesData) {
if (n.isMaster && n.workspaceID == ws) if (n.isMaster && n.workspaceID == ws)
@ -224,7 +223,6 @@ void CHyprMasterLayout::recalculateMonitor(const int& monid) {
calculateWorkspace(PWORKSPACE->m_iID); calculateWorkspace(PWORKSPACE->m_iID);
} }
eOrientation CHyprMasterLayout::getOrientation(const int& ws) { eOrientation CHyprMasterLayout::getOrientation(const int& ws) {
auto orientation = ORIENTATION_LEFT; auto orientation = ORIENTATION_LEFT;
@ -238,7 +236,7 @@ eOrientation CHyprMasterLayout::getOrientation(const int& ws) {
orientation = PWORKSPACEDATA->orientation; orientation = PWORKSPACEDATA->orientation;
static auto* const ALWAYSCENTER = &g_pConfigManager->getConfigValuePtr("master:always_center_master")->intValue; static auto* const ALWAYSCENTER = &g_pConfigManager->getConfigValuePtr("master:always_center_master")->intValue;
if (orientation == ORIENTATION_CENTER) { if (orientation == ORIENTATION_CENTER) {
if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && (*ALWAYSCENTER==0)) { if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && (*ALWAYSCENTER == 0)) {
orientation = ORIENTATION_LEFT; orientation = ORIENTATION_LEFT;
} }
} }
@ -419,7 +417,7 @@ void CHyprMasterLayout::calculateWorkspace(const int& ws) {
heightLeft = heightLeftL; heightLeft = heightLeftL;
slavesLeft = slavesLeftL; slavesLeft = slavesLeftL;
} else { } else {
nd.position = PMONITOR->vecReservedTopLeft + PMONITOR->vecPosition + Vector2D(WIDTH+PMASTERNODE->size.x, nextYR); nd.position = PMONITOR->vecReservedTopLeft + PMONITOR->vecPosition + Vector2D(WIDTH + PMASTERNODE->size.x, nextYR);
heightLeft = heightLeftR; heightLeft = heightLeftR;
slavesLeft = slavesLeftR; slavesLeft = slavesLeftR;
} }
@ -600,8 +598,7 @@ void CHyprMasterLayout::resizeActiveWindow(const Vector2D& pixResize, CWindow* p
(PMONITOR->vecSize.y - PMONITOR->vecReservedTopLeft.y - PMONITOR->vecReservedBottomRight.y) / getMastersOnWorkspace(PNODE->workspaceID); (PMONITOR->vecSize.y - PMONITOR->vecReservedTopLeft.y - PMONITOR->vecReservedBottomRight.y) / getMastersOnWorkspace(PNODE->workspaceID);
PNODE->percSize = std::clamp(PNODE->percSize + RESIZEDELTA / SIZE, 0.05, 1.95); PNODE->percSize = std::clamp(PNODE->percSize + RESIZEDELTA / SIZE, 0.05, 1.95);
} else if (!PNODE->isMaster && SNODES > 1) { } else if (!PNODE->isMaster && SNODES > 1) {
const auto SIZE = orientation % 2 == 1 ? const auto SIZE = orientation % 2 == 1 ? (PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x) / SNODES :
(PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x) / SNODES :
(PMONITOR->vecSize.y - PMONITOR->vecReservedTopLeft.y - PMONITOR->vecReservedBottomRight.y) / SNODES; (PMONITOR->vecSize.y - PMONITOR->vecReservedTopLeft.y - PMONITOR->vecReservedBottomRight.y) / SNODES;
PNODE->percSize = std::clamp(PNODE->percSize + RESIZEDELTA / SIZE, 0.05, 1.95); PNODE->percSize = std::clamp(PNODE->percSize + RESIZEDELTA / SIZE, 0.05, 1.95);
} }