Replace unified search text field busy indicator with custom indicator

Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
Claudio Cambra 2022-07-18 17:22:56 +02:00
parent b37ca499b6
commit b1deb6cd1d
4 changed files with 63 additions and 18 deletions

View File

@ -33,5 +33,6 @@
<file>src/gui/tray/ActivityItemContent.qml</file>
<file>src/gui/tray/TalkReplyTextField.qml</file>
<file>src/gui/tray/CallNotificationDialog.qml</file>
<file>src/gui/tray/NCBusyIndicator.qml</file>
</qresource>
</RCC>

View File

@ -0,0 +1,50 @@
/*
* Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
import Style 1.0
BusyIndicator {
id: root
property color color: Style.ncSecondaryTextColor
property string imageSource: "image://svgimage-custom-color/change.svg/"
contentItem: Image {
id: contentImage
property bool colourableImage: root.color && root.imageSource.startsWith("image://svgimage-custom-color/")
horizontalAlignment: Image.AlignHCenter
verticalAlignment: Image.AlignVCenter
source: colourableImage ? root.imageSource + root.color : root.imageSource
sourceSize.width: 64
sourceSize.height: 64
fillMode: Image.PreserveAspectFit
mipmap: true
RotationAnimator {
target: contentImage
running: root.running
onRunningChanged: contentImage.rotation = 0
from: 0
to: 360
loops: Animation.Infinite
duration: 3000
}
}
}

View File

@ -17,7 +17,7 @@ RowLayout {
id: syncStatus
}
Image {
NCBusyIndicator {
id: syncIcon
property int size: Style.trayListItemIconSize * 0.6
property int whiteSpace: (Style.trayListItemIconSize - size)
@ -31,19 +31,10 @@ RowLayout {
Layout.bottomMargin: 16
Layout.leftMargin: Style.trayHorizontalMargin + (whiteSpace * (0.5 - Style.thumbnailImageSizeReduction))
source: syncStatus.syncIcon
sourceSize.width: 64
sourceSize.height: 64
rotation: syncStatus.syncing ? 0 : 0
}
RotationAnimator {
target: syncIcon
running: syncStatus.syncing
from: 0
to: 360
loops: Animation.Infinite
duration: 3000
padding: 0
imageSource: syncStatus.syncIcon
running: syncStatus.syncing
}
ColumnLayout {

View File

@ -58,10 +58,9 @@ TextField {
sourceSize: Qt.size(parent.height * parent.textFieldIconsScaleFactor, parent.height * parent.textFieldIconsScaleFactor)
}
BusyIndicator {
id: trayWindowUnifiedSearchTextFieldIconInProgress
running: visible
visible: trayWindowUnifiedSearchTextField.isSearchInProgress
NCBusyIndicator {
id: busyIndicator
anchors {
left: trayWindowUnifiedSearchTextField.left
bottom: trayWindowUnifiedSearchTextField.bottom
@ -70,7 +69,11 @@ TextField {
bottomMargin: 4
verticalCenter: trayWindowUnifiedSearchTextField.verticalCenter
}
width: height
color: trayWindowUnifiedSearchTextField.textFieldIconsColor
visible: trayWindowUnifiedSearchTextField.isSearchInProgress
running: visible
}
Image {