Skip to content

Commit 7fd8849

Browse files
committed
Fixed issues regarding tabbarview
Signed-off-by: Wouter01 <[email protected]>
1 parent 8362f49 commit 7fd8849

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

CodeEdit/Features/Tabs/Views/TabBarContextMenu.swift

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ struct TabBarContextMenu: ViewModifier {
3838
func body(content: Content) -> some View {
3939
content.contextMenu(menuItems: {
4040
Group {
41-
Button("Split Up") {
42-
moveToNewSplit(.top)
43-
}
44-
Button("Split Down") {
45-
moveToNewSplit(.bottom)
46-
}
47-
Button("Split Left") {
48-
moveToNewSplit(.leading)
49-
}
50-
Button("Split Right") {
51-
moveToNewSplit(.trailing)
52-
}
5341
Button("Close Tab") {
5442
withAnimation {
5543
tabs.closeTab(item: item)
@@ -121,6 +109,21 @@ struct TabBarContextMenu: ViewModifier {
121109
}
122110
.disabled(true)
123111
}
112+
113+
Divider()
114+
115+
Button("Split Up") {
116+
moveToNewSplit(.top)
117+
}
118+
Button("Split Down") {
119+
moveToNewSplit(.bottom)
120+
}
121+
Button("Split Left") {
122+
moveToNewSplit(.leading)
123+
}
124+
Button("Split Right") {
125+
moveToNewSplit(.trailing)
126+
}
124127
})
125128
}
126129

CodeEdit/Features/Tabs/Views/TabBarView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,11 @@ struct TabBarView: View {
411411
}
412412
}
413413
}
414-
414+
.background {
415+
if prefs.preferences.general.tabBarStyle == .native {
416+
TabBarAccessoryNativeBackground(dividerAt: .none)
417+
}
418+
}
415419
}
416420
// Tab bar tools (e.g. split view).
417421
trailingAccessories
@@ -464,6 +468,7 @@ struct TabBarView: View {
464468
id: \.offset
465469
) { index, tab in
466470
Button {
471+
tabManager.activeTabGroup = tabgroup
467472
tabgroup.historyOffset += index + 1
468473
} label: {
469474
HStack {
@@ -491,6 +496,7 @@ struct TabBarView: View {
491496
id: \.offset
492497
) { index, tab in
493498
Button {
499+
tabManager.activeTabGroup = tabgroup
494500
tabgroup.historyOffset -= index + 1
495501
} label: {
496502
HStack {

0 commit comments

Comments
 (0)