diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2021-12-02 16:33:07 +0200 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2021-12-03 14:31:43 +0000 |
commit | 3f83fb91d620479b7465a4bd66ced1f8f5a5c5fe (patch) | |
tree | 57c25c780bc26cbaaffe02cbb7847bca04ccff0c /share | |
parent | 5a6c625c5e46aef442689a2bc691679da7a562db (diff) |
QmlDesigner: Animate item library controls' hovering
Added animation behavior for hovering. Also added top padding to the
search field so that the text is correctly aligned vertically.
Change-Id: I51273373aa43ceb3a3faca6a9f76b613fdd0be69
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
3 files changed, 26 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml index 1a2775e8f1..c2bf8fb4b8 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml @@ -42,6 +42,12 @@ Item { anchors.fill: parent color: mouseRegion.containsMouse ? StudioTheme.Values.themeControlBackgroundHover : StudioTheme.Values.themePanelBackground + Behavior on color { + ColorAnimation { + duration: StudioTheme.Values.hoverDuration + easing.type: StudioTheme.Values.hoverEasing + } + } Image { id: itemIcon // to be set by model diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml index 36c823ec63..c68891f331 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/LibraryHeader.qml @@ -96,6 +96,14 @@ Item { color: mouseArea.containsMouse && enabled ? StudioTheme.Values.themeControlBackgroundHover : StudioTheme.Values.themeControlBackground + + Behavior on color { + ColorAnimation { + duration: StudioTheme.Values.hoverDuration + easing.type: StudioTheme.Values.hoverEasing + } + } + enabled: index !== 0 || !rootView.subCompEditMode Label { // + sign @@ -150,13 +158,20 @@ Item { color: StudioTheme.Values.themeControlBackground border.color: StudioTheme.Values.themeControlOutline border.width: StudioTheme.Values.border + + Behavior on color { + ColorAnimation { + duration: StudioTheme.Values.hoverDuration + easing.type: StudioTheme.Values.hoverEasing + } + } } height: StudioTheme.Values.defaultControlHeight leftPadding: 32 rightPadding: 30 - + topPadding: 6 anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 5 diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index 031921c8ba..031e8d8946 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -91,6 +91,10 @@ QtObject { property real toolTipHeight: 25 property int toolTipDelay: 1000 + // Controls hover animation params + property int hoverDuration: 500 + property int hoverEasing: Easing.OutExpo + // Layout sizes property real sectionColumnSpacing: 20 // distance between label and sliderControlSize property real sectionRowSpacing: 5 |