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;
} else if (*orientation == "bottom") {
PWORKSPACEDATA->orientation = ORIENTATION_BOTTOM;
} else if (*orientation == "left"){
} else if (*orientation == "left") {
PWORKSPACEDATA->orientation = ORIENTATION_LEFT;
} else {
PWORKSPACEDATA->orientation = ORIENTATION_CENTER;
@ -58,7 +58,6 @@ std::string CHyprMasterLayout::getLayoutName() {
return "Master";
}
SMasterNodeData* CHyprMasterLayout::getMasterNodeOnWorkspace(const int& ws) {
for (auto& n : m_lMasterNodesData) {
if (n.isMaster && n.workspaceID == ws)
@ -224,7 +223,6 @@ void CHyprMasterLayout::recalculateMonitor(const int& monid) {
calculateWorkspace(PWORKSPACE->m_iID);
}
eOrientation CHyprMasterLayout::getOrientation(const int& ws) {
auto orientation = ORIENTATION_LEFT;
@ -238,7 +236,7 @@ eOrientation CHyprMasterLayout::getOrientation(const int& ws) {
orientation = PWORKSPACEDATA->orientation;
static auto* const ALWAYSCENTER = &g_pConfigManager->getConfigValuePtr("master:always_center_master")->intValue;
if (orientation == ORIENTATION_CENTER) {
if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && (*ALWAYSCENTER==0)) {
if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && (*ALWAYSCENTER == 0)) {
orientation = ORIENTATION_LEFT;
}
}
@ -419,7 +417,7 @@ void CHyprMasterLayout::calculateWorkspace(const int& ws) {
heightLeft = heightLeftL;
slavesLeft = slavesLeftL;
} 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;
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);
PNODE->percSize = std::clamp(PNODE->percSize + RESIZEDELTA / SIZE, 0.05, 1.95);
} else if (!PNODE->isMaster && SNODES > 1) {
const auto SIZE = orientation % 2 == 1 ?
(PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x) / SNODES :
const auto SIZE = orientation % 2 == 1 ? (PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x) / SNODES :
(PMONITOR->vecSize.y - PMONITOR->vecReservedTopLeft.y - PMONITOR->vecReservedBottomRight.y) / SNODES;
PNODE->percSize = std::clamp(PNODE->percSize + RESIZEDELTA / SIZE, 0.05, 1.95);
}