Changeset View
Changeset View
Standalone View
Standalone View
src/qml/TrackImportNotification.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public License | 14 | * You should have received a copy of the GNU Lesser General Public License | ||
15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | import QtQuick 2.10 | 18 | import QtQuick 2.10 | ||
19 | import QtQuick.Layouts 1.1 | 19 | import QtQuick.Layouts 1.1 | ||
20 | import QtQuick.Controls 2.4 | 20 | import QtQuick.Controls 2.4 | ||
21 | import org.kde.kirigami 2.5 as Kirigami | ||||
21 | import org.kde.elisa 1.0 | 22 | import org.kde.elisa 1.0 | ||
22 | 23 | | |||
24 | /* | ||||
25 | * This visually mimics the Kirigami.InlineMessage due to the | ||||
26 | * BusyIndicator, which is not supported by the InlineMessage. | ||||
27 | * Consider implementing support for the BusyIndicator within | ||||
28 | * the InlineMessage in the future. | ||||
29 | */ | ||||
23 | Rectangle { | 30 | Rectangle { | ||
24 | id: rootComponent | 31 | id: rootComponent | ||
25 | 32 | | |||
26 | property bool indexingRunning | 33 | property bool indexingRunning | ||
27 | property int importedTracksCount | 34 | property int importedTracksCount | ||
28 | property MusicListenersManager musicManager | | |||
29 | 35 | | |||
30 | color: myPalette.highlight | 36 | color: Kirigami.Theme.activeTextColor | ||
31 | 37 | | |||
32 | width: Math.max(elisaTheme.gridDelegateWidth * 1.5, (labelWidth.boundingRect.width - labelWidth.boundingRect.x) + 2 * elisaTheme.layoutHorizontalMargin) + | 38 | width: (labelWidth.boundingRect.width - labelWidth.boundingRect.x) + 3 * elisaTheme.layoutHorizontalMargin + | ||
33 | elisaTheme.smallControlButtonSize * 1.5 + 3 * elisaTheme.layoutHorizontalMargin | 39 | indicator.width | ||
34 | height: elisaTheme.smallControlButtonSize * 1.5 + 2 * elisaTheme.layoutHorizontalMargin | 40 | height: indicator.height | ||
35 | 41 | | |||
36 | visible: opacity > 0 | 42 | visible: opacity > 0 | ||
37 | opacity: 0 | 43 | opacity: 0 | ||
38 | 44 | | |||
45 | radius: Kirigami.Units.smallSpacing / 2 | ||||
46 | | ||||
47 | Rectangle { | ||||
48 | id: bgFillRect | ||||
49 | | ||||
50 | anchors.fill: parent | ||||
51 | anchors.margins: Kirigami.Units.devicePixelRatio | ||||
52 | | ||||
53 | color: Kirigami.Theme.backgroundColor | ||||
54 | | ||||
55 | radius: rootComponent.radius * 0.60 | ||||
56 | } | ||||
57 | | ||||
58 | Rectangle { | ||||
59 | anchors.fill: bgFillRect | ||||
60 | | ||||
61 | color: rootComponent.color | ||||
62 | | ||||
63 | opacity: 0.20 | ||||
64 | | ||||
65 | radius: bgFillRect.radius | ||||
66 | } | ||||
67 | | ||||
39 | RowLayout { | 68 | RowLayout { | ||
40 | anchors.fill: parent | 69 | anchors.fill: parent | ||
41 | spacing: elisaTheme.layoutHorizontalMargin | 70 | spacing: elisaTheme.layoutHorizontalMargin | ||
42 | 71 | | |||
43 | BusyIndicator{ | 72 | BusyIndicator{ | ||
73 | id: indicator | ||||
44 | } | 74 | } | ||
45 | 75 | | |||
46 | Label { | 76 | Label { | ||
47 | id: importedTracksCountLabel | 77 | id: importedTracksCountLabel | ||
48 | text: (importedTracksCount ? | 78 | text: (importedTracksCount ? | ||
49 | i18ncp("number of imported tracks", | 79 | i18ncp("number of imported tracks", | ||
50 | "Imported one track", | 80 | "Imported one track", | ||
51 | "Imported %1 tracks", | 81 | "Imported %1 tracks", | ||
52 | importedTracksCount) : | 82 | importedTracksCount) : | ||
53 | i18nc("message to show when Elisa is scanning music files", "Scanning music")) | 83 | i18nc("message to show when Elisa is scanning music files", "Scanning music")) | ||
54 | color: myPalette.highlightedText | 84 | color: Kirigami.Theme.textColor | ||
55 | 85 | | |||
56 | Layout.fillWidth: true | 86 | Layout.fillWidth: true | ||
57 | Layout.fillHeight: true | 87 | Layout.fillHeight: true | ||
58 | } | 88 | } | ||
59 | } | 89 | } | ||
60 | 90 | | |||
61 | TextMetrics { | 91 | TextMetrics { | ||
62 | id: labelWidth | 92 | id: labelWidth | ||
Show All 31 Lines |