Refactor buttons/menus

- Add divider in add profile menu
- Reuse trailing dots
This commit is contained in:
Davide 2024-11-17 18:42:19 +01:00
parent 839530e192
commit 00ba67f135
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
4 changed files with 9 additions and 4 deletions

View File

@ -41,6 +41,7 @@ struct AddProfileMenu: View {
Menu { Menu {
newProfileButton newProfileButton
importProfileButton importProfileButton
Divider()
migrateProfilesButton migrateProfilesButton
} label: { } label: {
ThemeImage(.add) ThemeImage(.add)
@ -62,13 +63,13 @@ private extension AddProfileMenu {
Button { Button {
isImporting = true isImporting = true
} label: { } label: {
ThemeImageLabel(Strings.Views.Profiles.Toolbar.importProfile, .profileImport) ThemeImageLabel(Strings.Views.Profiles.Toolbar.importProfile.withTrailingDots, .profileImport)
} }
} }
var migrateProfilesButton: some View { var migrateProfilesButton: some View {
Button(action: onMigrateProfiles) { Button(action: onMigrateProfiles) {
ThemeImageLabel(Strings.Views.Profiles.Toolbar.migrateProfiles, .profileMigrate) ThemeImageLabel(Strings.Views.Profiles.Toolbar.migrateProfiles.withTrailingDots, .profileMigrate)
} }
} }
} }

View File

@ -102,7 +102,7 @@ private extension ProfileContextMenu {
Button { Button {
flow?.onEditProfile(header) flow?.onEditProfile(header)
} label: { } label: {
ThemeImageLabel("\(Strings.Global.edit)...", .profileEdit) ThemeImageLabel(Strings.Global.edit.withTrailingDots, .profileEdit)
} }
} }

View File

@ -109,7 +109,7 @@ private extension AppMenu {
} }
var aboutButton: some View { var aboutButton: some View {
Button("\(Strings.Global.about)...") { Button(Strings.Global.about.withTrailingDots) {
NSApp.activate(ignoringOtherApps: true) NSApp.activate(ignoringOtherApps: true)
NSApp.orderFrontStandardAboutPanel(self) NSApp.orderFrontStandardAboutPanel(self)
} }

View File

@ -29,6 +29,10 @@ extension String {
public var nilIfEmpty: String? { public var nilIfEmpty: String? {
!isEmpty ? self : nil !isEmpty ? self : nil
} }
public var withTrailingDots: String {
"\(self)..."
}
} }
extension String { extension String {