* Make the Fork Awesome image provider URL a property and change its value if the Plasmoid's theme changes to cause Qt Quick to redraw images * Turn caching of Image objects off so Qt Quick actually fetches the images again from the image provider * Change the URL only back after returning to the event loop; otherwise Qt Quick apparently does not react to the property change * See https://github.com/Martchus/syncthingtray/issues/126
26 lines
826 B
QML
26 lines
826 B
QML
import QtQuick 2.7
|
|
import QtQuick.Layouts 1.1
|
|
|
|
RowLayout {
|
|
id: rowLayout
|
|
property var statistics
|
|
property string context: "?"
|
|
|
|
IconLabel {
|
|
iconSource: plasmoid.nativeInterface.faUrl + "file-o"
|
|
text: statistics.files !== undefined ? statistics.files : "?"
|
|
tooltip: context + qsTr(" files")
|
|
}
|
|
IconLabel {
|
|
iconSource: plasmoid.nativeInterface.faUrl + "folder-o"
|
|
text: statistics.dirs !== undefined ? statistics.dirs : "?"
|
|
tooltip: context + qsTr(" directories")
|
|
}
|
|
IconLabel {
|
|
iconSource: plasmoid.nativeInterface.faUrl + "hdd-o"
|
|
text: statistics.bytes !== undefined ? plasmoid.nativeInterface.formatFileSize(
|
|
statistics.bytes) : "?"
|
|
tooltip: context + qsTr(" size")
|
|
}
|
|
}
|