Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix show titles under thumbnail style #3680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/ui/main-window/ThumbnailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
})
Expand All @@ -112,7 +113,7 @@ class CustomizeStyleSheet: SheetWindow {

private func makeTitlesView() -> TableGroupSetView {
let table = makeAppWindowTableGroupView()

table.addNewTable()
table.addRow(titleTruncation)
table.fit()

Expand Down Expand Up @@ -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)
}
Expand Down