syncthingtray/plasmoid/package/contents/ui/IconLabel.qml
Martchus 8ec133e62d Make the Plasmoid's Fork Awesome icon coloring react to theme changes
* 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
2022-05-30 20:36:03 +02:00

36 lines
840 B
QML

import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
Item {
property alias iconSource: iconItem.source
property alias iconOpacity: iconItem.opacity
property alias text: label.text
property alias tooltip: tooltipTrigger.tooltip
implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight
RowLayout {
id: layout
Image {
id: iconItem
Layout.preferredWidth: 16
Layout.preferredHeight: 16
height: 16
cache: false
fillMode: Image.PreserveAspectFit
}
PlasmaComponents3.Label {
id: label
}
}
ToolTipTrigger {
id: tooltipTrigger
anchors.fill: layout
}
}