Warning, /plasma/plasma-mobile/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2021 Devin Lin <espidev@gmail.com>
0003  *  SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 import QtQuick
0009 import QtQuick.Layouts
0010 
0011 import org.kde.plasma.core as PlasmaCore
0012 import org.kde.plasma.components 3.0 as PlasmaComponents
0013 import org.kde.kirigami as Kirigami
0014 import org.kde.plasma.private.mobileshell as MobileShell
0015 
0016 Item {
0017     property InternetIndicator internetIndicator
0018         
0019     // check if the internet indicator icon is a mobile data related one
0020     readonly property bool isInternetIndicatorMobileData: internetIndicator && internetIndicator.icon && internetIndicator.icon.startsWith('network-mobile-')
0021     
0022     property bool showLabel: true
0023     property real textPixelSize: Kirigami.Units.gridUnit * 0.6
0024     
0025     width: strengthIcon.width + label.width
0026     Layout.minimumWidth: strengthIcon.width + label.width
0027 
0028     Kirigami.Icon {
0029         id: strengthIcon
0030         anchors.left: parent.left
0031         anchors.verticalCenter: parent.verticalCenter
0032         width: height
0033         height: parent.height
0034 
0035         source: MobileShell.SignalStrengthInfo.icon
0036         
0037         // don't show mobile indicator icon if the networkmanager one is already showing
0038         visible: !isInternetIndicatorMobileData && MobileShell.SignalStrengthInfo.showIndicator
0039     }
0040     
0041     PlasmaComponents.Label {
0042         id: label
0043         visible: showLabel
0044         width: visible ? implicitWidth : 0
0045         anchors.leftMargin: Kirigami.Units.smallSpacing
0046         anchors.left: strengthIcon.right
0047         anchors.verticalCenter: parent.verticalCenter
0048 
0049         text: MobileShell.SignalStrengthInfo.label
0050         color: Kirigami.Theme.textColor
0051         font.pixelSize: textPixelSize
0052     }
0053 }