diff --git a/README.md b/README.md index cf3dc62..c1eed0c 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ plugin { # disable gaps when only one window is onscreen no_gaps_when_only = + # offset from group split direction when only one window is in a group + group_inset = + # tab group settings tabs { # height of the tab bar diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 80d2d10..b9a5492 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -112,6 +112,7 @@ bool Hy3Node::operator==(const Hy3Node& rhs) const { void Hy3Node::recalcSizePosRecursive(bool force) { static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue; static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue; + static const auto* group_inset = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:group_inset")->intValue; int outer_gaps = 0; Vector2D gap_pos_offset; @@ -151,9 +152,16 @@ void Hy3Node::recalcSizePosRecursive(bool force) { switch (group->layout) { case Hy3GroupLayout::SplitH: + child->position.x = tpos.x; + child->size.x = tsize.x - *group_inset; + child->position.y = tpos.y; + child->size.y = tsize.y; + break; case Hy3GroupLayout::SplitV: - child->position = tpos; - child->size = tsize; + child->position.y = tpos.y; + child->size.y = tsize.y - *group_inset; + child->position.x = tpos.x; + child->size.x = tsize.x; break; case Hy3GroupLayout::Tabbed: child->position.y = tpos.y + tab_height_offset; diff --git a/src/main.cpp b/src/main.cpp index 8830fef..e92fac1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -113,6 +113,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { selection_hook::init(); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:no_gaps_when_only", SConfigValue{.intValue = 0}); + HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:group_inset", SConfigValue{.intValue = 10}); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:height", SConfigValue{.intValue = 15}); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:padding", SConfigValue{.intValue = 5}); HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:from_top", SConfigValue{.intValue = 0});