Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ expect rough edges until 1.0.
## [Unreleased]

### Changed
- **The popover is shorter: settings below DPI collapse.** Polling rate, Lighting, Power
Management, Buttons and Profiles are now compact cards of one row each, each showing
its current value ("1000 Hz", "Static · 80%", the active profile). Click a row to open its
controls in place; open as many as you like, and the popover remembers which. Battery and DPI
stay open at the top, since they're what you check most. The battery and lighting tips now
appear only inside their open section, not on the main page all the time.

- **The popover behaves more like a native Mac panel.** Esc on a sub-page (Colour, Buttons,
Battery Usage, Profiles, What's New) now goes back one level instead of closing the whole
popover, and every sub-page uses the same Back button, What's New included. ⌘R refreshes and
Expand Down
14 changes: 11 additions & 3 deletions Sources/MacRazer/CardComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ import SwiftUI
/// Control-Center-style tile: a rounded, lightly-frosted card on the dark popover. Shared by
/// every popover sub-page so the card style can't drift between them.
func card<Content: View>(@ViewBuilder _ content: () -> Content) -> some View {
content()
cardSurface(content()
.padding(12)
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.primary.opacity(0.10), in: RoundedRectangle(cornerRadius: 13))
.frame(maxWidth: .infinity, alignment: .leading))
}

/// The card's fill and shape without its padding, for cards that lay out their own insets (the
/// popover's expandable section rows).
///
/// A free function like `card`, not a `View` extension: an extension method is main-actor
/// isolated, and `card` (nonisolated) couldn't call it under Swift 6 concurrency checking.
func cardSurface<Content: View>(_ content: Content) -> some View {
content.background(Color.primary.opacity(0.10), in: RoundedRectangle(cornerRadius: 13))
}

/// A card with a small uppercase heading — the window-sized counterpart to `card`, shared by
Expand Down
Loading
Loading