Refactor buttons/menus
- Add divider in add profile menu - Reuse trailing dots
This commit is contained in:
parent
839530e192
commit
00ba67f135
|
@ -41,6 +41,7 @@ struct AddProfileMenu: View {
|
|||
Menu {
|
||||
newProfileButton
|
||||
importProfileButton
|
||||
Divider()
|
||||
migrateProfilesButton
|
||||
} label: {
|
||||
ThemeImage(.add)
|
||||
|
@ -62,13 +63,13 @@ private extension AddProfileMenu {
|
|||
Button {
|
||||
isImporting = true
|
||||
} label: {
|
||||
ThemeImageLabel(Strings.Views.Profiles.Toolbar.importProfile, .profileImport)
|
||||
ThemeImageLabel(Strings.Views.Profiles.Toolbar.importProfile.withTrailingDots, .profileImport)
|
||||
}
|
||||
}
|
||||
|
||||
var migrateProfilesButton: some View {
|
||||
Button(action: onMigrateProfiles) {
|
||||
ThemeImageLabel(Strings.Views.Profiles.Toolbar.migrateProfiles, .profileMigrate)
|
||||
ThemeImageLabel(Strings.Views.Profiles.Toolbar.migrateProfiles.withTrailingDots, .profileMigrate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ private extension ProfileContextMenu {
|
|||
Button {
|
||||
flow?.onEditProfile(header)
|
||||
} label: {
|
||||
ThemeImageLabel("\(Strings.Global.edit)...", .profileEdit)
|
||||
ThemeImageLabel(Strings.Global.edit.withTrailingDots, .profileEdit)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ private extension AppMenu {
|
|||
}
|
||||
|
||||
var aboutButton: some View {
|
||||
Button("\(Strings.Global.about)...") {
|
||||
Button(Strings.Global.about.withTrailingDots) {
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
NSApp.orderFrontStandardAboutPanel(self)
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@ extension String {
|
|||
public var nilIfEmpty: String? {
|
||||
!isEmpty ? self : nil
|
||||
}
|
||||
|
||||
public var withTrailingDots: String {
|
||||
"\(self)..."
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
|
|
Loading…
Reference in New Issue