forked from quickshell/quickshell
widgets/wrapper: add distinct top/bottom/left/right margins
This commit is contained in:
parent
ca26210cc4
commit
ead9141aca
5 changed files with 230 additions and 51 deletions
|
|
@ -6,7 +6,7 @@ import QtQuick
|
|||
/// for positioning multiple items.
|
||||
///
|
||||
/// > [!NOTE] WrapperItem is a @@MarginWrapperManager based component.
|
||||
/// > You should read its documentation as well.
|
||||
/// > See its documentation for information on how margins and sizes are calculated.
|
||||
///
|
||||
/// ### Example: Adding a margin to an item
|
||||
/// The snippet below adds a 10px margin to all sides of the @@QtQuick.Text item.
|
||||
|
|
@ -30,11 +30,30 @@ import QtQuick
|
|||
///
|
||||
/// [QtQuick.Layouts]: https://doc.qt.io/qt-6/qtquicklayouts-index.html
|
||||
Item {
|
||||
/// The minimum margin between the child item and the WrapperItem's edges.
|
||||
/// The default for @@topMargin, @@bottomMargin, @@leftMargin and @@rightMargin.
|
||||
/// Defaults to 0.
|
||||
property /*real*/alias margin: manager.margin
|
||||
/// If the child item should be resized larger than its implicit size if
|
||||
/// the WrapperItem is resized larger than its implicit size. Defaults to false.
|
||||
/// An extra margin applied in addition to @@topMargin, @@bottomMargin,
|
||||
/// @@leftMargin, and @@rightMargin. Defaults to 0.
|
||||
property /*real*/alias extraMargin: manager.extraMargin
|
||||
/// The requested top margin of the content item, not counting @@extraMargin.
|
||||
///
|
||||
/// Defaults to @@margin, and may be reset by assigning `undefined`.
|
||||
property /*real*/alias topMargin: manager.topMargin
|
||||
/// The requested bottom margin of the content item, not counting @@extraMargin.
|
||||
///
|
||||
/// Defaults to @@margin, and may be reset by assigning `undefined`.
|
||||
property /*real*/alias bottomMargin: manager.bottomMargin
|
||||
/// The requested left margin of the content item, not counting @@extraMargin.
|
||||
///
|
||||
/// Defaults to @@margin, and may be reset by assigning `undefined`.
|
||||
property /*real*/alias leftMargin: manager.leftMargin
|
||||
/// The requested right margin of the content item, not counting @@extraMargin.
|
||||
///
|
||||
/// Defaults to @@margin, and may be reset by assigning `undefined`.
|
||||
property /*real*/alias rightMargin: manager.rightMargin
|
||||
/// Determines if child item should be resized larger than its implicit size if
|
||||
/// the parent is resized larger than its implicit size. Defaults to false.
|
||||
property /*bool*/alias resizeChild: manager.resizeChild
|
||||
/// See @@WrapperManager.child for details.
|
||||
property /*Item*/alias child: manager.child
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue