Skip to content

Commit 815e46e

Browse files
committed
Menus and Shortcuts: convert Menu to open
This opens up the `Menu` type for derivation outside of the module.
1 parent 828511c commit 815e46e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Sources/SwiftWin32/Menus and Shortcuts/Menu.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,14 @@ extension Menu.Options {
283283

284284
/// A container for grouping related menu elements in an application menu or
285285
/// contextual menu.
286-
public class Menu: MenuElement {
286+
open class Menu: MenuElement {
287287
// MARK - Creating a Menu Object
288288

289289
/// Creates a new menu with the specified values.
290-
public init(title: String = "", image: Image? = nil,
291-
identifier: Menu.Identifier? = nil, options: Menu.Options = [],
292-
children: [MenuElement] = []) {
290+
public /*convenience*/ init(title: String = "", image: Image? = nil,
291+
identifier: Menu.Identifier? = nil,
292+
options: Menu.Options = [],
293+
children: [MenuElement] = []) {
293294
self.children = children
294295
self.identifier = identifier ?? .generated
295296
self.options = options
@@ -303,17 +304,17 @@ public class Menu: MenuElement {
303304

304305
/// Creates a new menu with the same configuration as the current menu, but
305306
/// with a new set of child elements.
306-
public func replacingChildren(_ newChildren: [MenuElement]) -> Menu {
307+
open func replacingChildren(_ newChildren: [MenuElement]) -> Menu {
307308
fatalError("\(#function) not yet implemented")
308309
}
309310

310311
// MARK - Getting the Menu Details
311312

312313
/// The unique identifier for the current menu.
313-
public private(set) var identifier: Menu.Identifier
314+
open private(set) var identifier: Menu.Identifier
314315

315316
/// The configuration options for the current menu.
316-
public private(set) var options: Menu.Options
317+
open private(set) var options: Menu.Options
317318
}
318319

319320
extension Menu: Equatable {

0 commit comments

Comments
 (0)