Skip to content

Commit 38df50a

Browse files
committed
Update liquid glass settings
1 parent bfcae7f commit 38df50a

12 files changed

Lines changed: 183 additions & 116 deletions

File tree

Core/CommonViewsKit/Sources/CommonViewsKit/ChangeConfirmationViewModifier.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public struct ChangeConfirmationViewModifier: ViewModifier {
4141
if hasChange {
4242
Label("Unsaved", systemImage: "smallcircle.filled.circle.fill")
4343
.help("Unsaved Changes")
44+
.padding(.trailing, 8)
4445
}
4546
}
4647
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// LiquidGlass+Extension.swift
3+
// CommonViewsKit
4+
//
5+
// Created by Yusuf Tayyip Özgül on 26.02.2026.
6+
//
7+
8+
import SwiftUI
9+
10+
public extension ToolbarContent {
11+
@ToolbarContentBuilder
12+
func disableSharedBackground() -> some ToolbarContent {
13+
if #available(macOS 26.0, *) {
14+
self.sharedBackgroundVisibility(.hidden)
15+
} else {
16+
self
17+
}
18+
}
19+
}

Features/MockDetail/Sources/MockDetail/MockDetailView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public struct MockDetailView: View {
4242
.help(viewModel.editorValidationMessage ?? "")
4343
}
4444
}
45+
.disableSharedBackground()
4546

4647
ToolbarItemGroup {
4748
ToolBarButton(title: "Reload Mock", icon: "arrow.clockwise", backgroundColor: .gray) {
@@ -70,6 +71,7 @@ public struct MockDetailView: View {
7071
}
7172
.keyboardShortcut("s")
7273
}
74+
.disableSharedBackground()
7375

7476
ToolbarItem {
7577
ControlGroup {
@@ -119,6 +121,7 @@ public struct MockDetailView: View {
119121
}
120122
.controlGroupStyle(.compactMenu)
121123
}
124+
.disableSharedBackground()
122125

123126
ToolbarItem {
124127
Button {
@@ -127,6 +130,7 @@ public struct MockDetailView: View {
127130
Label("Hide Inspector", systemImage: "sidebar.trailing")
128131
}
129132
}
133+
.disableSharedBackground()
130134
}
131135
.confirmationDialog("Mock Will be Deleted, Are you sure", isPresented: $viewModel.shouldShowDeleteConfirmationAlert) {
132136
Button("Delete", role: .destructive, action: { viewModel.removeMock() })

Features/MockDetail/Sources/MockDetail/Resources/Localizable.xcstrings

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
},
1919
"Actions" : {
2020

21+
},
22+
"Append Date" : {
23+
"comment" : "A label for the date when a mock was last appended.",
24+
"isCommentAutoGenerated" : true
2125
},
2226
"Cancel" : {
2327

@@ -153,6 +157,10 @@
153157
},
154158
"The file location is not where it should be, which causes the mock to not be used as a response. You can move this mock to its required location by tap Fix." : {
155159

160+
},
161+
"Update Date" : {
162+
"comment" : "A label for the date when the mock was last updated.",
163+
"isCommentAutoGenerated" : true
156164
},
157165
"Updated Request" : {
158166

@@ -173,5 +181,5 @@
173181

174182
}
175183
},
176-
"version" : "1.0"
184+
"version" : "1.1"
177185
}

Features/MockDetail/Sources/MockDetail/Views/MockDetailEditorTypeButton.swift

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ import SwiftUI
99

1010
struct MockDetailEditorTypeButton: View {
1111
@Binding var selectedEditorType: MockDetailEditorType
12+
@State private var __selectedEditorType: MockDetailEditorType
1213
@State private var opacity: [MockDetailEditorType: Double] = [:]
14+
15+
init(selectedEditorType: Binding<MockDetailEditorType>) {
16+
self._selectedEditorType = selectedEditorType
17+
self.__selectedEditorType = selectedEditorType.wrappedValue
18+
}
1319

1420
var body: some View {
1521
HStack {
@@ -18,26 +24,24 @@ struct MockDetailEditorTypeButton: View {
1824
button(type: .requestBody)
1925
button(type: .requestHeader)
2026
}
21-
.padding()
27+
.padding(8)
2228
}
2329

2430
@ViewBuilder
2531
private func button(type: MockDetailEditorType) -> some View {
2632
Button {
2733
withAnimation {
2834
selectedEditorType = type
35+
__selectedEditorType = type
2936
}
3037
} label: {
3138
Label(type.buttonTitle, systemImage: type.buttonIcon)
3239
.frame(maxWidth: .infinity)
33-
.frame(height: 25.0)
34-
.border(Color.gray.opacity(0.2))
35-
.foregroundColor(.white)
36-
.buttonStyle(.plain)
37-
.background(selectedEditorType == type ? Color.accentColor : .secondary.opacity(opacity[type, default: 0.4]))
38-
.cornerRadius(4)
40+
.frame(height: 20.0)
41+
.foregroundStyle(.white)
3942
}
40-
.buttonStyle(.plain)
43+
.buttonStyle(.borderedProminent)
44+
.tint(__selectedEditorType == type ? Color.accentColor : .secondary.opacity(opacity[type, default: 0.4]))
4145
.onHover { hovering in
4246
opacity[type] = hovering ? 0.6 : 0.4
4347
}

Features/MockDomainConfigs/Sources/MockDomainConfigs/MockConfigurations/MockHeaderConfigurations.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,15 @@ public struct MockHeaderConfigurations: View {
147147
}
148148
}
149149
}
150+
.disableSharedBackground()
150151

151152
ToolbarItem {
152153
ToolBarButton(title: "Save", icon: "tray.and.arrow.down", backgroundColor: .blue) {
153154
viewModel.saveChanges()
154155
}
155156
.keyboardShortcut("s")
156157
}
158+
.disableSharedBackground()
157159

158160
ToolbarItem {
159161
ToolBarButton(title: "New", icon: "plus.circle", backgroundColor: .accentColor) {
@@ -164,6 +166,7 @@ public struct MockHeaderConfigurations: View {
164166
shouldShowInspectorView = true
165167
}
166168
}
169+
.disableSharedBackground()
167170

168171
ToolbarItemGroup {
169172
Button(action: { isSearchActive = true }, label: EmptyView.init)
@@ -178,6 +181,7 @@ public struct MockHeaderConfigurations: View {
178181
isSearchActive: $isSearchActive
179182
)
180183
}
184+
.disableSharedBackground()
181185

182186
ToolbarItem {
183187
Button {
@@ -186,6 +190,7 @@ public struct MockHeaderConfigurations: View {
186190
Label("Hide Inspector", systemImage: "sidebar.trailing")
187191
}
188192
}
193+
.disableSharedBackground()
189194
}
190195
.navigationBarBackButtonHidden(false)
191196
.navigationTitle("Header Configs")

Features/MockDomainConfigs/Sources/MockDomainConfigs/MockConfigurations/MockPathConfigurations.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,15 @@ public struct MockPathConfigurations: View {
114114
}
115115
}
116116
}
117+
.disableSharedBackground()
117118

118119
ToolbarItem {
119120
ToolBarButton(title: "Save", icon: "tray.and.arrow.down", backgroundColor: .blue) {
120121
viewModel.saveChanges()
121122
}
122123
.keyboardShortcut("s")
123124
}
125+
.disableSharedBackground()
124126

125127
ToolbarItem {
126128
ToolBarButton(title: "New", icon: "plus.circle", backgroundColor: .accentColor) {
@@ -131,6 +133,7 @@ public struct MockPathConfigurations: View {
131133
shouldShowInspectorView = true
132134
}
133135
}
136+
.disableSharedBackground()
134137

135138
ToolbarItemGroup {
136139
Button(action: { isSearchActive = true }, label: EmptyView.init)
@@ -145,6 +148,7 @@ public struct MockPathConfigurations: View {
145148
isSearchActive: $isSearchActive
146149
)
147150
}
151+
.disableSharedBackground()
148152

149153
ToolbarItem {
150154
Button {
@@ -153,6 +157,7 @@ public struct MockPathConfigurations: View {
153157
Label("Hide Inspector", systemImage: "sidebar.trailing")
154158
}
155159
}
160+
.disableSharedBackground()
156161
}
157162
.navigationBarBackButtonHidden(false)
158163
.navigationTitle("Path Configs")

Features/MockDomainConfigs/Sources/MockDomainConfigs/MockConfigurations/MockQueryConfigurations.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ public struct MockQueryConfigurations: View {
148148
}
149149
}
150150
}
151+
.disableSharedBackground()
151152

152153
ToolbarItem {
153154
ToolBarButton(title: "Save", icon: "tray.and.arrow.down", backgroundColor: .blue) {
154155
viewModel.saveChanges()
155156
}
156157
.keyboardShortcut("s")
157158
}
159+
.disableSharedBackground()
158160

159161
ToolbarItem {
160162
ToolBarButton(title: "New", icon: "plus.circle", backgroundColor: .accentColor) {
@@ -165,6 +167,7 @@ public struct MockQueryConfigurations: View {
165167
shouldShowInspectorView = true
166168
}
167169
}
170+
.disableSharedBackground()
168171

169172
ToolbarItemGroup {
170173
Button(action: { isSearchActive = true }, label: EmptyView.init)
@@ -179,6 +182,7 @@ public struct MockQueryConfigurations: View {
179182
isSearchActive: $isSearchActive
180183
)
181184
}
185+
.disableSharedBackground()
182186

183187
ToolbarItem {
184188
Button {
@@ -187,6 +191,7 @@ public struct MockQueryConfigurations: View {
187191
Label("Hide Inspector", systemImage: "sidebar.trailing")
188192
}
189193
}
194+
.disableSharedBackground()
190195
}
191196
.navigationBarBackButtonHidden(false)
192197
.navigationTitle("Query Configs")

Features/MockDomainConfigs/Sources/MockDomainConfigs/MockDomainConfigsView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public struct MockDomainConfigsView: View {
2929
.frame(maxWidth: .infinity, alignment: .leading)
3030

3131
HStack {
32-
ToolBarButton(title: "Path Configurations", icon: "document.badge.gearshape", backgroundColor: .gray) {
32+
ToolBarButton(title: "Path Configurations", icon: "document.badge.gearshape", backgroundColor: .secondary.opacity(0.3)) {
3333
navigationStore.open(.configs_pathConfigs)
3434
}
35-
ToolBarButton(title: "Query Configurations", icon: "document.badge.gearshape", backgroundColor: .gray) {
35+
ToolBarButton(title: "Query Configurations", icon: "document.badge.gearshape", backgroundColor: .secondary.opacity(0.3)) {
3636
navigationStore.open(.configs_queryConfigs)
3737
}
38-
ToolBarButton(title: "Header Configurations", icon: "document.badge.gearshape", backgroundColor: .gray) {
38+
ToolBarButton(title: "Header Configurations", icon: "document.badge.gearshape", backgroundColor: .secondary.opacity(0.3)) {
3939
navigationStore.open(.configs_headerConfigs)
4040
}
4141
}
@@ -170,7 +170,7 @@ public struct MockDomainConfigsView: View {
170170
}
171171
}
172172

173-
ToolBarButton(title: "Add New Filter", icon: "camera.filters", backgroundColor: .gray) {
173+
ToolBarButton(title: "Add New Filter", icon: "camera.filters", backgroundColor: .secondary.opacity(0.3)) {
174174
withAnimation { viewModel.addNewFilter() }
175175
}
176176

@@ -219,6 +219,7 @@ public struct MockDomainConfigsView: View {
219219
.buttonBorderShape(.roundedRectangle)
220220
.buttonStyle(.plain)
221221
}
222+
.disableSharedBackground()
222223
}
223224
.task(id: mockDomain) { viewModel.mockDomainUpdated(mockDomain: mockDomain) }
224225
.onChange(of: viewModel.appFilterConfigs.domains) { viewModel.checkUnsavedChanges() }
@@ -279,7 +280,6 @@ struct EnhancedMockFilterView: View {
279280
VStack(spacing: .zero) {
280281
HStack(spacing: 8) {
281282
Image(systemName: "line.3.horizontal")
282-
.foregroundColor(.secondary)
283283
.font(.title)
284284
.onHover { isHovering = $0 }
285285

0 commit comments

Comments
 (0)