mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 02:28:37 +00:00
refactor(macos): dedupe UI, pairing, and runtime helpers
This commit is contained in:
@@ -12,14 +12,6 @@ struct SessionMenuLabelView: View {
|
||||
private let paddingTrailing: CGFloat = 14
|
||||
private let barHeight: CGFloat = 6
|
||||
|
||||
private var primaryTextColor: Color {
|
||||
self.isHighlighted ? Color(nsColor: .selectedMenuItemTextColor) : .primary
|
||||
}
|
||||
|
||||
private var secondaryTextColor: Color {
|
||||
self.isHighlighted ? Color(nsColor: .selectedMenuItemTextColor).opacity(0.85) : .secondary
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
ContextUsageBar(
|
||||
@@ -31,7 +23,7 @@ struct SessionMenuLabelView: View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 2) {
|
||||
Text(self.row.label)
|
||||
.font(.caption.weight(self.row.key == "main" ? .semibold : .regular))
|
||||
.foregroundStyle(self.primaryTextColor)
|
||||
.foregroundStyle(MenuItemHighlightColors.primary(self.isHighlighted))
|
||||
.lineLimit(1)
|
||||
.truncationMode(.middle)
|
||||
.layoutPriority(1)
|
||||
@@ -40,14 +32,14 @@ struct SessionMenuLabelView: View {
|
||||
|
||||
Text("\(self.row.tokens.contextSummaryShort) · \(self.row.ageText)")
|
||||
.font(.caption.monospacedDigit())
|
||||
.foregroundStyle(self.secondaryTextColor)
|
||||
.foregroundStyle(MenuItemHighlightColors.secondary(self.isHighlighted))
|
||||
.lineLimit(1)
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
.layoutPriority(2)
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.caption.weight(.semibold))
|
||||
.foregroundStyle(self.secondaryTextColor)
|
||||
.foregroundStyle(MenuItemHighlightColors.secondary(self.isHighlighted))
|
||||
.padding(.leading, 2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user