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

This commit is contained in:
allsochen authored and lwouis committed 2024-10-12 12:43:56 +02:00
1 parent ea5574bfa5
commit b4e97ead04
2 files changed
+9 -12

No files matched your search

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