diff options
Diffstat (limited to 'qml/touch/TouchLabel.qml')
-rw-r--r-- | qml/touch/TouchLabel.qml | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/qml/touch/TouchLabel.qml b/qml/touch/TouchLabel.qml new file mode 100644 index 0000000..bea6b3b --- /dev/null +++ b/qml/touch/TouchLabel.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Layouts 1.0 +import org.qtproject.demo.weather 1.0 + +Label { + id: label + property int pixelSize: 34 + property real letterSpacing: -0.25 + + font.family: "Open Sans" + font.pixelSize: pixelSize * ApplicationInfo.ratio * 1.1 // increasing fonts + font.letterSpacing: letterSpacing * ApplicationInfo.ratio + color: ApplicationInfo.colors.doubleDarkGray + verticalAlignment: Text.AlignBottom + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + linkColor: ApplicationInfo.colors.blue + + function expectedTextWidth(value) + { + dayText.text = value + return dayText.width + } + + property int maximumWidth: (ApplicationInfo.constants.isMobile ? ApplicationInfo.applicationWidth : 1120) / 4 + Layout.minimumWidth: Math.min(Layout.maximumWidth, implicitWidth + 1) + + Text { + id: dayText + visible: false + font.family: label.font.family + font.pixelSize: label.font.pixelSize + font.letterSpacing: label.font.letterSpacing + wrapMode: label.wrapMode + elide: label.elide + } +} |