GlobalDrawer

Search for usage in LXR

GlobalDrawer Class Reference

Properties

listTAction actions
 
bool collapseButtonVisible
 
alias content
 
TAction currentSubMenu
 
alias footer
 
alias header
 
bool isMenu
 
bool resetMenuOnTriggered
 
bool showContentWhenCollapsed
 
bool showHeaderWhenCollapsed
 
bool showTopContentWhenCollapsed
 
string title
 
var titleIcon
 
alias topContent
 

Public Member Functions

void resetMenu ()
 

Detailed Description

A specialized form of the 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 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"
}
]
}
}

Definition at line 45 of file GlobalDrawer.qml.

Property Documentation

◆ actions

listTAction 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 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"
}
]
}
}

Definition at line 103 of file GlobalDrawer.qml.

◆ collapseButtonVisible

bool GlobalDrawer::collapseButtonVisible
read

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

default: true

Since
2.12

Definition at line 227 of file GlobalDrawer.qml.

◆ content

alias 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 as Kirigami
Kirigami.ApplicationWindow {
[...]
globalDrawer: Kirigami.GlobalDrawer {
actions: [...]
Button {
text: "Button"
onClicked: //do stuff
}
}
[...]
}
Note
This is a default property.

Definition at line 167 of file GlobalDrawer.qml.

◆ currentSubMenu

TAction GlobalDrawer::currentSubMenu
read

This property points to the action acting as a submenu.

Remarks
This property is read-only

Definition at line 210 of file GlobalDrawer.qml.

◆ footer

alias GlobalDrawer::footer
read

This property holds an item that will always be displayed at the bottom 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
6.0

Definition at line 121 of file GlobalDrawer.qml.

◆ header

alias 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
2.12

Definition at line 112 of file GlobalDrawer.qml.

◆ isMenu

bool GlobalDrawer::isMenu
read

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

default: false

Since
2.11

Definition at line 218 of file GlobalDrawer.qml.

◆ resetMenuOnTriggered

bool 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 205 of file GlobalDrawer.qml.

◆ showContentWhenCollapsed

bool 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
2.5

Definition at line 194 of file GlobalDrawer.qml.

◆ showHeaderWhenCollapsed

bool GlobalDrawer::showHeaderWhenCollapsed
read

Definition at line 196 of file GlobalDrawer.qml.

◆ showTopContentWhenCollapsed

bool 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 collapsed property

default: false

Since
2.5

Definition at line 180 of file GlobalDrawer.qml.

◆ title

string GlobalDrawer::title
read

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

See also
org::kde::kirigami::private::BannerImage::title

Definition at line 58 of file GlobalDrawer.qml.

◆ titleIcon

var GlobalDrawer::titleIcon
read

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

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

Definition at line 65 of file GlobalDrawer.qml.

◆ topContent

alias GlobalDrawer::topContent
read

This property holds items that are displayed above the actions.

Example usage:

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

Definition at line 143 of file GlobalDrawer.qml.

Member Function Documentation

◆ resetMenu()

void GlobalDrawer::resetMenu ( )

This function reverts the menu back to its initial state.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:51:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.