Skip to content

Instantly share code, notes, and snippets.

@martonmiklos
Created October 13, 2016 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martonmiklos/5de1ac4cb15b281514fda37ca9186ba3 to your computer and use it in GitHub Desktop.
Save martonmiklos/5de1ac4cb15b281514fda37ca9186ba3 to your computer and use it in GitHub Desktop.
ProfileStatusIndicator.qml
GNU nano 2.2.6 File: /usr/share/lipstick-jolla-home-qt5/statusarea/ProfileStatusIndicator.qml
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd.
** Contact: Vesa Halttunen <vesa.halttunen@jollamobile.com>
**
****************************************************************************/
import QtQuick 2.0
import org.freedesktop.contextkit 1.0
Image {
id: profileStatusIndicator
property bool enabled: true
source: profileNameContextProperty.value == "silent" ? "image://theme/icon-status-silent" + iconSuffix : ""
width: source != "" ? implicitWidth : 0
height: source != "" ? implicitHeight : 0
ContextProperty {
id: profileNameContextProperty
key: "Profile.Name"
}
onEnabledChanged: {
if (enabled) {
profileNameContextProperty.subscribe()
} else {
profileNameContextProperty.unsubscribe()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment