• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kanagram

  • sources
  • kde-4.12
  • kdeedu
  • kanagram
  • src
  • harmattan
ListItem.qml
Go to the documentation of this file.
1 /******************************************************************************
2  * This file is part of the Gluon Development Platform
3  * Copyright (C) 2011 Laszlo Papp <lpapp@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 import QtQuick 1.1
21 import com.nokia.meego 1.0
22 import com.nokia.extras 1.0
23 
24 Rectangle {
25 
26  id: listItem;
27 
28  property string iconSource;
29  property string titleText;
30  property string subtitleText;
31 
32  property string iconId;
33  property bool iconVisible: false;
34 
35  property bool mousePressed: false;
36 
37  height: 64;
38  width: parent.width;
39 
40  color: "black";
41 
42  BorderImage {
43  id: background;
44  // Fill page orders
45  anchors {
46  fill: parent;
47  leftMargin: -16;
48  rightMargin: -16;
49  }
50 
51  visible: mousePressed;
52  source: theme.inverted ? "image://theme/meegotouch-panel-inverted-background-pressed" : "image://theme/meegotouch-panel-background-pressed";
53  }
54 
55  Row {
56  anchors.fill: parent;
57  spacing: 16;
58 
59  Image {
60  anchors.verticalCenter: parent.verticalCenter;
61  visible: true;
62  width: 48;
63  height: 48;
64  source: listItem.iconSource;
65  }
66 
67  Column {
68  anchors.verticalCenter: parent.verticalCenter;
69 
70  Label {
71  id: mainText
72  text: listItem.titleText;
73  font.family: "Nokia Pure Text";
74  font.weight: Font.Bold;
75  font.pixelSize: 26;
76  color: mousePressed ? "#797979" : "#ffffff";
77  }
78 
79  Label {
80  id: subText
81  text: listItem.subtitleText;
82  font.family: "Nokia Pure Text Light";
83  font.weight: Font.Normal;
84  font.pixelSize: 22;
85  color: mousePressed ? "#797979" : "#C8C8C8";
86 
87  visible: text != "";
88  }
89  }
90 
91  }
92 
93  Image {
94  function handleIconId() {
95  var prefix = "icon-m-";
96  // check if id starts with prefix and use it as is
97  // otherwise append prefix and use the inverted version if required
98  if (iconId.indexOf(prefix) !== 0)
99  iconId = prefix.concat(iconId).concat(theme.inverted ? "-inverse" : "");
100 
101  return "image://theme/" + iconId;
102  }
103 
104  visible: iconVisible;
105  source: handleIconId();
106  anchors {
107  right: parent.right;
108  verticalCenter: parent.verticalCenter;
109  }
110  }
111 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kanagram

Skip menu "kanagram"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal