Plasma

qml/Label.qml
1 /*
2 * Copyright (C) 2011 by Marco Martin <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
18 */
19 
20 import QtQuick 2.1
21 import QtQuick.Window 2.2
22 import QtQuick.Controls 1.0
23 import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate
24 import org.kde.plasma.core 2.0 as PlasmaCore
25 
38 Text {
39  id: root
40 
41  height: Math.round(Math.max(paintedHeight, PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height*1.6))
42  verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter
43 
44  activeFocusOnTab: false
45 
46  // Work around Qt bug where NativeRendering breaks for non-integer scale factors
47  // https://bugreports.qt.io/browse/QTBUG-70481
48  renderType: QtQuickControlsPrivate.Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering
49 
50  font.capitalization: PlasmaCore.Theme.defaultFont.capitalization
51  font.family: PlasmaCore.Theme.defaultFont.family
52  font.italic: PlasmaCore.Theme.defaultFont.italic
53  font.letterSpacing: PlasmaCore.Theme.defaultFont.letterSpacing
54  font.pointSize: PlasmaCore.Theme.defaultFont.pointSize
55  font.strikeout: PlasmaCore.Theme.defaultFont.strikeout
56  font.underline: PlasmaCore.Theme.defaultFont.underline
57  font.weight: PlasmaCore.Theme.defaultFont.weight
58  font.wordSpacing: PlasmaCore.Theme.defaultFont.wordSpacing
59  color: PlasmaCore.ColorScope.textColor
60 
61  opacity: enabled? 1 : 0.6
62 
63  Accessible.role: Accessible.StaticText
64  Accessible.name: text
65 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 6 2020 22:40:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.