Skip to content

Commit

Permalink
Minor interface adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Oct 3, 2024
1 parent e7068e8 commit bf796b6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Ice/ControlItem/ControlItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ final class ControlItem {
continue
}
let item = NSMenuItem(
title: "\(section.isHidden ? "Show" : "Hide") the \(name.menuString) Section",
title: "\(section.isHidden ? "Show" : "Hide") the \(name.displayString) Section",
action: #selector(toggleMenuBarSection),
keyEquivalent: ""
)
Expand Down
8 changes: 5 additions & 3 deletions Ice/MenuBar/MenuBarSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ final class MenuBarSection {
case hidden
case alwaysHidden

var menuString: String {
/// A string to show in the interface.
var displayString: String {
switch self {
case .visible: "Visible"
case .hidden: "Hidden"
case .alwaysHidden: "Always Hidden"
case .alwaysHidden: "Always-Hidden"
}
}

/// A string to use for logging purposes.
var logString: String {
switch self {
case .visible: "visible section"
case .hidden: "hidden section"
case .alwaysHidden: "always hidden section"
case .alwaysHidden: "always-hidden section"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Ice/MenuBar/Search/MenuBarSearchPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,13 @@ private struct MenuBarSearchContentView: View {
private func updateDisplayedItems() {
let searchItems: [(listItem: ListItem, title: String)] = MenuBarSection.Name.allCases.reduce(into: []) { items, section in
let headerItem = ListItem.header(id: .header(section)) {
Text(section.menuString)
Text(section.displayString)
.fontWeight(.semibold)
.foregroundStyle(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.vertical, 10)
}
items.append((headerItem, section.menuString))
items.append((headerItem, section.displayString))

for item in itemManager.itemCache.managedItems(for: section).reversed() {
let listItem = ListItem.item(id: .item(item.info)) {
Expand Down
5 changes: 3 additions & 2 deletions Ice/Settings/SettingsPanes/MenuBarLayoutSettingsPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ struct MenuBarLayoutSettingsPane: View {
let section = appState.menuBarManager.section(withName: section),
section.isEnabled
{
VStack(alignment: .leading, spacing: 2) {
Text(section.name.menuString + " Section")
VStack(alignment: .leading, spacing: 4) {
Text("\(section.name.displayString) Section")
.font(.system(size: 14))
.padding(.leading, 2)

LayoutBar(section: section)
.environmentObject(appState.imageCache)
Expand Down
2 changes: 1 addition & 1 deletion Ice/UI/IceBar/IceBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private struct IceBarContentView: View {
if configuration.hasRoundedShape {
AnyInsettableShape(Capsule())
} else {
AnyInsettableShape(RoundedRectangle(cornerRadius: frame.height / 5, style: .continuous))
AnyInsettableShape(RoundedRectangle(cornerRadius: frame.height / 4, style: .continuous))
}
}

Expand Down
2 changes: 1 addition & 1 deletion Ice/UI/LayoutBar/LayoutBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ struct LayoutBar: View {

@ViewBuilder
private var roundedRectangle: some Shape {
RoundedRectangle(cornerRadius: 9, style: .circular)
RoundedRectangle(cornerRadius: 11, style: .continuous)
}
}

0 comments on commit bf796b6

Please sign in to comment.