• Skip to content
  • Skip to link menu
KDE API Documentation - DialogBackground.qml Source File (GCompris-qt)
  • KDE Home
  • Contact Us
 

GCompris-qt

  • src
  • core
DialogBackground.qml
1 /* GCompris - dialogBackground.qml
2  *
3  * Copyright (C) 2014 Bruno Coudoin <bruno.coudoin@gcompris.net>
4  *
5  * Authors:
6  * Bruno Coudoin <bruno.coudoin@gcompris.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, see <http://www.gnu.org/licenses/>.
20  */
21 import QtQuick 2.2
22 import QtQuick.Controls 1.0
23 import GCompris 1.0
24 
38 Rectangle {
39  id: dialogBackground
40  color: "#696da3"
41  border.color: "black"
42  border.width: 1
43  z: 1000
44  property bool isDialog: true
45  property string title
46  property alias titleIcon: titleIcon.source
47  property string content
48  signal close
49  signal start
50  signal pause
51  signal play
52  signal stop
53 
54  Row {
55  spacing: 2
56  Item { width: 10; height: 1 }
57 
58  Column {
59  spacing: 10
60  anchors.top: parent.top
61  Item { width: 1; height: 10 }
62  Rectangle {
63  color: "#e6e6e6"
64  radius: 6.0
65  width: dialogBackground.width - 30
66  height: title.height * 1.2
67  border.color: "black"
68  border.width: 2
69 
70  Image {
71  id: titleIcon
72  anchors {
73  left: parent.left
74  top: parent.top
75  margins: 4 * ApplicationInfo.ratio
76  }
77  }
78 
79  GCText {
80  id: title
81  text: dialogBackground.title
82  width: dialogBackground.width - 30
83  horizontalAlignment: Text.AlignHCenter
84  verticalAlignment: Text.AlignVCenter
85  color: "black"
86  fontSize: 20
87  font.weight: Font.DemiBold
88  wrapMode: Text.WordWrap
89  }
90  }
91  Rectangle {
92  color: "#e6e6e6"
93  radius: 6.0
94  width: dialogBackground.width - 30
95  height: dialogBackground.height - 100
96  border.color: "black"
97  border.width: 2
98  anchors.margins: 100
99 
100  Flickable {
101  id: flick
102  anchors.margins: 8
103  anchors.fill: parent
104  contentWidth: textContent.contentWidth
105  contentHeight: textContent.contentHeight
106  flickableDirection: Flickable.VerticalFlick
107  clip: true
108 
109  GCText {
110  id: textContent
111  text: style + "<body>" + content + "</body>"
112  width: flick.width
113  height: flick.height
114  fontSize: regularSize
115  wrapMode: TextEdit.Wrap
116  textFormat: TextEdit.RichText
117  Component.onCompleted: ApplicationInfo.isDownloadAllowed ?
118  linkActivated.connect(Qt.openUrlExternally) : null
119 
120  property string style: ApplicationInfo.isDownloadAllowed ?
121  "<HEAD><STYLE type='text/css'>A {color: blue;}</STYLE></HEAD>" :
122  "<HEAD><STYLE type='text/css'>A {color: black;}</STYLE></HEAD>"
123  }
124  }
125  }
126  Item { width: 1; height: 10 }
127  }
128  }
129 
130  // The cancel button
131  GCButtonCancel {
132  onClose: parent.close()
133  }
134 
135 }
GCButtonCancel
A QML component representing GCompris' cancel button.
Definition: GCButtonCancel.qml:30
GCText
A QML component unifying text presentation in GCompris.
Definition: GCText.qml:47
QtQuick
ApplicationInfo::isDownloadAllowed
bool isDownloadAllowed
Download allowed.
Definition: ApplicationInfo.h:137
GCompris
ApplicationInfo
A general purpose singleton that exposes miscellaneous native functions to the QML layer...
Definition: ApplicationInfo.h:43
ApplicationInfo::ratio
qreal ratio
Ratio factor used for scaling of sizes on high-dpi devices.
Definition: ApplicationInfo.h:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:47 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GCompris-qt

Skip menu "GCompris-qt"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Modules

Class Picker

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