Changeset View
Changeset View
Standalone View
Standalone View
src/controls/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 2.010-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import org.kde.kirigami 1.0 | 21 | import org.kde.kirigami 2.0 | ||
22 | import QtQuick.Templates 2.0 as T2 | ||||
22 | 23 | | |||
23 | /** | 24 | /** | ||
24 | * This is a label which uses the plasma Theme. | 25 | * This is a label which uses the plasma Theme. | ||
25 | * | 26 | * | ||
26 | * The characteristics of the text will be automatically set according to the | 27 | * The characteristics of the text will be automatically set according to the | ||
27 | * plasma Theme. If you need a more customized text item use the Text component | 28 | * plasma Theme. If you need a more customized text item use the Text component | ||
28 | * from QtQuick. | 29 | * from QtQuick. | ||
29 | * | 30 | * | ||
30 | * You can use all elements of the QML Text component, in particular the "text" | 31 | * You can use all elements of the QML Text component, in particular the "text" | ||
31 | * property to define the label text. | 32 | * property to define the label text. | ||
32 | * | 33 | * | ||
33 | * @inherit QtQuick.Text | 34 | * @inherit QtQuick.Text | ||
34 | */ | 35 | */ | ||
35 | Text { | 36 | T2.Label { | ||
36 | id: root | 37 | id: root | ||
37 | 38 | | |||
38 | height: Math.round(Math.max(paintedHeight, Units.gridUnit * 1.6)) | 39 | height: Math.round(Math.max(paintedHeight, Units.gridUnit * 1.6)) | ||
39 | verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter | 40 | verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter | ||
40 | 41 | | |||
41 | activeFocusOnTab: false | 42 | activeFocusOnTab: false | ||
42 | renderType: Text.NativeRendering | 43 | renderType: Text.NativeRendering | ||
43 | 44 | | |||
Show All 16 Lines |