-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5352 from opengisch/variable-editor-polish
Variable Editor: First step of redesign
- Loading branch information
Showing
4 changed files
with
199 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import QtQuick 2.14 | ||
import Theme 1.0 | ||
|
||
Flickable { | ||
id: flick | ||
boundsBehavior: Flickable.StopAtBounds | ||
flickableDirection: Flickable.HorizontalFlick | ||
clip: true | ||
|
||
required property real contentImplicitWidth | ||
default property alias contents: containerLayout.children | ||
property bool shouldAutoFlick: false | ||
property real duration: 3000 | ||
|
||
SequentialAnimation { | ||
id: mainAnim | ||
loops: 10 | ||
running: flick.shouldAutoFlick | ||
|
||
NumberAnimation { | ||
target: flick | ||
property: "contentX" | ||
to: -(flick.width - contentImplicitWidth) | ||
duration: flick.duration | ||
} | ||
|
||
PauseAnimation { | ||
duration: 1000 | ||
} | ||
|
||
NumberAnimation { | ||
target: flick | ||
property: "contentX" | ||
to: 0 | ||
duration: flick.duration | ||
} | ||
|
||
PauseAnimation { | ||
duration: 1000 | ||
} | ||
} | ||
|
||
Item { | ||
id: containerLayout | ||
} | ||
|
||
// if containerLayout is TextArea or TextField this function could be used to | ||
// handle text selection and showing cursor rectangle | ||
function ensureCursorVisible(cursorRectangle) { | ||
if (contentX >= cursorRectangle.x) { | ||
contentX = cursorRectangle.x | ||
} else if (contentX + width <= cursorRectangle.x + cursorRectangle.width) { | ||
contentX = cursorRectangle.x + cursorRectangle.width - width | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e065e51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Ta-daaa, freshly created APKs are available: arm64-android
Other architectures