org::kde::kirigami::AbstractApplicationWindow

Search for usage in LXR

org::kde::kirigami::AbstractApplicationWindow Class Reference
Inheritance diagram for org::kde::kirigami::AbstractApplicationWindow:

Properties

OverlayDrawer contextDrawer
 
bool controlsVisible
 
OverlayDrawer globalDrawer
 
Item pageStack
 
Action quitAction
 
bool reachableMode
 
bool reachableModeEnabled
 
bool wideScreen
 

Public Member Functions

void applicationWindow ()
 
void hidePassiveNotification ()
 
void showPassiveNotification (message, timeout, actionText, callBack)
 

Detailed Description

A window that provides some basic features needed for all apps Use this class only if you need a custom content for your application, different from the Page Row behavior recommended by the HIG and provided by ApplicationWindow.

It is recommended to use ApplicationWindow instead

See also
ApplicationWindow

It's usually used as a root QML component for the application. It provides support for a central page stack, side drawers and a top ApplicationHeader, as well as basic support for the Android back button

Setting a width and height property on the ApplicationWindow will set its initial size, but it won't set it as an automatically binding. to resize programmatically the ApplicationWindow they need to be assigned again in an imperative fashion

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
globalDrawer: Kirigami.GlobalDrawer {
actions: [
Kirigami.Action {
text: "View"
icon.name: "view-list-icons"
Kirigami.Action {
text: "action 1"
}
Kirigami.Action {
text: "action 2"
}
Kirigami.Action {
text: "action 3"
}
},
Kirigami.Action {
text: "Sync"
icon.name: "folder-sync"
}
]
}
contextDrawer: Kirigami.ContextDrawer {
}
pageStack: PageStack {
...
}
[...]
}

Definition at line 72 of file AbstractApplicationWindow.qml.

Property Documentation

OverlayDrawer org::kde::kirigami::AbstractApplicationWindow::contextDrawer

contextDrawer: OverlayDrawer The drawer for context-dependent actions, that will be opened by sliding from the right screen edge or by dragging the ActionButton to the left.

It is recommended to use the ContextDrawer class here. The contents of the context drawer should depend from what page is loaded in the main pageStack

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
contextDrawer: Kirigami.ContextDrawer {
}
[...]
}
import org.kde.kirigami 2.4 as Kirigami
Kirigami.Page {
[...]
contextualActions: [
Kirigami.Action {
icon.name: "edit"
text: "Action text"
onTriggered: {
// do stuff
}
},
Kirigami.Action {
icon.name: "edit"
text: "Action text"
onTriggered: {
// do stuff
}
}
]
[...]
}

When this page will be the current one, the context drawer will visualize contextualActions defined as property in that page.

Definition at line 187 of file AbstractApplicationWindow.qml.

bool org::kde::kirigami::AbstractApplicationWindow::controlsVisible

header: ApplicationHeader An item that can be used as a title for the application.

Scrolling the main page will make it taller or shorter (trough the point of going away) It's a behavior similar to the typical mobile web browser addressbar the minimum, preferred and maximum heights of the item can be controlled with

  • Layout.minimumHeight: default is 0, i.e. hidden
  • Layout.preferredHeight: default is Units.gridUnit * 1.6
  • Layout.maximumHeight: default is Units.gridUnit * 3

To achieve a titlebar that stays completely fixed just set the 3 sizes as the same //FIXME: this should become an actual ApplicationHeader controlsVisible: bool This property controls whether the standard chrome of the app, such as the Action button, the drawer handles and the application header should be visible or not.

Definition at line 124 of file AbstractApplicationWindow.qml.

OverlayDrawer org::kde::kirigami::AbstractApplicationWindow::globalDrawer

globalDrawer: OverlayDrawer The drawer for global actions, that will be opened by sliding from the left screen edge or by dragging the ActionButton to the right.

It is recommended to use the GlobalDrawer class here

Definition at line 131 of file AbstractApplicationWindow.qml.

Item org::kde::kirigami::AbstractApplicationWindow::pageStack

pageStack: StackView

The stack used to allocate the pages and to manage the transitions between them.

Put a container here, such as QQuickControls StackView

Definition at line 82 of file AbstractApplicationWindow.qml.

Action org::kde::kirigami::AbstractApplicationWindow::quitAction

A standard action that will quit the application when triggered.

Its properties have the following values:

Action {
text: "Quit"
icon.name: "application-exit-symbolic";
shortcut: StandardKey.Quit
[...]
Since
5.76
Remarks
This property is read-only

Definition at line 213 of file AbstractApplicationWindow.qml.

bool org::kde::kirigami::AbstractApplicationWindow::reachableMode

reachableMode: bool When true the application is in reachable mode for single hand use.

the whole content of the application is moved down the screen to be reachable with the thumb. if wideScreen is true, or reachableModeEnabled is false, tis property has no effect.

Definition at line 195 of file AbstractApplicationWindow.qml.

bool org::kde::kirigami::AbstractApplicationWindow::reachableModeEnabled

When true the application will go into reachable mode on pull down.

Definition at line 199 of file AbstractApplicationWindow.qml.

bool org::kde::kirigami::AbstractApplicationWindow::wideScreen

wideScreen: bool If true the application is considered to be in "widescreen" mode, such as on desktops or horizontal tablets.

Different styles can have an own logic for deciding this

Definition at line 137 of file AbstractApplicationWindow.qml.

Member Function Documentation

void org::kde::kirigami::AbstractApplicationWindow::applicationWindow ( )
Returns
a pointer to this application window can be used anywhere in the application.
void org::kde::kirigami::AbstractApplicationWindow::hidePassiveNotification ( )

Hide the passive notification, if any is shown.

void org::kde::kirigami::AbstractApplicationWindow::showPassiveNotification ( message  ,
timeout  ,
actionText  ,
callBack   
)

Shows a little passive notification at the bottom of the app window lasting for few seconds, with an optional action button.

Parameters
messageThe text message to be shown to the user.
timeoutHow long to show the message: possible values: "short", "long" or the number of milliseconds
actionTextText in the action button, if any.
callBackA JavaScript function that will be executed when the user clicks the button.

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat May 15 2021 22:38:13 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.