Bug 451026 - toolbarlayout is not layout compatible
Summary: toolbarlayout is not layout compatible
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-02 08:54 UTC by Harald Sitter
Modified: 2022-04-19 09:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2022-03-02 08:54:49 UTC
SUMMARY
Most notably it doesn't honor individual alignment, causing much sadness because you can't have a toolbar where a number of buttons are left and the remainder right aligned. I may be doing it wrong though (:

```
Kirigami.ActionToolBar {
        alignment: Qt.AlignRight
        actions: [ Kirigami.Action {
                Layout.alignment : Qt.AlignLeft
                id: advancedAction
                checkable: true
                iconName: "code-context"
                text: i18nc("@action:button", "Show backtrace content (advanced)")
            },
            Kirigami.Action {
                enabled: trace !== ""
                iconName: "go-next"
                text: i18nc("@action:button", "Next")
                onTriggered: pageStack.push("qrc:/ui/BugzillaPage.qml")
            }
        ]
    }
}
```

As a workaround one can have a rowlayout with two bars aligning right and left respectively - It is awkward though because collapsing into a burger menu is then undefined behavior (as to which bar collapses)
Comment 1 Nate Graham 2022-03-22 00:59:50 UTC
Can confirm. I've run into this minor annoyance while implementing layouts with ActionToolBar in the past as well.
Comment 2 Arjen Hiemstra 2022-04-19 09:56:40 UTC
`Layout` attached properties are inaccessible from C++ without some really awkward code, as the required type is a private class in QtQuick. So it is pretty much impossible to support those. That said, a custom attached property could be added for this, which I've started doing in other places. I just haven't had much of a reason to add it to ToolBarLayout so far.