Guest User

Untitled

a guest
Nov 3rd, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.99 KB | None | 0 0
  1. --- "/usr/share/lipstick-jolla-home-qt5/volumecontrol/VolumeControl.qml"    2017-11-02 21:04:52.000000000 +0300
  2. +++ "/usr/share/lipstick-jolla-home-qt5/volumecontrol/VolumeControl.qml"    2017-11-04 00:33:09.000000000 +0300
  3. @@ -10,6 +10,7 @@
  4.  import Sailfish.Silica 1.0
  5.  import org.nemomobile.systemsettings 1.0
  6.  import org.nemomobile.configuration 1.0
  7. +import org.nemomobile.mpris 1.0
  8.  import QtFeedback 5.0
  9.  import "../systemwindow"
  10.  import "../compositor"
  11. @@ -17,6 +18,8 @@
  12.  SystemWindow {
  13.      id: volumeBar
  14.  
  15. +    MprisManager { id: mprisManager }
  16. +    
  17.      property bool volumeIncreasing
  18.      property bool lateScreenshotCapture
  19.      property var screenshot
  20. @@ -453,7 +456,13 @@
  21.          repeat: true
  22.          onTriggered: {
  23.              if (volumeBar.controllingMedia) {
  24. -                volumeControl.volume = volumeControl.volume + (volumeBar.volumeIncreasing ? 1 : -1)
  25. +                if (volumeIncreasing)
  26. +                    mprisManager.previous()
  27. +                else
  28. +                    mprisManager.next()
  29. +                keyRepeat.stop()
  30. +                keyRepeatDelay.stop()
  31. +                initialChange = 0
  32.              } else {
  33.                  profileControl.adjustRingtoneVolume(volumeBar.volumeIncreasing ? 20 : -20)
  34.              }
  35. @@ -488,14 +497,10 @@
  36.              volumeBar.volumeIncreasing = (key == Qt.Key_VolumeUp)
  37.  
  38.              if (volumeBar.controllingMedia) {
  39. -                if (volumeIncreasing)
  40. -                    initialChange = volumeControl.volume === volumeControl.maximumVolume ? 0 : -1 / (volumeControl.maximumVolume+1)
  41. -                else
  42. -                    initialChange = volumeControl.volume === 0 ? 0 : 1 / (volumeControl.maximumVolume+1)
  43. -
  44. +                initialChange = 0
  45. +                baseVolume = volumeControl.volume
  46.                  keyRepeat.stop()
  47.                  keyRepeatDelay.restart()
  48. -                volumeControl.volume = volumeControl.volume + (volumeBar.volumeIncreasing ? 1 : -1)
  49.              } else {
  50.                  if (volumeControl.windowVisible) {
  51.                      if (volumeIncreasing)
  52. @@ -518,7 +523,14 @@
  53.          onVolumeKeyReleased: {
  54.              initialChange = 0
  55.              if (volumeBar.controllingMedia)
  56. -                baseVolume = volumeControl.volume
  57. +                keyRepeat.stop()
  58. +                keyRepeatDelay.stop()
  59. +                if (volumeIncreasing)
  60. +                    initialChange = volumeControl.volume === volumeControl.maximumVolume ? 0 : -1 / (volumeControl.maximumVolume+1)
  61. +                else
  62. +                    initialChange = volumeControl.volume === 0 ? 0 : 1 / (volumeControl.maximumVolume+1)
  63. +                volumeControl.volume = volumeControl.volume + (volumeBar.volumeIncreasing ? 1 : -1)
  64. +                
  65.              if (volumeBar.volumeIncreasing == (key == Qt.Key_VolumeUp)) {
  66.                  // Handle pressing both buttons and releasing the first, though
  67.                  // in that case keyRepeat is probably already stopped by screenshotTimer
Add Comment
Please, Sign In to add comment