mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Add action buttons label setting
This commit is contained in:
parent
5ae6f321cd
commit
93ea943c54
@ -148,14 +148,7 @@ extension Defaults.Keys {
|
||||
static let playerControlsPlaybackModeEnabled = Key<Bool>("playerControlsPlaybackModeEnabled", default: false)
|
||||
static let playerControlsMusicModeEnabled = Key<Bool>("playerControlsMusicModeEnabled", default: false)
|
||||
|
||||
// TODO: IMPLEMENT THIS
|
||||
// ** rgdfo;fgks iojsiojf
|
||||
#if os(macOS)
|
||||
static let playerDetailsPageButtonLabelStyleDefault = ButtonLabelStyle.iconAndText
|
||||
#else
|
||||
static let playerDetailsPageButtonLabelStyleDefault = UIDevice.current.userInterfaceIdiom == .phone ? ButtonLabelStyle.iconOnly : .iconAndText
|
||||
#endif
|
||||
static let playerActionsButtonLabelStyle = Key<ButtonLabelStyle>("playerActionsButtonLabelStyle", default: playerDetailsPageButtonLabelStyleDefault)
|
||||
static let playerActionsButtonLabelStyle = Key<ButtonLabelStyle>("playerActionsButtonLabelStyle", default: .iconAndText)
|
||||
|
||||
static let actionButtonShareEnabled = Key<Bool>("actionButtonShareEnabled", default: true)
|
||||
static let actionButtonAddToPlaylistEnabled = Key<Bool>("actionButtonAddToPlaylistEnabled", default: true)
|
||||
@ -438,6 +431,15 @@ enum ButtonLabelStyle: String, CaseIterable, Defaults.Serializable {
|
||||
var text: Bool {
|
||||
self == .iconAndText
|
||||
}
|
||||
|
||||
var description: String {
|
||||
switch self {
|
||||
case .iconOnly:
|
||||
"Icon only"
|
||||
case .iconAndText:
|
||||
"Icon and text"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum ThumbnailsQuality: String, CaseIterable, Defaults.Serializable {
|
||||
|
@ -15,6 +15,7 @@ struct PlayerControlsSettings: View {
|
||||
@Default(.gestureBackwardSeekDuration) private var gestureBackwardSeekDuration
|
||||
@Default(.gestureForwardSeekDuration) private var gestureForwardSeekDuration
|
||||
@Default(.systemControlsSeekDuration) private var systemControlsSeekDuration
|
||||
@Default(.playerActionsButtonLabelStyle) private var playerActionsButtonLabelStyle
|
||||
@Default(.actionButtonShareEnabled) private var actionButtonShareEnabled
|
||||
@Default(.actionButtonSubscribeEnabled) private var actionButtonSubscribeEnabled
|
||||
@Default(.actionButtonCloseEnabled) private var actionButtonCloseEnabled
|
||||
@ -117,6 +118,15 @@ struct PlayerControlsSettings: View {
|
||||
Section(header: SettingsHeader(text: "Actions Buttons".localized())) {
|
||||
actionButtonToggles
|
||||
}
|
||||
|
||||
Section {
|
||||
Picker("Action button labels", selection: $playerActionsButtonLabelStyle) {
|
||||
ForEach(ButtonLabelStyle.allCases, id: \.rawValue) { style in
|
||||
Text(style.description).tag(style)
|
||||
}
|
||||
}
|
||||
.modifier(SettingsPickerModifier())
|
||||
}
|
||||
}
|
||||
|
||||
private var systemControlsCommandsPicker: some View {
|
||||
|
@ -307,7 +307,7 @@ struct SettingsView: View {
|
||||
case .browsing:
|
||||
return 800
|
||||
case .player:
|
||||
return 500
|
||||
return 550
|
||||
case .controls:
|
||||
return 920
|
||||
case .quality:
|
||||
|
Loading…
Reference in New Issue
Block a user