• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaExtraComponents

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • plasmaextracomponents
  • qml
App.qml
Go to the documentation of this file.
1 /*
2 * Copyright 2012 by Sebastian Kügler <sebas@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 1.1
21 import org.kde.plasma.core 0.1 as PlasmaCore
22 import org.kde.plasma.components 0.1 as PlasmaComponents
23 
60 Item {
61  id: app
66  property alias navigation: navigationItem.children
67 
72  property alias content: contentItem.children
73 
78  property alias tools: topBar.tools
79 
80  property alias contentArea: contentBackground
81  property int space: 20
82  property int navigationWidth: 340
83  property int contentWidth: app.width - navigationWidth - space*2
84 
85  PlasmaCore.Theme { id: theme }
86 
87  PlasmaComponents.ToolBar {
88  id: topBar
89  height: visible ? 48 : 0
90  //visible: tools.id != "undefined"
91  anchors { top: parent.top; left: parent.left; right: parent.right; }
92  //tools: PlasmaComponents.ToolBarLayout {}
93 
94  onToolsChanged: {
95  // FIXME: questionable heuristics
96  height = (tools && tools.childrenRect.width > 20) ? tools.childrenRect.height + space : 0
97  }
98  }
99 
100  Image {
101  id: contentBackground
102  anchors { left: navigationBackground.right; right: parent.right; top: topBar.bottom; bottom: parent.bottom; }
103  source: "image://appbackgrounds/standard"
104  fillMode: Image.Tile
105  asynchronous: true
106  //width: contentWidth
107  Item {
108  id: contentItem
109  //width: contentWidth - 100
110  height: app.height
111  anchors { left: parent.left; margins: space; top: parent.top; bottom: parent.bottom; right: parent.right; }
112  }
113 
114  }
115  Image {
116  id: navigationBackground
117  anchors { left: parent.left; top: topBar.bottom; bottom: parent.bottom; }
118  source: "image://appbackgrounds/contextarea"
119  fillMode: Image.Tile
120  asynchronous: true
121  clip: true
122  width: navigationWidth + space
123  Behavior on width {
124  NumberAnimation { duration: 250; easing.type: Easing.InOutExpo; }
125  }
126 
127  Item {
128  clip: true
129  id: navigationItem
130  anchors.fill: parent
131  }
132  }
133  Image {
134  source: "image://appbackgrounds/shadow-left"
135  fillMode: Image.Tile
136  anchors {
137  right: navigationBackground.right
138  top: topBar.bottom
139  bottom: parent.bottom
140  leftMargin: -1
141  }
142  }
143 
144  Image {
145  source: "image://appbackgrounds/shadow-bottom"
146  fillMode: Image.Tile
147  anchors {
148  right: navigationBackground.right
149  left: navigationBackground.left
150  top: topBar.bottom
151  //bottom: parent.bottom
152  //leftMargin: -1
153  }
154  }
155 
156  onContentChanged: {
157  print("content changed to ");
158  //content.parent = contentBackground;
159  //contentItem.width = contentWidth;
160  //contentItem.anchors.rightMargin = 100
161  }
162 
163  onNavigationWidthChanged: {
164  navigationBackground.width = navigationWidth;
165  navigationItem.width = navigationWidth;
166  }
167 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaExtraComponents

Skip menu "PlasmaExtraComponents"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

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