native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Center icon cell content and rebalance command columns

onevcat 00eff345 22713fe3

+15 -7
+15 -7
supacode/Features/Settings/Views/RepositorySettingsView.swift
··· 384 384 private func customCommandIconCell(_ command: UserCustomCommand) -> some View { 385 385 if let binding = bindingForCustomCommand(id: command.id) { 386 386 InlineEditableCellButton( 387 - isActive: iconPickerCommandID == command.id 387 + isActive: iconPickerCommandID == command.id, 388 + contentAlignment: .center 388 389 ) { 389 390 selectCustomCommand(command.id) 390 391 toggleIconEditor(for: command.id) ··· 408 409 iconEditorPopover(for: binding) 409 410 } 410 411 } else { 411 - InlineEditableCellButton { 412 + InlineEditableCellButton( 413 + contentAlignment: .center 414 + ) { 412 415 selectCustomCommand(command.id) 413 416 } label: { 414 417 Image(systemName: command.resolvedSystemImage) ··· 546 549 private var customCommandsHeaderRow: some View { 547 550 HStack(spacing: 8) { 548 551 customCommandHeaderCell("", width: customCommandsIconColumnWidth, alignment: .center) 549 - customCommandHeaderCell("Name") 552 + customCommandHeaderCell("Name", width: customCommandsNameColumnWidth) 550 553 customCommandHeaderCell("Command") 551 554 customCommandHeaderCell("Shortcut", width: customCommandsShortcutColumnWidth) 552 555 } ··· 563 566 customCommandRowCell(width: customCommandsIconColumnWidth, alignment: .center) { 564 567 customCommandIconCell(command) 565 568 } 566 - customCommandRowCell { 569 + customCommandRowCell(width: customCommandsNameColumnWidth) { 567 570 customCommandNameCell(command) 568 571 } 569 572 customCommandRowCell { ··· 1139 1142 1140 1143 private var customCommandsIconColumnWidth: CGFloat { 48 } 1141 1144 1142 - private var customCommandsShortcutColumnWidth: CGFloat { 180 } 1145 + private var customCommandsNameColumnWidth: CGFloat { 190 } 1146 + 1147 + private var customCommandsShortcutColumnWidth: CGFloat { 140 } 1143 1148 } 1144 1149 1145 1150 private struct InlineEditableCellButton<Label: View>: View { 1146 1151 let isActive: Bool 1147 1152 let activeColor: Color 1153 + let contentAlignment: Alignment 1148 1154 let action: () -> Void 1149 1155 @ViewBuilder let label: () -> Label 1150 1156 ··· 1153 1159 init( 1154 1160 isActive: Bool = false, 1155 1161 activeColor: Color = .accentColor, 1162 + contentAlignment: Alignment = .leading, 1156 1163 action: @escaping () -> Void, 1157 1164 @ViewBuilder label: @escaping () -> Label 1158 1165 ) { 1159 1166 self.isActive = isActive 1160 1167 self.activeColor = activeColor 1168 + self.contentAlignment = contentAlignment 1161 1169 self.action = action 1162 1170 self.label = label 1163 1171 } ··· 1165 1173 var body: some View { 1166 1174 Button(action: action) { 1167 1175 label() 1168 - .frame(maxWidth: .infinity, alignment: .leading) 1176 + .frame(maxWidth: .infinity, alignment: contentAlignment) 1169 1177 .padding(.horizontal, 8) 1170 1178 .padding(.vertical, 4) 1171 1179 .contentShape(Rectangle()) 1172 1180 } 1173 1181 .buttonStyle(.plain) 1174 - .frame(maxWidth: .infinity, alignment: .leading) 1182 + .frame(maxWidth: .infinity, alignment: contentAlignment) 1175 1183 .onHover { hovering in 1176 1184 isHovering = hovering 1177 1185 }