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

Add next and previous buttons #4

Merged
merged 2 commits into from
Aug 15, 2021
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
81 changes: 81 additions & 0 deletions ovos_workshop/res/ui/SeekControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Item {
property var videoControl
property string title

property var nextAction: "next"
property var previousAction: "previous"

clip: true
implicitWidth: parent.width
implicitHeight: mainLayout.implicitHeight + Kirigami.Units.largeSpacing * 2
Expand Down Expand Up @@ -102,6 +105,84 @@ Item {
}
}

Controls.RoundButton {
id: buttonPrev
Layout.preferredWidth: parent.width > 600 ? Kirigami.Units.iconSizes.large : Kirigami.Units.iconSizes.medium
Layout.preferredHeight: Layout.preferredWidth
highlighted: focus ? 1 : 0
z: 1000

background: Rectangle {
radius: 200
color: "#1a1a1a"
border.width: 1.25
border.color: "white"
}

contentItem: Item {
Image {
width: parent.width - Kirigami.Units.largeSpacing
height: width
anchors.centerIn: parent
source: Qt.resolvedUrl("images/media-previous.svg")
}
}

onClicked: {
triggerGuiEvent(seekControl.previousAction, {})
hideTimer.restart();
}
KeyNavigation.up: video
KeyNavigation.left: backButton
KeyNavigation.right: slider
Keys.onReturnPressed: {
triggerGuiEvent(seekControl.previousAction, {})
hideTimer.restart();
}
onFocusChanged: {
hideTimer.restart();
}
}

Controls.RoundButton {
id: buttonNext
Layout.preferredWidth: parent.width > 600 ? Kirigami.Units.iconSizes.large : Kirigami.Units.iconSizes.medium
Layout.preferredHeight: Layout.preferredWidth
highlighted: focus ? 1 : 0
z: 1000

background: Rectangle {
radius: 200
color: "#1a1a1a"
border.width: 1.25
border.color: "white"
}

contentItem: Item {
Image {
width: parent.width - Kirigami.Units.largeSpacing
height: width
anchors.centerIn: parent
source: Qt.resolvedUrl("images/media-next.svg")
}
}

onClicked: {
triggerGuiEvent(seekControl.nextAction, {})
hideTimer.restart();
}
KeyNavigation.up: video
KeyNavigation.left: backButton
KeyNavigation.right: slider
Keys.onReturnPressed: {
triggerGuiEvent(seekControl.nextAction, {})
hideTimer.restart();
}
onFocusChanged: {
hideTimer.restart();
}
}

Templates.Slider {
id: slider
Layout.fillWidth: true
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='ovos_workshop',
version='0.0.4a5',
version='0.0.4a6',
packages=['ovos_workshop',
'ovos_workshop.skills',
'ovos_workshop.skills.decorators',
Expand Down