4c52239ab0ecb500eaee58acbe8f1e03a5db3a26

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Fix tab height offset

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index 6ec06ec83d90838bb409399ffd3ea8d16cf0f825..358013abd66f1c2394ad7f15f897f2d914a0e44a 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -94,6 +94,11 @@ bool Hy3Node::operator==(const Hy3Node& rhs) const {
 6 }
 7 
 8 void Hy3Node::recalcSizePosRecursive(bool force) {
 9+	static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
10+	static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
11+	static const auto* tab_bar_height = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:bar_height")->intValue;
12+	double tab_height_offset = *gaps_in * 2 + *tab_bar_height;
13+
14 	if (this->data.type != Hy3NodeData::Group) {
15 		this->layout->applyNodeDataToWindow(this, force);
16 		return;
17@@ -111,13 +116,7 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
18 
19 		double distort_out;
20 		double distort_in;
21-		double tab_height_offset;
22-
23-		static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
24-		static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
25-		static const auto* tab_bar_height = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:bar_height")->intValue;
26 
27-		tab_height_offset = *gaps_in * 2 + *tab_bar_height;
28 
29 		if (gaps_in > gaps_out) {
30 			distort_out = *gaps_out - 1.0;
31@@ -189,8 +188,8 @@ void Hy3Node::recalcSizePosRecursive(bool force) {
32 			//child->setHidden(false);
33 			break;
34 		case Hy3GroupLayout::Tabbed:
35-			child->position.y = this->position.y + 20;
36-			child->size.y = this->size.y - 20;
37+			child->position.y = this->position.y + tab_height_offset;
38+			child->size.y = this->size.y - tab_height_offset;
39 			child->position.x = this->position.x;
40 			child->size.x = this->size.x;
41 			//child->setHidden(group->lastFocusedChild != child);