Make wallpaper configuration respect global animation speed
Needs RevisionPublic

Authored by matthieuharle on Apr 6 2019, 1:27 PM.

Details

Reviewers
mart
hein
davidedmundson
Group Reviewers
Plasma
Summary

BUG: 395324

Diff Detail

Repository
R119 Plasma Desktop
Branch
wallpaper-transition-duration (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10515
Build 10533: arc lint + arc unit
matthieuharle created this revision.Apr 6 2019, 1:27 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 6 2019, 1:27 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
matthieuharle requested review of this revision.Apr 6 2019, 1:27 PM
ngraham added a subscriber: ngraham.

Thanks for the patch. However this doesn't feel like the right place to fix the issue, because then all other StackViews would still have the same issue. The animation duration should probably be changed somewhere in the StackView theming so it affects all of them. I don't know where that is, but hopefully some of the folks I've added as reviewers will.

davidedmundson requested changes to this revision.Apr 6 2019, 5:06 PM

There isn't a global animation speed, but using Kirigami.units does indeed make sense.

As Nate mentioned this should be in the universal place.

That place is the repo qqc2-desktop-style in frameworks.

It seems it's a new file, but copy the Label template and it should be self-explanatory

T.StackView {
   popEnter : Transition{
      //code as you have it here
   }
}
This revision now requires changes to proceed.Apr 6 2019, 5:06 PM

So I made the changes in the qqc2-desktop-style repo. I'm new to arcanist and phabricator, should I make a new diff with the changes in qqc2-desktop-style and mark this one as depending on it (like said here) ?

Once the change to the QQC2 style repo has been made, then nothing should be required for the wallpaper chooser's code, right?

Unless I do import QtQuick.Templates 2.3 as T and replace QtControls.StackView with T.StackView inside the wallpaper chooser, it doesn't pick up what's inside the template. I've never used Qt Templates before, so I may be missing something.

Here's what I did inside QCC2 in a file named StackView.qml :

import QtQuick 2.1
import QtQuick.Window 2.2
import QtQuick.Templates @QQC2_VERSION@ as T
import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate
import org.kde.kirigami 2.4 as Kirigami

T.StackView {
    pushEnter: Transition {
        PropertyAnimation {
            property: "x"
            from: main.width
            to: 0
            duration: Kirigami.units.longDuration
        }
    }
    pushExit: Transition {
        PropertyAnimation {
            property: "x"
            from: 0
            to: -main.width
            duration: Kirigami.units.longDuration
        }
    }
    popEnter: Transition {
        PropertyAnimation {
            property: "x"
            from: main.width
            to: 0
            duration: Kirigami.units.longDuration
        }
    }
    popExit: Transition {
        PropertyAnimation {
            property: "x"
            from: 0
            to: -main.width
            duration: Kirigami.units.longDuration
        }
    }
    replaceEnter: Transition {
        PropertyAnimation {
            property: "x"
            from: main.width
            to: 0
            duration: Kirigami.units.longDuration
        }
    }
    replaceExit: Transition {
        PropertyAnimation {
            property: "x"
            from: 0
            to: -main.width
            duration: Kirigami.units.longDuration
        }
    }
}