0862855b8709a63cf92210f56d31a71df105e273

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

Message

Fix tab bar not being updated with group changes

Closes #27

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index 7e62cd955940a771f56d9506f87bef8ede9556b3..04a982b0edcba14cff7a7d36061d393839e5f841 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -822,6 +822,7 @@ void Hy3Layout::makeGroupOn(
 6 		if (group.children.size() == 1) {
 7 			group.setLayout(layout);
 8 			group.setEphemeral(ephemeral);
 9+			node->parent->updateTabBarRecursive();
10 			node->parent->recalcSizePosRecursive();
11 			return;
12 		}
13@@ -860,6 +861,7 @@ void Hy3Layout::changeGroupOn(Hy3Node& node, Hy3GroupLayout layout) {
14 
15 	auto& group = node.parent->data.as_group;
16 	group.setLayout(layout);
17+	node.parent->updateTabBarRecursive();
18 	node.parent->recalcSizePosRecursive();
19 }
20 
21@@ -910,6 +912,7 @@ void Hy3Layout::shiftNode(Hy3Node& node, ShiftDirection direction, bool once, bo
22 			auto* node2 = node.parent;
23 			Hy3Node::swapData(node, *node2);
24 			node2->layout->nodes.remove(node);
25+			node2->updateTabBarRecursive();
26 			node2->recalcSizePosRecursive();
27 		}
28 	} else {
29@@ -928,8 +931,8 @@ void Hy3Layout::shiftFocus(int workspace, ShiftDirection direction, bool visible
30 	auto* node = this->getWorkspaceFocusedNode(workspace);
31 	if (node == nullptr) return;
32 
33-	Hy3Node* target;
34-	if ((target = this->shiftOrGetFocus(*node, direction, false, false, visible))) {
35+	auto* target = this->shiftOrGetFocus(*node, direction, false, false, visible);
36+	if (target != nullptr) {
37 		target->focus();
38 		while (target->parent != nullptr) target = target->parent;
39 		target->recalcSizePosRecursive();
40@@ -1701,6 +1704,7 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(
41 				Hy3Node::swallowGroups(old_parent);
42 			}
43 
44+			old_parent->updateTabBarRecursive();
45 			old_parent->recalcSizePosRecursive();
46 		}
47 
48@@ -1711,6 +1715,7 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(
49 			target_parent = target_parent->parent;
50 		}
51 
52+		node.updateTabBarRecursive();
53 		node.focus();
54 
55 		if (target_parent != target_group && target_parent != nullptr)