API Documentation
Documentation for developing SailfishOS applicationsDialogHeader QML Type
A header for use in a Dialog More...
Import Statement: | import Sailfish.Silica 1.0 |
Inherits: |
Properties
- acceptText : string
- cancelText : string
- defaultAcceptText : string
- defaultCancelText : string
- dialog : Item
- extraContent : Item
- leftMargin : real
- reserveExtraContent : bool
- rightMargin : real
- spacing : real
- title : string
Detailed Description
The DialogHeader type provides a styled header for a Dialog.
The header shows "Accept" and "Cancel" buttons and accepts or rejects the dialog when these buttons are pressed. A page title can be added below the header area with the title property.
An example:
import QtQuick 2.2 import Sailfish.Silica 1.0 ApplicationWindow { initialPage: Component { Page { Button { text: "Delete file" anchors.centerIn: parent onClicked: pageStack.push(dialog) } } } Component { id: dialog Dialog { DialogHeader { id: header title: "Confirm deletion" } Label { text: "Really delete this file?" anchors.top: header.bottom x: Theme.horizontalPageMargin color: Theme.highlightColor } } } }
See also Dialog.
Property Documentation
This property holds the text shown on the right side of the header.
By default this is bound to the value of defaultAcceptText.
See also defaultAcceptText.
This property holds the text shown on the left side when the user is cancelling the dialog with a gesture.
See also defaultCancelText.
This property holds the default value of the acceptText property, which is a localized translation of "Accept".
This property holds the default value of the cancelText property, which is a localized translation of "Cancel".
Specifies the Dialog on which DialogHeader is applied.
If dialog
is not supplied then the header will be applied to the closest ancestor Dialog.
This property provides the item controlling the interior space of the dialog header. This item can be used to insert extra context into the header.
See also reserveExtraContent.
The margins between the left and right edges of the header and its contents. The default value is Theme.horizontalPageMargin.
If true, attempts to reserve space in the dialog header for the extraContent item. Usually the cancel and accept buttons will attempt to use all available space. If this property is true then the cancel and accept buttons will use no more space than necessary to display their labels. This property defaults to true if extraContent has one or more children; otherwise false.
See also extraContent.
The margins between the left and right edges of the header and its contents. The default value is Theme.horizontalPageMargin.
This property reserves space below the header. This defaults to Theme.paddingLarge, which is the recommended whitespace between the header and dialog content.