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

feat: add top right window title position option #150

Merged
Merged
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
11 changes: 10 additions & 1 deletion DockDoor/Views/Hover Window/WindowPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ struct WindowPreview: View {
}
.clipShape(uniformCardRadius ? AnyShape(RoundedRectangle(cornerRadius: 6, style: .continuous)) : AnyShape(Rectangle()))
}
.overlay(alignment: windowTitlePosition == .bottomLeft ? .bottomLeading : .bottomTrailing) {
.overlay(alignment: {
switch windowTitlePosition {
case .bottomLeft:
return .bottomLeading
case .bottomRight:
return .bottomTrailing
case .topRight:
return .topTrailing
}
}()) {
if showWindowTitle && ((windowTitleDisplayCondition == .always) || (windowTitleDisplayCondition == .windowSwitcherOnly && CurrentWindow.shared.showingTabMenu) || (windowTitleDisplayCondition == .dockPreviewsOnly && !CurrentWindow.shared.showingTabMenu)) {
windowTitleOverlay(selected: selected)
}
Expand Down
3 changes: 3 additions & 0 deletions DockDoor/consts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ enum WindowTitleDisplayCondition: String, CaseIterable, Defaults.Serializable {
enum WindowTitlePosition: String, CaseIterable, Defaults.Serializable {
case bottomLeft
case bottomRight
case topRight

var localizedName: String {
switch self {
case .bottomLeft:
String(localized: "Bottom Left", comment: "Preview window title position option")
case .bottomRight:
String(localized: "Bottom Right", comment: "Preview window title position option")
case .topRight:
String(localized: "Top Right", comment: "Preview window title position option")
}
}
}
Expand Down