Warning, /graphics/spectacle/src/Gui/SizeLabel.qml is written in an unsupported language. File is not indexed.
0001 /* SPDX-FileCopyrightText: 2022 Noah Davis <noahadvs@gmail.com> 0002 * SPDX-License-Identifier: LGPL-2.0-or-later 0003 */ 0004 0005 import QtQuick 0006 import QtQuick.Templates as T 0007 import org.kde.spectacle.private 0008 0009 T.Label { 0010 id: root 0011 property size size: Qt.size(0, 0) 0012 Binding on text { 0013 value: i18n("%1×%2", size.width, size.height) 0014 when: root.size.width > 0 && root.size.height > 0 0015 restoreMode: Binding.RestoreNone 0016 } 0017 textFormat: Text.PlainText 0018 horizontalAlignment: Text.AlignHCenter 0019 verticalAlignment: Text.AlignVCenter 0020 elide: Text.ElideNone 0021 wrapMode: Text.NoWrap 0022 color: palette.windowText 0023 background: Item { // Label implicit size is readonly, but you can still influence it via the background 0024 implicitWidth: contextWindow.dprRound(root.contentWidth + root.leftPadding + root.rightPadding) 0025 implicitHeight: contextWindow.dprRound(root.contentHeight + root.topPadding + root.bottomPadding) 0026 } 0027 }