@@ -12,7 +12,7 @@ A tab in the settings window.
12
12
### `model`
13
13
14
14
```swift
15
- @StateObject private var model = SettingsModel.shared
15
+ @StateObject var model = SettingsModel.shared
16
16
```
17
17
18
18
The instance of the settings model.
@@ -49,6 +49,22 @@ public var content: [SettingsSubtab]
49
49
50
50
The tab's content.
51
51
52
+ ### `top`
53
+
54
+ ```swift
55
+ public var top: AnyView ?
56
+ ```
57
+
58
+ The view above the list of the subtabs in the sidebar style settings window.
59
+
60
+ ### `bottom`
61
+
62
+ ```swift
63
+ public var bottom: AnyView ?
64
+ ```
65
+
66
+ The view below the list of the subtabs in the sidebar style settings window.
67
+
52
68
### `sidebarActions`
53
69
54
70
```swift
@@ -76,7 +92,7 @@ The settings window's height.
76
92
### `contentWithoutNoSelectionSubtabs`
77
93
78
94
```swift
79
- private var contentWithoutNoSelectionSubtabs: [SettingsSubtab ]
95
+ var contentWithoutNoSelectionSubtabs: [SettingsSubtab ]
80
96
```
81
97
82
98
The tab's content, but without the subtabs with the ``TabType.noSelection`` type.
@@ -92,15 +108,15 @@ The view containing all the subtabs.
92
108
### `sidebar`
93
109
94
110
```swift
95
- private var sidebar: some View
111
+ var sidebar: some View
96
112
```
97
113
98
114
The tab's sidebar containing all the subtabs.
99
115
100
116
### `sidebarList`
101
117
102
118
```swift
103
- private var sidebarList: some View
119
+ var sidebarList: some View
104
120
```
105
121
106
122
The list in the tab's sidebar.
@@ -116,7 +132,7 @@ The body if the sidebar layout is active.
116
132
### `contentView`
117
133
118
134
```swift
119
- private var contentView: some View
135
+ var contentView: some View
120
136
```
121
137
122
138
The selected subtab's content.
@@ -163,175 +179,4 @@ The initializer.
163
179
| type | The tab type of the settings tab. |
164
180
| id | The identifier. |
165
181
| color | The tab’s color in the settings window with the sidebar design. |
166
- | content | The content of the settings tab. |
167
-
168
- ### `listContent(subtab:)`
169
-
170
- ```swift
171
- private func listContent(subtab: SettingsSubtab ) -> some View
172
- ```
173
-
174
- A row in the sidebar list.
175
- - Parameter subtab: The subtab of the row .
176
- - Returns: The row .
177
-
178
- #### Parameters
179
-
180
- | Name | Description |
181
- | ---- | ----------- |
182
- | subtab | The subtab of the row. |
183
-
184
- ### `updateSubtabSelection(ids:)`
185
-
186
- ```swift
187
- private func updateSubtabSelection(ids: [String ])
188
- ```
189
-
190
- Update the selection of the subtab.
191
- - Parameter ids: The identifiers of the subtabs .
192
-
193
- #### Parameters
194
-
195
- | Name | Description |
196
- | ---- | ----------- |
197
- | ids | The identifiers of the subtabs. |
198
-
199
- ### `actions(content:)`
200
-
201
- ```swift
202
- public func actions(@ArrayBuilder<ToolbarGroup > content: () -> [ToolbarGroup ]) -> Self
203
- ```
204
-
205
- Adds actions to the settings sidebar.
206
- - Parameter content: The actions .
207
- - Returns: The new tab with the actions .
208
-
209
- #### Parameters
210
-
211
- | Name | Description |
212
- | ---- | ----------- |
213
- | content | The actions. |
214
-
215
- ### `actions(content:)`
216
-
217
- ```swift
218
- public func actions(content: [ToolbarGroup ]) -> Self
219
- ```
220
-
221
- Add actions to the settings sidebar by providing an array.
222
- - Parameter content: The actions as an array ..
223
- - Returns: The new tab with the actions .
224
-
225
- #### Parameters
226
-
227
- | Name | Description |
228
- | ---- | ----------- |
229
- | content | The actions as an array.. |
230
-
231
- ### `standardActions(add:remove :options :)`
232
-
233
- ```swift
234
- public func standardActions(
235
- add: @escaping () -> Void ,
236
- remove : @escaping (String ?, Int ?) -> Void ,
237
- options : (() -> Void )? = nil
238
- ) -> Self
239
- ```
240
-
241
- The standard set of actions with an add button, a remove button and optionally an options button.
242
- - Parameters:
243
- - add : The action that is called when the add button is pressed .
244
- - remove: The action that is called when the remove button is pressed ,
245
- giving the the selected subtab 's id and index .
246
- - options: The action that is called when the options button is pressed .
247
- If it is nil, there is no options button.
248
- - Returns: The new tab with the actions .
249
-
250
- #### Parameters
251
-
252
- | Name | Description |
253
- | ---- | ----------- |
254
- | add | The action that is called when the add button is pressed. |
255
- | remove | The action that is called when the remove button is pressed, giving the the selected subtab’s id and index. |
256
- | options | The action that is called when the options button is pressed. If it is nil, there is no options button. |
257
-
258
- ### `standardActions(add:remove :options :)`
259
-
260
- ```swift
261
- public func standardActions<ContentView >(
262
- @ViewBuilder add: @escaping () -> ContentView ,
263
- remove : @escaping (String ?, Int ?) -> Void ,
264
- options : (() -> Void )? = nil
265
- ) -> Self where ContentView: View
266
- ```
267
-
268
- The standard set of actions with an add menu, a remove button and optionally an options button.
269
- - Parameters:
270
- - add : The menu that is opened when the add button is pressed .
271
- - remove: The action that is called when the remove button is pressed ,
272
- giving the the selected subtab 's id and index .
273
- - options: The action that is called when the options button is pressed .
274
- If it is nil, there is no options button.
275
- - Returns: The new tab with the actions .
276
-
277
- #### Parameters
278
-
279
- | Name | Description |
280
- | ---- | ----------- |
281
- | add | The menu that is opened when the add button is pressed. |
282
- | remove | The action that is called when the remove button is pressed, giving the the selected subtab’s id and index. |
283
- | options | The action that is called when the options button is pressed. If it is nil, there is no options button. |
284
-
285
- ### `frame(width:height :)`
286
-
287
- ```swift
288
- public func frame(width: CGFloat ? = nil, height: CGFloat ? = nil) -> Self
289
- ```
290
-
291
- Set the window's width and height when this tab is open.
292
- This is being ignored if there is more than one subtab or if there are settings actions.
293
- - Parameters:
294
- - width : The width . If nil , the window uses the content 's width .
295
- - height: The height . If nil , the window uses the content 's height .
296
- - Returns: The settings tab with the new window size .
297
-
298
- #### Parameters
299
-
300
- | Name | Description |
301
- | ---- | ----------- |
302
- | width | The width. If nil, the window uses the content’s width. |
303
- | height | The height. If nil, the window uses the content’s height. |
304
-
305
- ### `width(_:)`
306
-
307
- ```swift
308
- public func width(_ width: CGFloat ? = nil) -> Self
309
- ```
310
-
311
- Set the window's width when this tab is open without affecting the height.
312
- This is being ignored if there is more than one subtab or if there are settings actions.
313
- - Parameter width: The width . If nil , the window uses the content 's width .
314
- - Returns: The settings tab with the new window size .
315
-
316
- #### Parameters
317
-
318
- | Name | Description |
319
- | ---- | ----------- |
320
- | width | The width. If nil, the window uses the content’s width. |
321
-
322
- ### `height(_:)`
323
-
324
- ```swift
325
- public func height(_ height: CGFloat ? = nil) -> Self
326
- ```
327
-
328
- Set the window's height when this tab is open without affecting the width.
329
- This is being ignored if there is more than one subtab or if there are settings actions.
330
- - Parameter height: The height . If nil , the window uses the content 's height .
331
- - Returns: The settings tab with the new window size .
332
-
333
- #### Parameters
334
-
335
- | Name | Description |
336
- | ---- | ----------- |
337
- | height | The height. If nil, the window uses the content’s height. |
182
+ | content | The content of the settings tab. |
0 commit comments