fix: show titles > application name, in thumbnails style (closes #3667)

This commit is contained in:
allsochen
2024-10-12 12:44:32 +08:00
committed by lwouis
parent ea5574bfa5
commit b4e97ead04
2 changed files with 9 additions and 12 deletions
+4 -6
View File
@@ -351,12 +351,10 @@ class ThumbnailView: NSStackView {
let appName = window_?.application.runningApplication.localizedName
let windowTitle = window_?.title
if Preferences.appearanceStyle != .thumbnails {
if Preferences.onlyShowApplications() || Preferences.showTitles == .appName {
return appName ?? ""
} else if Preferences.showTitles == .appNameAndWindowTitle {
return [appName, windowTitle].compactMap{ $0 }.joined(separator: " - ")
}
if Preferences.onlyShowApplications() || Preferences.showTitles == .appName {
return appName ?? ""
} else if Preferences.showTitles == .appNameAndWindowTitle {
return [appName, windowTitle].compactMap{ $0 }.joined(separator: " - ")
}
return windowTitle ?? ""
}
@@ -79,6 +79,7 @@ class CustomizeStyleSheet: SheetWindow {
showTitlesRowInfo = table.addRow(showTitles, onMouseEntered: { event, view in
self.showAppsOrWindowsIllustratedImage()
})
table.addNewTable()
table.addRow(alignThumbnails, onMouseEntered: { event, view in
self.showAlignThumbnailsIllustratedImage()
}, onMouseExited: { event, view in
@@ -96,7 +97,7 @@ class CustomizeStyleSheet: SheetWindow {
private func makeAppIconsView() -> TableGroupSetView {
let table = makeAppWindowTableGroupView()
table.addNewTable()
table.addRow(alignThumbnails, onMouseEntered: { event, view in
self.showAlignThumbnailsIllustratedImage()
})
@@ -112,7 +113,7 @@ class CustomizeStyleSheet: SheetWindow {
private func makeTitlesView() -> TableGroupSetView {
let table = makeAppWindowTableGroupView()
table.addNewTable()
table.addRow(titleTruncation)
table.fit()
@@ -158,11 +159,9 @@ class CustomizeStyleSheet: SheetWindow {
}
private func showAppsOrWindowsIllustratedImage() {
var imageName = ShowTitlesPreference.windowTitle.image.name
if Preferences.showAppsOrWindows == .applications || Preferences.showTitles == .appName {
var imageName = Preferences.showTitles.image.name
if Preferences.onlyShowApplications() {
imageName = ShowTitlesPreference.appName.image.name
} else if Preferences.showTitles == .appNameAndWindowTitle {
imageName = ShowTitlesPreference.appNameAndWindowTitle.image.name
}
self.illustratedImageView.highlight(true, imageName)
}