From 2ebe9e0265b24c5713bc0744c2c385980e25dbc1 Mon Sep 17 00:00:00 2001 From: Jordan Baird Date: Tue, 27 Feb 2024 13:56:36 -0700 Subject: [PATCH] Minor tweaks --- .../MenuBarSettingsPane/MenuBarSettingsPane.swift | 8 ++------ Ice/UI/Views/CustomTabView/CustomTab.swift | 8 ++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Ice/Settings/SettingsPanes/MenuBarSettingsPane/MenuBarSettingsPane.swift b/Ice/Settings/SettingsPanes/MenuBarSettingsPane/MenuBarSettingsPane.swift index d09b9383..df0cf834 100644 --- a/Ice/Settings/SettingsPanes/MenuBarSettingsPane/MenuBarSettingsPane.swift +++ b/Ice/Settings/SettingsPanes/MenuBarSettingsPane/MenuBarSettingsPane.swift @@ -10,14 +10,10 @@ struct MenuBarSettingsPane: View { var body: some View { CustomTabView(selection: $selection) { - CustomTab { - Text("Appearance") - } content: { + CustomTab("Appearance") { MenuBarAppearanceTab() } - CustomTab { - Text("Layout") - } content: { + CustomTab("Layout") { MenuBarLayoutTab() } } diff --git a/Ice/UI/Views/CustomTabView/CustomTab.swift b/Ice/UI/Views/CustomTabView/CustomTab.swift index bc59bc1e..6f91f89c 100644 --- a/Ice/UI/Views/CustomTabView/CustomTab.swift +++ b/Ice/UI/Views/CustomTabView/CustomTab.swift @@ -22,4 +22,12 @@ struct CustomTab { self.label = AnyView(label()) self.content = AnyView(content()) } + + /// Creates a tab with the given label and content view. + init( + _ labelKey: LocalizedStringKey, + @ViewBuilder content: () -> Content + ) { + self.init(label: { Text(labelKey) }, content: content) + } }