fix(ui): keep Space for playback after mouse clicks #5
No files matched your search
+8
-7
@@ -13,7 +13,8 @@ import org.kde.kirigami as Kirigami
|
||||
Item {
|
||||
id: root
|
||||
|
||||
// Space activates the focused control before the window's playback action.
|
||||
// Space activates the focused control before the window's playback action. The
|
||||
// controls take focus only from Tab, so a click leaves Space for playback.
|
||||
Keys.onShortcutOverride: event => {
|
||||
if (event.key === Qt.Key_Space && event.modifiers === Qt.NoModifier) {
|
||||
event.accepted = true
|
||||
@@ -137,7 +138,7 @@ Item {
|
||||
actions: root.actions
|
||||
mpv: root.mpv
|
||||
inFooter: true
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
visible: root.showMenuButton
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
@@ -149,7 +150,7 @@ Item {
|
||||
display: AbstractButton.IconOnly
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
ToolTip.text: root.mpv.paused ? KI18n.i18nc("@info:tooltip", "Start playback") : KI18n.i18nc("@info:tooltip", "Pause playback")
|
||||
ToolTip.visible: hovered
|
||||
@@ -162,7 +163,7 @@ Item {
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
ToolTip.text: KI18n.i18nc("@info:tooltip", "Play previous file")
|
||||
ToolTip.visible: hovered
|
||||
@@ -175,7 +176,7 @@ Item {
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
ToolTip.text: KI18n.i18nc("@info:tooltip", "Play next file")
|
||||
ToolTip.visible: hovered
|
||||
@@ -195,7 +196,7 @@ Item {
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
ToolTip.text: root.actions.mute.text
|
||||
ToolTip.visible: hovered
|
||||
@@ -225,7 +226,7 @@ Item {
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
visible: !QtPotatoSettings.playlistToggleWithMouse
|
||||
|
||||
ToolTip.text: text
|
||||
|
||||
+9
-8
@@ -12,7 +12,8 @@ import org.kde.kirigami as Kirigami
|
||||
ToolBar {
|
||||
id: root
|
||||
|
||||
// Space activates the focused control before the window's playback action.
|
||||
// Space activates the focused control before the window's playback action. The
|
||||
// controls take focus only from Tab, so a click leaves Space for playback.
|
||||
Keys.onShortcutOverride: event => {
|
||||
if (event.key === Qt.Key_Space && event.modifiers === Qt.NoModifier) {
|
||||
event.accepted = true
|
||||
@@ -40,14 +41,14 @@ ToolBar {
|
||||
actions: root.actions
|
||||
mpv: root.mpv
|
||||
visible: !root.menuBarShown
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
action: root.actions.openFile
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: root.isSmallSize ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
|
||||
@@ -59,7 +60,7 @@ ToolBar {
|
||||
|
||||
ToolButton {
|
||||
action: root.actions.openUrl
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: root.isSmallSize ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
|
||||
@@ -77,7 +78,7 @@ ToolBar {
|
||||
icon.name: "add-subtitle"
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
enabled: root.mpv.fileLoaded
|
||||
opacity: enabled ? 1.0 : 0.6
|
||||
display: root.isSmallSize ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
|
||||
@@ -111,7 +112,7 @@ ToolBar {
|
||||
icon.name: "audio-volume-high"
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
enabled: root.mpv.audioTracks.length > 0
|
||||
opacity: enabled ? 1.0 : 0.6
|
||||
display: root.isSmallSize ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
|
||||
@@ -162,7 +163,7 @@ ToolBar {
|
||||
ToolButton {
|
||||
action: root.actions.cancelTranslation
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
ToolTip.text: text
|
||||
ToolTip.visible: hovered
|
||||
@@ -176,7 +177,7 @@ ToolBar {
|
||||
|
||||
ToolButton {
|
||||
action: root.actions.configure
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: root.isSmallSize ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
|
||||
|
||||
@@ -63,7 +63,7 @@ Page {
|
||||
icon.name: "list-add"
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
onClicked: root.addFilesRequested()
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ Page {
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
enabled: root.playlist.playingIndex >= 0
|
||||
onClicked: playlistView.positionViewAtIndex(root.playlist.playingIndex, ListView.Center)
|
||||
|
||||
@@ -88,7 +88,7 @@ Page {
|
||||
icon.width: root.buttonSize
|
||||
icon.height: root.buttonSize
|
||||
display: AbstractButton.IconOnly
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
enabled: root.playlist.count > 0
|
||||
onClicked: root.playlist.clear()
|
||||
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ Slider {
|
||||
from: 0
|
||||
to: Math.max(root.mpv.duration, 0)
|
||||
enabled: root.mpv.fileLoaded && root.mpv.duration > 0
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
// Preserve the Slider's own arrow-key behavior when playback shortcuts exist.
|
||||
Keys.onShortcutOverride: event => {
|
||||
|
||||
@@ -20,7 +20,7 @@ Slider {
|
||||
implicitWidth: Kirigami.Units.gridUnit * 5
|
||||
wheelEnabled: true
|
||||
stepSize: QtPotatoSettings.volumeStep
|
||||
focusPolicy: Qt.StrongFocus
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
// Let the Slider consume navigation keys before window playback shortcuts.
|
||||
Keys.onShortcutOverride: event => {
|
||||
|
||||
Reference in new issue
Block a user