Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/plasmacomponents3/Label.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import QtQuick.Window 2.2 | ||||
21 | import QtQuick.Templates @QQC2_VERSION@ as T | 22 | import QtQuick.Templates @QQC2_VERSION@ as T | ||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | 24 | | |||
24 | T.Label { | 25 | T.Label { | ||
25 | id: control | 26 | id: control | ||
26 | 27 | | |||
27 | verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter | 28 | verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter | ||
28 | 29 | | |||
29 | activeFocusOnTab: false | 30 | activeFocusOnTab: false | ||
30 | renderType: Text.NativeRendering | 31 | | ||
32 | // Work around Qt bug where NativeRendering breaks for non-integer scale factors | ||||
33 | // https://bugreports.qt.io/browse/QTBUG-67007 | ||||
34 | renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering | ||||
31 | 35 | | |||
32 | //font data is the system one by default | 36 | //font data is the system one by default | ||
33 | //TODO: from theme singleton? | 37 | //TODO: from theme singleton? | ||
34 | color: PlasmaCore.ColorScope.textColor | 38 | color: PlasmaCore.ColorScope.textColor | ||
35 | linkColor: theme.linkColor | 39 | linkColor: theme.linkColor | ||
36 | textFormat: Text.PlainText | 40 | textFormat: Text.PlainText | ||
37 | 41 | | |||
38 | opacity: enabled? 1 : 0.6 | 42 | opacity: enabled? 1 : 0.6 | ||
39 | 43 | | |||
40 | Accessible.role: Accessible.StaticText | 44 | Accessible.role: Accessible.StaticText | ||
41 | Accessible.name: text | 45 | Accessible.name: text | ||
42 | } | 46 | } |