• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. Kirigami
  • KDE Home
  • Contact Us

Quick Links

Skip menu "Kirigami"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Related Pages

Class Picker

About

QtQuick plugins to build user interfaces based on the KDE UX guidelines

Maintainer
Marco Martin
Supported platforms
Android, Linux
Community
IRC: #plasma on Freenode
Mailing list: plasma-devel
Use with CMake
find_package(KF5Kirigami)
target_link_libraries(yourapp KF5::Kirigami)
Clone
git clone git://anongit.kde.org/kirigami1.git
Browse source
Kirigami on cgit.kde.org

Kirigami

  • src
  • controls
AbstractApplicationWindow.qml
1 /*
2  * Copyright 2015 Marco Martin <mart@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2 or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 import QtQuick 2.5
21 import QtQuick.Controls 1.3 as Controls
22 import "templates/private"
23 import org.kde.kirigami 1.0
24 import QtGraphicalEffects 1.0
25 
80 Controls.ApplicationWindow {
81  id: root
82 
90  property Item pageStack
91 
103  function showPassiveNotification(message, timeout, actionText, callBack) {
104  if (!internal.__passiveNotification) {
105  var component = Qt.createComponent("templates/private/PassiveNotification.qml");
106  internal.__passiveNotification = component.createObject(contentItem.parent);
107  }
108 
109  internal.__passiveNotification.showNotification(message, timeout, actionText, callBack);
110  }
111 
115  function hidePassiveNotification() {
116  if(internal.__passiveNotification) {
117  internal.__passiveNotification.hideNotification();
118  }
119  }
120 
121 
126  function applicationWindow() {
127  return root;
128  }
129 
143  property var header: undefined
144 
151  property bool controlsVisible: true
152 
159  property AbstractDrawer globalDrawer
160 
166  property bool wideScreen: width >= Units.gridUnit * 60
167 
217  property AbstractDrawer contextDrawer
218 
226  property bool reachableMode: false
227 
228  MouseArea {
229  parent: contentItem.parent
230  z: -1
231  anchors.fill: parent
232  onClicked: root.reachableMode = false;
233  visible: root.reachableMode
234  Rectangle {
235  anchors.fill: parent
236  color: Qt.rgba(0, 0, 0, 0.3)
237  opacity: 0.15
238  Icon {
239  anchors.horizontalCenter: parent.horizontalCenter
240  y: x
241  width: Units.iconSizes.large
242  height: width
243  source: "go-up"
244  }
245  }
246  }
247 
248  contentItem.anchors.topMargin: root.wideScreen && header && controlsVisible ? header.height : 0
249  contentItem.anchors.leftMargin: root.globalDrawer && (root.globalDrawer.modal === false) ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0
250  contentItem.anchors.rightMargin: root.contextDrawer && root.contextDrawer.modal === false ? root.contextDrawer.contentItem.width * root.contextDrawer.position : 0
251  contentItem.transform: Translate {
252  Behavior on y {
253  NumberAnimation {
254  duration: Units.longDuration
255  easing.type: Easing.InOutQuad
256  }
257  }
258  y: root.reachableMode && !root.wideScreen ? root.height/2 : 0
259  x: root.globalDrawer && root.globalDrawer.modal === true && root.globalDrawer.toString().indexOf("SplitDrawer") === 0 ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0
260  }
261  //Don't want overscroll in landscape mode
262  onWidthChanged: {
263  if (width > height) {
264  root.reachableMode = false;
265  }
266  }
267 
268  Binding {
269  when: globalDrawer !== undefined
270  target: globalDrawer
271  property: "parent"
272  value: contentItem.parent
273  }
274  Binding {
275  when: contextDrawer !== undefined
276  target: contextDrawer
277  property: "parent"
278  value: contentItem.parent
279  }
280  onPageStackChanged: pageStack.parent = contentItem;
281 
282  width: Units.gridUnit * 30
283  height: Units.gridUnit * 45
284  visible: true
285 
286 
287  QtObject {
288  id: internal
289  property Item __passiveNotification
290  }
291 
292  Shortcut {
293  sequence: StandardKey.Quit
294  onActivated: root.close()
295  }
296 }
org::kde::kirigami::Units::longDuration
int longDuration
units.longDuration should be used for longer, screen-covering animations, for opening and closing of ...
Definition: controls/Units.qml:75
org::kde::kirigami::Units::gridUnit
int gridUnit
The fundamental unit of space that should be used for sizes, expressed in pixels. ...
Definition: controls/Units.qml:31
org::kde::kirigami::Units
Definition: controls/Units.qml:24
org::kde::kirigami::Units::iconSizes
QtObject iconSizes
units.iconSizes provides access to platform-dependent icon sizing
Definition: controls/Units.qml:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2017 The KDE developers.
Generated on Fri Feb 17 2017 11:09:23 by doxygen 1.8.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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