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
2 changes: 1 addition & 1 deletion Loop/Settings Window/Loop/AboutConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ struct AboutConfigurationView: View {
LuminareToggle(isOn: $automaticallyUpdate) {
Text("Automatically install updates")
.padding(.trailing, automaticallyUpdate ? 4 : 0)
.luminarePopover(attachedTo: .topTrailing, hidden: !automaticallyUpdate) {
.luminareToolTip(attachedTo: .topTrailing, hidden: !automaticallyUpdate) {
Text("Updates will only be installed when \(Bundle.main.appName) is in the background.")
.padding(6)
}
Expand Down
2 changes: 1 addition & 1 deletion Loop/Settings Window/Loop/AdvancedConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct AdvancedConfigurationView: View {
LuminareToggle(isOn: $animateWindowResizes) {
Text("Animate window resize")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing, hidden: !showLowPowerModeWarning) {
.luminareToolTip(attachedTo: .topTrailing, hidden: !showLowPowerModeWarning) {
HStack(spacing: 4) {
Text("To save power, window animations are\nunavailable in Low Power Mode.")
.multilineTextAlignment(.leading)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct BehaviorConfigurationView: View {
if SystemWindowManager.MoveAndResize.snappingEnabled {
Text("Enable window snapping")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing) {
.luminareToolTip(attachedTo: .topTrailing) {
Text("macOS's \"Tile by dragging windows to screen edges\" feature is currently\nenabled, which will conflict with Loop's window snapping functionality.")
.padding(6)
}
Expand All @@ -130,7 +130,7 @@ struct BehaviorConfigurationView: View {
LuminareToggle(isOn: $suppressMissionControlOnTopDrag) {
Text("Suppress Mission Control")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing) {
.luminareToolTip(attachedTo: .topTrailing) {
Text("Whether to allow Mission Control to open when windows\nare dragged to the top of the screen.")
.padding(6)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ struct PaddingConfigurationView: View {
) {
Text("External bar", comment: "Label for a slider in Loop’s padding settings")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing) {
.luminareToolTip(attachedTo: .topTrailing) {
Text("Use this if you are using a custom menubar.")
.padding(6)
}
Expand Down
32 changes: 18 additions & 14 deletions Loop/Settings Window/Settings/Keybinds/DirectionPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import SwiftUI

struct DirectionPickerView: View {
private let padding: CGFloat = 12

@State private var searchText = ""
@State private var searchResults: [WindowDirection] = []

Expand Down Expand Up @@ -46,24 +44,30 @@ struct DirectionPickerView: View {
$searchText,
placeholder: .init(localized: "Search for a window action", defaultValue: "Search…")
)
.padding(padding)
.padding(12)

Divider()

PickerList(
$direction,
$searchResults,
padding,
sections + [moreSection]
) { item in
HStack(spacing: 8) {
IconView(action: .init(item))

Text(item.name)
ScrollViewReader { proxy in
ScrollView(showsIndicators: false) {
PickerList(
selection: $direction,
searchResults: $searchResults,
proxy: proxy,
sections: sections + [moreSection]
) { item in
HStack(spacing: 8) {
IconView(action: .init(item))

Text(item.name)
}
.padding(.horizontal, 6)
}
.padding(8)
.luminareCornerRadius(12)
}
}
}
.frame(width: 300, height: 300)
.onAppear {
searchText = ""
computeSearchResults()
Expand Down
21 changes: 10 additions & 11 deletions Loop/Settings Window/Settings/Keybinds/KeybindItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ struct KeybindItemView: View {
.frame(maxWidth: .infinity, alignment: .trailing)
}
.padding(.horizontal, 12)
.onChange(of: isHovering) { _ in
if !isHovering {
isDirectionPickerPresented = false
}
}
.onChange(of: action.direction) { _ in
if action.direction.isCustomizable {
isConfiguringCustom = true
Expand Down Expand Up @@ -130,17 +125,21 @@ struct KeybindItemView: View {
.font(.title3)
.foregroundStyle(isHovering ? .primary : .secondary)
}
.background {
if isHovering {
.background(alignment: .leading) {
if isHovering || isDirectionPickerPresented {
Color.clear
.luminarePopup(
.frame(width: 300 - 24)
.luminarePopover(
isPresented: $isDirectionPickerPresented,
alignment: .leadingLastTextBaseline
arrowEdge: .top,
shouldHideAnchor: true,
shouldAnimate: false
) {
DirectionPickerView(
direction: $action.direction,
isInCycle: cycleIndex != nil
)
.frame(width: 300, height: 300)
}
.luminareSheetClosesOnDefocus(true)
.onChange(of: isDirectionPickerPresented) { _ in
Expand All @@ -162,7 +161,7 @@ struct KeybindItemView: View {
HStack(spacing: 6) {
keycorderSection()
.padding(.leading, 4)
.luminarePopover(attachedTo: .topLeading, hidden: !hasDuplicateKeybinds) {
.luminareToolTip(attachedTo: .topLeading, hidden: !hasDuplicateKeybinds) {
Text("There are other keybinds that conflict with this key combination.")
.padding(6)
}
Expand Down Expand Up @@ -206,7 +205,7 @@ struct KeybindItemView: View {
.fontWeight(.regular)
.lineLimit(1)
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing) {
.luminareToolTip(attachedTo: .topTrailing) {
Text(info)
.padding(6)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct KeybindsConfigurationView: View {
LuminareToggle(isOn: $cycleModeRestartEnabled) {
Text("Always start cycles from first item")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing) {
.luminareToolTip(attachedTo: .topTrailing) {
Text("By default, Loop resumes cycles from where you last left off in each window.")
.padding(6)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct CustomActionConfigurationView: View {
if let infoText = action.direction.infoText {
Text("Use macOS center", comment: "Toggle to enable macOS-style centering in custom actions")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing) {
.luminareToolTip(attachedTo: .topTrailing) {
Text(infoText)
.padding(6)
}
Expand Down
2 changes: 1 addition & 1 deletion Loop/Settings Window/Theming/IconConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ struct IconVew: View {
}

Color.clear
.luminarePopover(attachedTo: .topTrailing, hidden: !showLiquidGlassIndicator) {
.luminareToolTip(attachedTo: .topTrailing, hidden: !showLiquidGlassIndicator) {
Text("Supports macOS Tahoe’s Liquid Glass effects")
.padding(6)
}
Expand Down
2 changes: 1 addition & 1 deletion Loop/Settings Window/Theming/PreviewConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct PreviewConfigurationView: View {
) {
Text("Show preview when looping")
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing, hidden: previewVisibility) {
.luminareToolTip(attachedTo: .topTrailing, hidden: previewVisibility) {
Text("Window snapping will still use the preview.")
.padding(6)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ struct RadialMenuActionItemView: View {
}
}
.padding(.horizontal, 12)
.onChange(of: isHovering) { _ in
if !isHovering {
isPickerPresented = false
}
}
.onChange(of: action) { newAction in
externalAction = newAction

Expand All @@ -93,14 +88,18 @@ struct RadialMenuActionItemView: View {

private var label: some View {
actionIndicator
.background {
if isHovering {
.background(alignment: .leading) {
if isHovering || isPickerPresented {
Color.clear
.luminarePopup(
.frame(width: 300 - 24)
.luminarePopover(
isPresented: $isPickerPresented,
alignment: .leadingLastTextBaseline
arrowEdge: .top,
shouldHideAnchor: true,
shouldAnimate: false
) {
RadialMenuActionPickerView(selection: $action.type)
.frame(width: 300, height: 300)
}
.luminareSheetClosesOnDefocus(true)
.onChange(of: isPickerPresented) { _ in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import SwiftUI
struct RadialMenuActionPickerView: View {
@Default(.keybinds) private var keybinds

private let padding: CGFloat = 12

@State private var searchText = ""
@State private var searchResults: [RadialMenuAction.ActionType] = []

Expand Down Expand Up @@ -62,39 +60,45 @@ struct RadialMenuActionPickerView: View {
$searchText,
placeholder: .init(localized: "Search for a window action", defaultValue: "Search…")
)
.padding(padding)
.padding(12)

Divider()

PickerList(
$selection,
$searchResults,
padding,
allSections
) { item in
HStack(spacing: 8) {
if let action = item.resolvedAction {
ScrollViewReader { proxy in
ScrollView(showsIndicators: false) {
PickerList(
selection: $selection,
searchResults: $searchResults,
proxy: proxy,
sections: allSections
) { item in
HStack(spacing: 8) {
IconView(action: action)

Text(action.getName())
.fontWeight(.regular)
.lineLimit(1)
if let action = item.resolvedAction {
HStack(spacing: 8) {
IconView(action: action)

Text(action.getName())
.fontWeight(.regular)
.lineLimit(1)
}
} else {
Image(systemName: "bolt.horizontal.fill")
}

Spacer()

if item.isKeybindReference {
Image(systemName: "keyboard")
.foregroundStyle(.secondary)
}
}
} else {
Image(systemName: "bolt.horizontal.fill")
}

Spacer()

if item.isKeybindReference {
Image(systemName: "keyboard")
.foregroundStyle(.secondary)
.padding(.horizontal, 6)
}
.padding(8)
.luminareCornerRadius(12)
}
}
}
.frame(width: 300, height: 300)
.onAppear {
searchText = ""
computeSearchResults()
Expand Down
2 changes: 1 addition & 1 deletion Loop/Updater/Views/UpdateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct UpdateView: View {
Text(updater.installState.isFailure ? "Try again later" : "Remind me later")
.contentTransition(.numericText())
.padding(.trailing, 4)
.luminarePopover(attachedTo: .topTrailing, hidden: updater.installState.errorDescription == nil) {
.luminareToolTip(attachedTo: .topTrailing, hidden: updater.installState.errorDescription == nil) {
HStack(spacing: 4) {
Image(systemName: "exclamationmark.triangle.fill")
.foregroundStyle(.secondary)
Expand Down
Loading