Changeset View
Changeset View
Standalone View
Standalone View
src/qml/TrackImportNotification.qml
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2017 Matthieu Gallien <matthieu_gallien@yahoo.fr> | 2 | * Copyright 2017-2019 Matthieu Gallien <matthieu_gallien@yahoo.fr> | ||
3 | * | 3 | * | ||
4 | * This program is free software: you can redistribute it and/or | 4 | * This program is free software: you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | 5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | 6 | * License as published by the Free Software Foundation; either | ||
7 | * version 3 of the License, or (at your option) any later version. | 7 | * version 3 of the License, or (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
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.7 | 18 | import QtQuick 2.10 | ||
19 | import QtQuick.Controls 2.2 | 19 | import QtQuick.Layouts 1.1 | ||
20 | import QtQuick.Controls 2.4 | ||||
20 | import org.kde.elisa 1.0 | 21 | import org.kde.elisa 1.0 | ||
21 | 22 | | |||
22 | Rectangle { | 23 | Rectangle { | ||
23 | id: rootComponent | 24 | id: rootComponent | ||
24 | 25 | | |||
25 | property bool indexingRunning | 26 | property bool indexingRunning | ||
26 | property int importedTracksCount | 27 | property int importedTracksCount | ||
27 | property MusicListenersManager musicManager | 28 | property MusicListenersManager musicManager | ||
28 | 29 | | |||
29 | color: myPalette.highlight | 30 | color: myPalette.highlight | ||
30 | 31 | | |||
31 | width: Math.max(elisaTheme.gridDelegateWidth * 1.5, labelWidth.width + 2 * elisaTheme.layoutHorizontalMargin) | 32 | width: Math.max(elisaTheme.gridDelegateWidth * 1.5, labelWidth.width + 2 * elisaTheme.layoutHorizontalMargin) + | ||
32 | height: elisaTheme.smallControlButtonSize * 1.5 | 33 | elisaTheme.smallControlButtonSize * 1.5 + 3 * elisaTheme.layoutHorizontalMargin | ||
34 | height: elisaTheme.smallControlButtonSize * 1.5 + 2 * elisaTheme.layoutHorizontalMargin | ||||
33 | 35 | | |||
34 | visible: opacity > 0 | 36 | visible: opacity > 0 | ||
35 | opacity: (indexingRunning ? 1 : 0) | 37 | opacity: 0 | ||
38 | | ||||
39 | RowLayout { | ||||
40 | anchors.fill: parent | ||||
41 | spacing: elisaTheme.layoutHorizontalMargin | ||||
42 | | ||||
43 | BusyIndicator{ | ||||
44 | } | ||||
36 | 45 | | |||
37 | Label { | 46 | Label { | ||
38 | id: importedTracksCountLabel | 47 | id: importedTracksCountLabel | ||
39 | anchors.centerIn: parent | 48 | text: (importedTracksCount ? | ||
40 | text: i18ncp("number of imported tracks", "Imported one track", "Imported %1 tracks", importedTracksCount) | 49 | i18ncp("number of imported tracks", | ||
50 | "Imported one track", | ||||
51 | "Imported %1 tracks", | ||||
52 | importedTracksCount) : | ||||
53 | i18nc("message to show when Elisa is scanning music files", "Scanning music")) | ||||
41 | color: myPalette.highlightedText | 54 | color: myPalette.highlightedText | ||
55 | | ||||
56 | Layout.fillWidth: true | ||||
57 | Layout.fillHeight: true | ||||
58 | } | ||||
42 | } | 59 | } | ||
43 | 60 | | |||
44 | TextMetrics { | 61 | TextMetrics { | ||
45 | id: labelWidth | 62 | id: labelWidth | ||
46 | 63 | | |||
47 | text: i18ncp("number of imported tracks", "Imported one track", "Imported %1 tracks", 999999) | 64 | text: i18ncp("number of imported tracks", "Imported one track", "Imported %1 tracks", 999999) | ||
48 | } | 65 | } | ||
49 | 66 | | |||
Show All 27 Lines |