Skip to content

Commit f0db6d4

Browse files
committed
Add force order front toggle
1 parent 6b13a60 commit f0db6d4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Core/Sources/Preferences/Keys.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ public struct UserDefaultPreferenceKeys {
124124
public var hideCommonPrecedingSpacesInSuggestion: HideCommonPrecedingSpacesInSuggestion {
125125
.init()
126126
}
127+
128+
public struct ForceOrderWidgetToFront: UserDefaultPreferenceKey {
129+
public let defaultValue = false
130+
public let key = "ForceOrderWidgetToFront"
131+
}
132+
133+
public var forceOrderWidgetToFront: HideCommonPrecedingSpacesInSuggestion {
134+
.init()
135+
}
127136

128137
public var disableLazyVStack: FeatureFlags.DisableLazyVStack { .init() }
129138
}

Core/Sources/SuggestionWidget/WidgetView.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ struct WidgetContextMenu: View {
9494
@AppStorage(\.realtimeSuggestionToggle) var realtimeSuggestionToggle
9595
@AppStorage(\.acceptSuggestionWithAccessibilityAPI) var acceptSuggestionWithAccessibilityAPI
9696
@AppStorage(\.hideCommonPrecedingSpacesInSuggestion) var hideCommonPrecedingSpacesInSuggestion
97+
@AppStorage(\.forceOrderWidgetToFront) var forceOrderWidgetToFront
9798

9899
var body: some View {
99100
Group {
@@ -133,6 +134,15 @@ struct WidgetContextMenu: View {
133134
}
134135
})
135136

137+
Button(action: {
138+
forceOrderWidgetToFront.toggle()
139+
}, label: {
140+
Text("Force Order Widget to Front")
141+
if forceOrderWidgetToFront {
142+
Image(systemName: "checkmark")
143+
}
144+
})
145+
136146
Divider()
137147

138148
Button(action: {

0 commit comments

Comments
 (0)