Skip to content

Commit

Permalink
Jump Button in Center (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored Dec 1, 2023
1 parent a01d57c commit 88e2895
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Mlem/Views/Shared/Posts/Expanded Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct ExpandedPost: View {
.frame(
maxWidth: .infinity,
maxHeight: .infinity,
alignment: commentJumpButtonSide == .bottomTrailing ? .bottomTrailing : .bottomLeading
alignment: commentJumpButtonSide.alignment
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
import SwiftUI

enum JumpButtonLocation: String, SettingsOptions {
case bottomLeading, bottomTrailing
case bottomLeading, bottomTrailing, center

var id: Self { self }

Expand All @@ -19,6 +19,19 @@ enum JumpButtonLocation: String, SettingsOptions {
return "Left"
case .bottomTrailing:
return "Right"
case .center:
return "Center"
}
}

var alignment: Alignment {
switch self {
case .bottomLeading:
return .bottomLeading
case .bottomTrailing:
return .bottomTrailing
case .center:
return .bottom
}
}
}
Expand Down

0 comments on commit 88e2895

Please sign in to comment.