Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: copy InhibitionHint from battery applet
Similar to [1]. [1] https://invent.kde.org/plasma/kscreen/-/commit/a0533d12
- Loading branch information
Showing
3 changed files
with
58 additions
and
35 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
plasma-integration/plasmoid/package/contents/ui/InhibitionHint.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
SPDX-FileCopyrightText: 2015 Kai Uwe Broulik <kde@privat.broulik.de> | ||
SPDX-License-Identifier: LGPL-2.0-or-later | ||
*/ | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
|
||
import org.kde.plasma.components 3.0 as PlasmaComponents3 | ||
import org.kde.kirigami 2.20 as Kirigami | ||
|
||
// everything like in battery applet, but slightly bigger | ||
RowLayout { | ||
property alias iconSource: iconItem.source | ||
property alias text: label.text | ||
|
||
spacing: Kirigami.Units.smallSpacing * 2 | ||
|
||
Kirigami.Icon { | ||
id: iconItem | ||
Layout.preferredWidth: Kirigami.Units.iconSizes.medium | ||
Layout.preferredHeight: Kirigami.Units.iconSizes.medium | ||
visible: valid | ||
} | ||
|
||
PlasmaComponents3.Label { | ||
id: label | ||
Layout.fillWidth: true | ||
Layout.maximumWidth: Math.min(Kirigami.Units.gridUnit * 20, implicitWidth) | ||
font: Kirigami.Theme.smallFont | ||
textFormat: Text.PlainText | ||
wrapMode: Text.WordWrap | ||
elide: Text.ElideRight | ||
maximumLineCount: 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters