~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to plasma/declarativeimports/plasmacomponents/qml/Label.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
*   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
18
*/
19
19
 
20
 
/**Documentanted API
 
20
/**Documented API
21
21
Inherits:
22
 
        Item
 
22
        Text
23
23
 
24
24
Imports:
25
 
        QtQuick 1.0
 
25
        QtQuick 1.1
26
26
        org.kde.plasma.core
27
27
 
28
28
Description:
29
 
 TODO i need more info here
 
29
    This is a label which uses the plasma theme.
 
30
    The characteristics of the text will be automatically set
 
31
    according to the plasma theme. If you need a more customized
 
32
    text item use the Text component from QtQuick.
 
33
 
 
34
Properties:
 
35
    string text:
 
36
    The most important property is "text".
 
37
    For the other ones see the primitive QML Text element
 
38
 
 
39
Methods:
 
40
    See the primitive QML Text element
 
41
 
 
42
Signals:
 
43
    See the primitive QML Text element
30
44
**/
31
45
 
32
 
import QtQuick 1.0
 
46
import QtQuick 1.1
33
47
import org.kde.plasma.core 0.1 as PlasmaCore
34
48
 
35
49
Text {
36
50
    id: root
37
51
 
38
52
    height: Math.max(paintedHeight, theme.defaultFont.mSize.height*1.6)
39
 
    //FIXME: wait to rely on 1.1 for lineCount > 1
40
 
    verticalAlignment: paintedHeight > theme.defaultFont.mSize.height*1.5 ? Text.AlignTop : Text.AlignVCenter
 
53
    verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter
41
54
 
42
55
    font.capitalization: theme.defaultFont.capitalization
43
56
    font.family: theme.defaultFont.family