[calamares] Document how to hide the Quit button
The Quit button can have its own logic at a QML level for show/hide. It **ought** to follow the *quitVisible* property, but can do additional work. Here, document how a distro might choose to hide the Quit button on the last page (generally, that's the "finished" page).
This commit is contained in:
parent
44602d0237
commit
992c673951
@ -46,10 +46,13 @@ Rectangle {
|
|||||||
enabled: ViewManager.nextEnabled;
|
enabled: ViewManager.nextEnabled;
|
||||||
visible: ViewManager.backAndNextVisible;
|
visible: ViewManager.backAndNextVisible;
|
||||||
onClicked: { ViewManager.next(); }
|
onClicked: { ViewManager.next(); }
|
||||||
|
// This margin goes in the "next" button, because the "quit"
|
||||||
|
// button can vanish and we want to keep the margin to
|
||||||
|
// the next-thing-in-the-navigation-panel around.
|
||||||
|
Layout.rightMargin: 3 * buttonBar.spacing;
|
||||||
}
|
}
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
Layout.leftMargin: 3 * buttonBar.spacing; // little gap from back/next
|
|
||||||
Layout.rightMargin: 2 * buttonBar.spacing
|
Layout.rightMargin: 2 * buttonBar.spacing
|
||||||
text: ViewManager.quitLabel;
|
text: ViewManager.quitLabel;
|
||||||
icon.name: ViewManager.quitIcon;
|
icon.name: ViewManager.quitIcon;
|
||||||
@ -59,6 +62,19 @@ Rectangle {
|
|||||||
ToolTip.delay: 1000
|
ToolTip.delay: 1000
|
||||||
ToolTip.text: ViewManager.quitTooltip;
|
ToolTip.text: ViewManager.quitTooltip;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The ViewManager has settings -- user-controlled via the
|
||||||
|
* branding component, and party based on program state --
|
||||||
|
* whether the quit button should be enabled and visible.
|
||||||
|
*
|
||||||
|
* QML navigation *should* follow this pattern, but can also
|
||||||
|
* add other qualifications. For instance, you may have a
|
||||||
|
* "finished" module that handles quit in its own way, and
|
||||||
|
* want to hide the quit button then. The ViewManager has a
|
||||||
|
* current step and a total count, so compare them:
|
||||||
|
*
|
||||||
|
* visible: ViewManager.quitVisible && ( ViewManager.currentStepIndex < ViewManager.rowCount()-1);
|
||||||
|
*/
|
||||||
enabled: ViewManager.quitEnabled;
|
enabled: ViewManager.quitEnabled;
|
||||||
visible: ViewManager.quitVisible;
|
visible: ViewManager.quitVisible;
|
||||||
onClicked: { ViewManager.quit(); }
|
onClicked: { ViewManager.quit(); }
|
||||||
|
Loading…
Reference in New Issue
Block a user