diff --git a/src/qml/calamares/slideshow/Presentation.qml b/src/qml/calamares/slideshow/Presentation.qml index 2e4778888..b53b9fc55 100644 --- a/src/qml/calamares/slideshow/Presentation.qml +++ b/src/qml/calamares/slideshow/Presentation.qml @@ -1,4 +1,7 @@ /* === This file is part of Calamares - === + * + * Copyright 2017, Adriaan de Groot + * - added looping, keys-instead-of-shortcut * * SPDX-License-Identifier: LGPL-2.1 * License-Filename: LICENSES/LGPLv2.1-Presentation @@ -98,6 +101,8 @@ Item { onCurrentSlideChanged: { switchSlides(root.slides[_lastShownSlide], root.slides[currentSlide], currentSlide > _lastShownSlide) _lastShownSlide = currentSlide + // Always keep focus on the slideshow + root.focus = true } function goToNextSlide() { @@ -110,6 +115,8 @@ Item { } if (currentSlide + 1 < root.slides.length) ++currentSlide; + else + currentSlide = 0; // Loop at the end } function goToPreviousSlide() { @@ -143,6 +150,13 @@ Item { } } + focus: true // Keep focus + + // Navigation through key events, too + Keys.onSpacePressed: goToNextSlide() + Keys.onRightPressed: goToNextSlide() + Keys.onLeftPressed: goToPreviousSlide() + // navigate with arrow keys Shortcut { sequence: StandardKey.MoveToNextLine; enabled: root.arrowNavigation; onActivated: goToNextSlide() } Shortcut { sequence: StandardKey.MoveToPreviousLine; enabled: root.arrowNavigation; onActivated: goToPreviousSlide() }