Skip to content

Add NavigationToolBar component

Devin Lin requested to merge work/navtoolbar into master

Add a navbar component that can easily be added to application window footers. Replaces the custom components used in kclock and plasma-dialer.

TODO: Add more documentation

kclock:

image

kasts:

image

koko:

image

image

Kirigami.ApplicationWindow {
footer: Kirigami.NavigationToolBar {
    actions: [
        Kirigami.Action {
            iconName: "clock"
            text: i18n("Time")
            checked: appwindow.getPage("Time") === appwindow.pageStack.currentItem
            onTriggered: {
                    appwindow.switchToPage(appwindow.getPage("Time"), 0);
            }
        },
        Kirigami.Action {
            iconName: "player-time"
            text: i18n("Timers")
            checked: appwindow.getPage("Timers") === appwindow.pageStack.currentItem
            onTriggered: {
                    appwindow.switchToPage(appwindow.getPage("Timers"), 0);
            }
        },
        Kirigami.Action {
            iconName: "chronometer"
            text: i18n("Stopwatch")
            checked: appwindow.getPage("Stopwatch") === appwindow.pageStack.currentItem
            onTriggered: {
                    appwindow.switchToPage(appwindow.getPage("Stopwatch"), 0);
            }
        },
        Kirigami.Action {
            iconName: "notifications"
            text: i18n("Alarms")
            checked: appwindow.getPage("Alarms") === appwindow.pageStack.currentItem
            onTriggered: {
                    appwindow.switchToPage(appwindow.getPage("Alarms"), 0);
            }
        },
        Kirigami.Action {
            iconName: "settings-configure"
            text: i18n("Settings")
            checked: appwindow.getPage("Settings") === appwindow.pageStack.currentItem
            onTriggered: {
                    appwindow.switchToPage(appwindow.getPage("Settings"), 0);
            }
        }
    ]
}
}
Edited by Devin Lin

Merge request reports