Skip to content

Commit

Permalink
fix: show project title
Browse files Browse the repository at this point in the history
  • Loading branch information
FezVrasta committed Jan 22, 2024
1 parent fc896cb commit 1b0b129
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,40 @@ struct ToolbarBranchPicker: View {
}

var body: some View {
Menu(content: {
if let sourceControlManager = workspaceFileManager?.sourceControlManager {
PopoverView(sourceControlManager: sourceControlManager)
HStack(alignment: .center, spacing: 5) {
if currentBranch != nil {
Image.checkout
.font(.title3)
.imageScale(.large)
.foregroundColor(controlActive == .inactive ? inactiveColor : .primary)
} else {
Image(systemName: "folder.fill.badge.gearshape")
.font(.title3)
.imageScale(.medium)
.foregroundColor(controlActive == .inactive ? inactiveColor : .accentColor)
}
}, label: {
HStack(alignment: .center, spacing: 5) {
if currentBranch != nil {
Image.checkout
.font(.title3)
.imageScale(.large)
.foregroundColor(controlActive == .inactive ? inactiveColor : .primary)
} else {
Image(systemName: "folder.fill.badge.gearshape")
.font(.title3)
.imageScale(.medium)
.foregroundColor(controlActive == .inactive ? inactiveColor : .accentColor)
}
VStack(alignment: .leading, spacing: 2) {
Text(title)
.font(.headline)
.foregroundColor(controlActive == .inactive ? inactiveColor : .primary)
.frame(height: 16)
.help(title)
if let currentBranch {
ZStack(alignment: .trailing) {
Text(currentBranch.name)
.padding(.trailing)
if isHovering {
Image(systemName: "chevron.down")
}
VStack(alignment: .leading, spacing: 2) {
Text(title)
.font(.headline)
.foregroundColor(controlActive == .inactive ? inactiveColor : .primary)
.frame(height: 16)
.help(title)
if let currentBranch {
Menu(content: {
if let sourceControlManager = workspaceFileManager?.sourceControlManager {
PopoverView(sourceControlManager: sourceControlManager)
}
.font(.subheadline)
.foregroundColor(controlActive == .inactive ? inactiveColor : .secondary)
.frame(height: 11)
}
}, label: {
Text(currentBranch.name)
.font(.subheadline)
.foregroundColor(controlActive == .inactive ? inactiveColor : .secondary)
.frame(height: 11)
})
.buttonStyle(.borderless)
.padding(.leading, -3)
}
}
})
}
.onHover { active in
isHovering = active
}
Expand Down

0 comments on commit 1b0b129

Please sign in to comment.