org::kde::kirigami::GlobalDrawer

Search for usage in LXR

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

Properties

list< QtObject > actions
 
alias bannerImageSource
 
bool bannerVisible
 
bool collapseButtonVisible
 
alias content
 
Action currentSubMenu
 
Item header
 
bool isMenu
 
bool resetMenuOnTriggered
 
bool showContentWhenCollapsed
 
bool showHeaderWhenCollapsed
 
bool showTopContentWhenCollapsed
 
alias title
 
alias titleIcon
 
alias topContent
 
- Properties inherited from org::kde::kirigami::templates::OverlayDrawer
QtObject __internal
 
bool animating
 
bool collapsed
 
int collapsedSize
 
bool collapsible
 
bool drawerOpen
 
Item handle
 
string handleClosedToolTip
 
string handleOpenToolTip
 
bool handleVisible
 
IconPropertiesGroup
 
bool peeking
 

Signals

void bannerClicked ()
 

Public Member Functions

void resetMenu ()
 

Detailed Description

A specialized form of the QtQuick.Controls.Drawer intended for showing an application's always-available global actions.

Think of it like a mobile version of a desktop application's menubar.

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
globalDrawer: Kirigami.GlobalDrawer {
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"
}
]
}
[...]
}
See also
Global Drawers in Kirigami
Human Interface Guidelines on Global Drawers
KDE Human Interface Guidelines' Short Introduction of Global Drawers

Definition at line 51 of file GlobalDrawer.qml.

Property Documentation

◆ actions

list< Action > org::kde::kirigami::GlobalDrawer::actions
read

This property holds the actions displayed in the drawer.

The list of actions can be nested having a tree structure. A tree depth bigger than 2 is discouraged.

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
globalDrawer: Kirigami.GlobalDrawer {
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"
}
]
}
[...]
}

Definition at line 116 of file GlobalDrawer.qml.

◆ bannerImageSource

url org::kde::kirigami::GlobalDrawer::bannerImageSource
read

This property holds the banner image source.

See also
kirigami::ShadowedImage::source

Definition at line 77 of file GlobalDrawer.qml.

◆ bannerVisible

bool org::kde::kirigami::GlobalDrawer::bannerVisible
read

This property sets drawers banner visibility.

If true, the banner area (which can contain an image, an icon, and a title) will be visible.

default: the banner will be visible only on mobile platforms

Since
org.kde.kirigami 2.12

Definition at line 136 of file GlobalDrawer.qml.

◆ collapseButtonVisible

bool org::kde::kirigami::GlobalDrawer::collapseButtonVisible
read

This property sets the visibility of the collapse button when the drawer collapsible.

default: true

Since
org.kde.kirigami 2.12

Definition at line 242 of file GlobalDrawer.qml.

◆ content

list< QtObject > org::kde::kirigami::GlobalDrawer::content
read

This property holds items that are displayed under the actions.

Remarks
This is the default property

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
globalDrawer: Kirigami.GlobalDrawer {
actions: [...]
text: "Button"
onClicked: //do stuff
}
}
[...]
}
Note
This is a default property.

Definition at line 182 of file GlobalDrawer.qml.

◆ currentSubMenu

Action org::kde::kirigami::GlobalDrawer::currentSubMenu
read

This property points to the action acting as a submenu.

Remarks
This property is read-only

Definition at line 225 of file GlobalDrawer.qml.

◆ header

Item org::kde::kirigami::GlobalDrawer::header
read

This property holds an item that will always be displayed at the top of the drawer.

If the drawer contents can be scrolled, this item will stay still and won't scroll.

Note
This property is mainly intended for toolbars.
Since
org.kde.kirigami 2.12

Definition at line 125 of file GlobalDrawer.qml.

◆ isMenu

bool org::kde::kirigami::GlobalDrawer::isMenu
read

This property sets whether the drawer becomes a menu on the desktop.

default: false

Since
org.kde.kirigami 2.11

Definition at line 233 of file GlobalDrawer.qml.

◆ resetMenuOnTriggered

bool org::kde::kirigami::GlobalDrawer::resetMenuOnTriggered
read

This property sets whether activating a leaf action resets the menu to show leaf's parent actions.

A leaf action is an action without any child actions.

default: true

Definition at line 220 of file GlobalDrawer.qml.

◆ showContentWhenCollapsed

bool org::kde::kirigami::GlobalDrawer::showContentWhenCollapsed
read

This property sets whether content items at the bottom should be shown.

when the drawer is collapsed as a sidebar.

If you want to keep some items visible and some invisible, set this to false and control the visibility/opacity of individual items, binded to the collapsed property

default: false

See also
::content
Since
org.kde.kirigami 2.5

Definition at line 209 of file GlobalDrawer.qml.

◆ showTopContentWhenCollapsed

bool org::kde::kirigami::GlobalDrawer::showTopContentWhenCollapsed
read

This property sets whether content items at the top should be shown.

when the drawer is collapsed as a sidebar.

If you want to keep some items visible and some invisible, set this to false and control the visibility/opacity of individual items, binded to the OverlayDrawer.collapsed property.

default: false

Since
org.kde.kirigami 2.5

Definition at line 195 of file GlobalDrawer.qml.

◆ title

string org::kde::kirigami::GlobalDrawer::title
read

This property holds the title displayed at the top of the drawer.

See also
kirigami::private::BannerImage::title

Definition at line 64 of file GlobalDrawer.qml.

◆ titleIcon

var org::kde::kirigami::GlobalDrawer::titleIcon
read

This property holds an icon to be displayed alongside the title.

See also
kirigami::private::BannerImage::titleIcon
Icon::source

Definition at line 71 of file GlobalDrawer.qml.

◆ topContent

list< QtObject > org::kde::kirigami::GlobalDrawer::topContent
read

This property holds items that are displayed above the actions.

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
globalDrawer: Kirigami.GlobalDrawer {
actions: [...]
text: "Button"
onClicked: //do stuff
}]
}
[...]
}

Definition at line 158 of file GlobalDrawer.qml.

Member Function Documentation

◆ bannerClicked

void org::kde::kirigami::GlobalDrawer::bannerClicked ( )
signal

This signal notifies that the banner has been clicked.

◆ resetMenu()

void org::kde::kirigami::GlobalDrawer::resetMenu ( )

This function reverts the menu back to its initial state.


The documentation for this class was generated from the following file:
alias topContent
This property holds items that are displayed above the actions.
list< QtObject > actions
This property holds the actions displayed in the drawer.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 04:01:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.