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 {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue