diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index 706ebcb..782919d 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -1,553 +1,554 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 2.2 -import QtQuick.Window 2.0 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Window 2.3 import org.kde.kirigami 2.7 as Kirigami import org.kde.mauikit 1.0 as Maui import QtQuick.Controls.Material 2.1 import "private" import SyncingModel 1.0 import SyncingList 1.0 Kirigami.AbstractApplicationWindow { id: root visible: true width: Screen.width * (isMobile ? 1 : 0.4) height: Screen.height * (isMobile ? 1 : 0.4) // contentItem.anchors.leftMargin: root.globalDrawer && (root.globalDrawer.modal === false) ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0 // contentItem.anchors.left: contentItem.parent.left // contentItem.anchors.right: contentItem.parent.right // contentItem.anchors.rightMargin: 0 property bool showAccounts : true /***************************************************/ /******************** ALIASES *********************/ /*************************************************/ property alias headBar : _headBar property alias footBar: _footBar property alias dialog: dialogLoader.item property alias leftIcon : menuBtn property alias rightIcon : searchBtn property alias mainMenu : mainMenu.contentData property alias about : aboutDialog property alias accounts: _accountsDialogLoader.item property alias currentAccount: _accountCombobox.currentText property alias notifyDialog: _notify //redefines here as here we can know a pointer to PageRow wideScreen: isWide /***************************************************/ /*********************** UI ***********************/ /*************************************************/ property bool isWide : root.width >= Kirigami.Units.gridUnit * 30 property int radiusV : unit * 4 property int iconSize : iconSizes.medium * (isMobile ? 0.95 : 1) readonly property int unit : Maui.Style.unit readonly property int rowHeight: Maui.Style.rowHeight readonly property int rowHeightAlt: Maui.Style.rowHeightAlt readonly property int toolBarHeight: Maui.Style.toolBarHeight readonly property int toolBarHeightAlt: Maui.Style.toolBarHeightAlt readonly property int contentMargins: space.medium readonly property var fontSizes: Maui.Style.fontSizes readonly property var space : Maui.Style.space readonly property var iconSizes : Maui.Style.iconSizes property string colorSchemeName : Qt.application.name /***************************************************/ /********************* COLORS *********************/ /*************************************************/ readonly property var colorScheme: ({ Default : 1, Light : 2, Dark: 3, Custom: 4 }) property color borderColor: Qt.tint(textColor, Qt.rgba(backgroundColor.r, backgroundColor.g, backgroundColor.b, 0.7)) property color backgroundColor: Maui.Style.backgroundColor property color textColor: Maui.Style.textColor property color highlightColor: Maui.Style.highlightColor property color highlightedTextColor: Maui.Style.highlightedTextColor property color buttonBackgroundColor: Maui.Style.buttonBackgroundColor property color viewBackgroundColor: Maui.Style.viewBackgroundColor property color altColor: Maui.Style.altColor property color altColorText: Maui.Style.altColorText property color accentColor : buttonBackgroundColor property color bgColor: viewBackgroundColor property color headBarBGColor: backgroundColor property color headBarFGColor: textColor readonly property string darkBorderColor: Qt.darker(darkBackgroundColor, 1.5) readonly property string darkBackgroundColor: "#303030" readonly property string darkTextColor: "#FAFAFA" readonly property string darkHighlightColor: "#29B6F6" readonly property string darkHighlightedTextColor: darkTextColor readonly property string darkViewBackgroundColor: "#212121" readonly property string darkDarkColor: "#191919" readonly property string darkButtonBackgroundColor : "#191919" readonly property color darkAltColor: "#333" readonly property color darkAltColorText: darkTextColor readonly property color darkAccentColor : darkButtonBackgroundColor readonly property color darkBgColor: darkBackgroundColor property color warningColor : Maui.Style.warningColor property color dangerColor : Maui.Style.dangerColor property color infoColor : Maui.Style.infoColor property color suggestedColor : Maui.Style.suggestedColor /* ANDROID THEMING*/ Material.theme: Material.Light Material.accent: highlightColor Material.background: headBarBGColor Material.primary: headBarBGColor Material.foreground: textColor /***************************************************/ /**************** READONLY PROPS ******************/ /*************************************************/ readonly property bool isMobile : Kirigami.Settings.isMobile readonly property bool isAndroid: Qt.platform.os == "android" readonly property real screenWidth : Screen.width readonly property real screenHeight : Screen.height /***************************************************/ /********************* PROPS **********************/ /*************************************************/ property alias searchButton : searchBtn property alias menuButton : menuBtn /***************************************************/ /******************** SIGNALS *********************/ /*************************************************/ signal menuButtonClicked(); signal searchButtonClicked(); signal goBackTriggered(); signal goFowardTriggered(); // overlay.modal: Rectangle // { // color: Color.transparent(altColor, 0.5) // } // overlay.modeless: Rectangle { // color: "transparent" // } onClosing: { if(!isMobile) { var height = root.height var width = root.width var x = root.x var y = root.y Maui.FM.saveSettings("GEOMETRY", Qt.rect(x, y, width, height), "WINDOW") } } property bool isPortrait: Screen.primaryOrientation === Qt.PortraitOrientation || Screen.primaryOrientation === Qt.InvertedPortraitOrientation onIsPortraitChanged: { if(isPortrait) { console.log("PORTARIT MODE CHANGED") width: Screen.width height: Screen.height } } onHeadBarBGColorChanged: { if(!isMobile && colorSchemeName.length > 0) Maui.KDE.setColorScheme(colorSchemeName, headBarBGColor, headBarFGColor) else if(isAndroid && headBar.position === ToolBar.Header) Maui.Android.statusbarColor(headBarBGColor, false) else if(isAndroid && headBar.position === ToolBar.Footer) Maui.Android.statusbarColor(viewBackgroundColor, true) } onHeadBarFGColorChanged: { if(!isAndroid && !isMobile && colorSchemeName.length > 0 && headBar.position === ToolBar.Header) Maui.KDE.setColorScheme(colorSchemeName, headBarBGColor, headBarFGColor) else if(isAndroid && headBar.position === ToolBar.Header) Maui.Android.statusbarColor(headBarBGColor, false) else if(isAndroid && headBar.position === ToolBar.Footer) Maui.Android.statusbarColor(viewBackgroundColor, true) } background: Rectangle { color: bgColor } // globalDrawer.height: root.height - headBar.height // globalDrawer.y: headBar.height property QtObject mheadBar : Maui.ToolBar { id: _headBar visible: count > 1 position: ToolBar.Header Kirigami.Theme.backgroundColor: headBarBGColor Kirigami.Theme.textColor: headBarFGColor leftContent: ToolButton { id: menuBtn icon.name: "application-menu" icon.color: headBarFGColor checked: mainMenu.visible onClicked: { menuButtonClicked() mainMenu.visible ? mainMenu.close() : mainMenu.popup(parent, parent.x , parent.height+ space.medium) } Menu { id: mainMenu modal: true z: 999 width: unit * 200 Item { height: _accountCombobox.visible ? unit * 90 : 0 anchors { left: parent.left right: parent.right top: parent.top margins: space.medium } ComboBox { id: _accountCombobox anchors.centerIn: parent // parent: mainMenu popup.z: 999 width: parent.width visible: (count > 1) && showAccounts textRole: "user" flat: true model: showAccounts ? accounts.model : undefined // icon.name: "user-identity" // iconButton.isMask: false } } MenuSeparator { visible: _accountCombobox.visible } MenuItem { text: qsTr("Accounts") visible: root.showAccounts icon.name: "list-add-user" onTriggered: { if(root.accounts) accounts.open() } } MenuItem { text: qsTr("About") icon.name: "documentinfo" onTriggered: aboutDialog.open() } } } rightContent: ToolButton { id: searchBtn icon.name: "edit-find" icon.color: headBarFGColor onClicked: searchButtonClicked() } } property QtObject mfootBar : Maui.ToolBar { id: _footBar visible: count position: ToolBar.Footer + width: root.width Kirigami.Theme.backgroundColor: control.Kirigami.Theme.backgroundColor } header: headBar.position === ToolBar.Header ? headBar : undefined footer: Column { id: _footer + children: headBar.position === ToolBar.Footer ? [footBar, headBar] : footBar } Maui.AboutDialog { id: aboutDialog } Loader { id: _accountsDialogLoader sourceComponent: root.showAccounts ? _accountsDialogComponent : undefined } Component { id: _accountsDialogComponent AccountsHelper {} } Maui.Dialog { id: _notify property var cb : ({}) verticalAlignment: Qt.AlignTop defaultButtons: false colorScheme.backgroundColor: altColor colorScheme.textColor: altColorText maxHeight: Math.max(unit * 120, (_notifyLayout.implicitHeight)) maxWidth: isMobile ? parent.width * 0.9 : unit * 500 Timer { id: _notifyTimer onTriggered: _notify.close() } onClosed: _notifyTimer.stop() MouseArea { anchors.fill: parent onClicked: { if(_notify.cb) _notify.cb() _notify.close() } } GridLayout { anchors.fill: parent columns: 2 rows: 1 Item { Layout.fillHeight: true Layout.preferredWidth: iconSizes.huge + space.big Layout.row: 1 Layout.column: 1 ToolButton { id: _notifyIcon icon.width: iconSizes.large anchors.centerIn: parent // isMask: false } } Item { Layout.fillHeight: true Layout.fillWidth: true Layout.row: 1 Layout.column: 2 ColumnLayout { anchors.fill: parent id: _notifyLayout Label { id: _notifyTitle Layout.fillHeight: true Layout.fillWidth: true font.weight: Font.Bold font.bold: true font.pointSize: fontSizes.big color: _notify.colorScheme.textColor elide: Qt.ElideRight wrapMode: Text.Wrap } Label { id: _notifyBody Layout.fillHeight: true Layout.fillWidth: true font.pointSize: fontSizes.default color: _notify.colorScheme.textColor elide: Qt.ElideRight wrapMode: Text.Wrap } } } } function show(callback) { _notify.cb = callback _notifyTimer.start() _notify.open() } } Loader { id: dialogLoader } Component.onCompleted: { if(isAndroid && headBar.position === ToolBar.Footer) Maui.Android.statusbarColor(backgroundColor, true) if(!isMobile) { var rect = Maui.FM.loadSettings("GEOMETRY", "WINDOW", Qt.rect(root.x, root.y, root.width, root.height)) root.x = rect.x root.y = rect.y root.width = rect.width root.height = rect.height } } // Connections // { // target: Maui.FM // // onNewItem: notify("dialog-information", qsTr("File uploaded"), "Your file has been uploaded to your account /n"+path) // onWarningMessage: notify("dialog-information", "Oops!", message) // } function switchColorScheme(variant) { switch(variant) { case colorScheme.Default: backgroundColor = Maui.Style.backgroundColor textColor = Maui.Style.textColor highlightColor = Maui.Style.highlightColor highlightedTextColor = Maui.Style.highlightedTextColor buttonBackgroundColor = Maui.Style.buttonBackgroundColor viewBackgroundColor = Maui.Style.viewBackgroundColor altColor = Maui.Style.altColor borderColor = Maui.Style.borderColor if(isAndroid) Maui.Android.statusbarColor(backgroundColor, true) break case colorScheme.Dark: borderColor = darkBorderColor backgroundColor = darkBackgroundColor textColor = darkTextColor highlightColor = darkHighlightColor highlightedTextColor = darkHighlightedTextColor buttonBackgroundColor = darkButtonBackgroundColor viewBackgroundColor = darkViewBackgroundColor altColor = darkDarkColor altColorText = darkAltColorText bgColor =darkBgColor if(isAndroid) Maui.Android.statusbarColor(backgroundColor, false) break } } function notify(icon, title, body, callback, timeout) { _notifyIcon.icon.name = icon _notifyTitle.text = title _notifyBody.text = body _notifyTimer.interval = timeout ? timeout : 2500 _notify.show(callback) } /** FUNCTIONS **/ // function riseContent() // { // if(allowRiseContent) // flickable.flick(0, flickable.contentHeight* -2) // } // function dropContent() // { // if(allowRiseContent) // flickable.flick(0, flickable.contentHeight* 2) // } } diff --git a/src/controls/GlobalDrawer.qml b/src/controls/GlobalDrawer.qml index 8bd9dcb..1bf45c3 100644 --- a/src/controls/GlobalDrawer.qml +++ b/src/controls/GlobalDrawer.qml @@ -1,156 +1,156 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 2.2 import org.kde.kirigami 2.2 as Kirigami import org.kde.mauikit 1.0 as Maui import QtGraphicalEffects 1.0 import "private" Kirigami.GlobalDrawer { id: control /* Controlc color scheming */ ColorScheme { id: colorScheme backgroundColor: viewBackgroundColor } property alias colorScheme : colorScheme /***************************/ property Item bg // property alias handleButton : _handleButton // z: ApplicationWindow.overlay.z handleVisible: false // y: altToolBars ? 0 : headBar.height // height: parent.height - (floatingBar && altToolBars ? 0 : headBar.height) // modal: true - implicitHeight: root.height - root.headBar.height - root.footBar.height - height: root.height - root.headBar.height - root.footBar.height - y: root.headBar.height + implicitHeight: root.height - root.header.height - root.footer.height + height: root.height - root.header.height - root.footer.height + y: root.header.height topPadding: 0 bottomPadding: 0 leftPadding: 0 rightPadding: 0 onModalChanged: { if(!modal) visible = true } FastBlur { id: blur height: parent.height width: parent.width radius: 90 opacity: 0.5 source: ShaderEffectSource { sourceItem: bg sourceRect:Qt.rect(bg.width-(control.position * control.width), 0, control.width, control.height) } } // background: Rectangle // { // color: control.colorScheme.backgroundColor // // Item // { // parent: control.handle // anchors.fill: parent // anchors.margins: space.huge // // DropShadow // { // anchors.fill: handleGraphics // horizontalOffset: 0 // verticalOffset: Kitrigami.Units.devicePixelRatio // radius: Kitrigami.Units.gridUnit /2 // samples: 16 // color: Qt.rgba(0, 0, 0, control.handle.pressed ? 0.6 : 0.4) // source: handleGraphics // } // // Rectangle // { // id: handleGraphics // anchors.centerIn: parent // // color: control.handle.pressed ? control.colorScheme.highlightColor : control.colorScheme.accentColor // width: iconSizes.medium + space.medium * 2 // height: width // radius: radiusV // // Maui.ToolButton // { // id: _handleButton // anchors.centerIn: parent // size: iconSizes.medium // } // // Behavior on color // { // ColorAnimation { // duration: Kirigami.Units.longDuration // easing.type: Easing.InOutQuad // } // } // } // } // // // EdgeShadow // { // z: -2 // edge: control.edge // anchors // { // right: control.edge == Qt.RightEdge ? parent.left : (control.edge == Qt.LeftEdge ? undefined : parent.right) // left: control.edge == Qt.LeftEdge ? parent.right : (control.edge == Qt.RightEdge ? undefined : parent.left) // top: control.edge == Qt.TopEdge ? parent.bottom : (control.edge == Qt.BottomEdge ? undefined : parent.top) // bottom: control.edge == Qt.BottomEdge ? parent.top : (control.edge == Qt.TopEdge ? undefined : parent.bottom) // } // // opacity: control.position == 0 ? 0 : 1 // // Behavior on opacity { // NumberAnimation { // duration: Units.longDuration // easing.type: Easing.InOutQuad // } // } // } // } } diff --git a/src/controls/Page.qml b/src/controls/Page.qml index 244649a..4db779a 100644 --- a/src/controls/Page.qml +++ b/src/controls/Page.qml @@ -1,96 +1,99 @@ -import QtQuick 2.4 +import QtQuick 2.9 import QtQuick.Controls 2.2 import org.kde.mauikit 1.0 as Maui import org.kde.kirigami 2.7 as Kirigami import QtQuick.Layouts 1.3 +import QtQuick.Window 2.3 + Page { id: control // property int margins: 0 // contentItem.anchors.margins: margins // contentItem.anchors.left: contentItem.parent.left // contentItem.anchors.top: contentItem.parent.top // contentItem.anchors.bottom: contentItem.parent.bottom // contentItem.anchors.right: contentItem.parent.right leftPadding: control.padding rightPadding: control.padding topPadding: control.padding bottomPadding: control.padding property alias headBar : _headBar property alias footBar: _footBar property QtObject mheadBar : Maui.ToolBar { id: _headBar visible: count > 1 position: ToolBar.Header Kirigami.Theme.backgroundColor: control.Kirigami.Theme.backgroundColor Component { id: _titleComponent Label { text: control.title elide : Text.ElideRight font.bold : false font.weight: Font.Bold color : colorScheme.textColor font.pointSize: fontSizes.big horizontalAlignment : Text.AlignHCenter verticalAlignment : Text.AlignVCenter } } middleContent: Loader { Layout.fillWidth: sourceComponent === _titleComponent Layout.fillHeight: sourceComponent === _titleComponent sourceComponent: control.title ? _titleComponent : undefined } } property QtObject mfootBar : Maui.ToolBar { id: _footBar visible: count position: ToolBar.Footer + width: control.width Kirigami.Theme.backgroundColor: control.Kirigami.Theme.backgroundColor } header: headBar.position === ToolBar.Header ? headBar : undefined footer: Column { id: _footer children: headBar.position === ToolBar.Footer ? [footBar, headBar] : footBar } Keys.onBackPressed: { goBackTriggered(); console.log("GO BACK CLICKED") event.accepted = true } Shortcut { sequence: "Forward" onActivated: goFowardTriggered(); } Shortcut { sequence: StandardKey.Forward onActivated: goFowardTriggered(); } Shortcut { sequence: StandardKey.Back onActivated: goBackTriggered(); } } diff --git a/src/controls/ToolBar.qml b/src/controls/ToolBar.qml index 978452d..c3dfa4d 100644 --- a/src/controls/ToolBar.qml +++ b/src/controls/ToolBar.qml @@ -1,251 +1,251 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Controls 2.2 import org.kde.kirigami 2.7 as Kirigami import org.kde.mauikit 1.0 as Maui import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import "private" ToolBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) +// implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) implicitHeight: visible ? (floating ? toolBarHeightAlt : toolBarHeight) : 0 - width: floating ? implicitWidth : parent.width +// width: parent.width height: implicitHeight property alias stickyRightContent : rightRowContent.sticky property alias stickyLeftContent : leftRowContent.sticky property alias stickyMiddleContent : middleRowContent.sticky property alias leftContent : leftRowContent.data property alias middleContent : middleRowContent.data property alias rightContent : rightRowContent.data property alias middleLayout : middleRowContent property alias leftLayout : leftRowContent property alias rightLayout : rightRowContent property alias layout : layout property int margins: space.medium spacing: space.medium property int count : leftContent.length + middleContent.length + rightContent.length property bool dropShadow: false property bool drawBorder: false property bool floating: false property bool plegable: false //deprecrated property bool folded : false //deprecrated property bool flickable: true property bool strech : true property bool leftSretch: strech property bool rightSretch: strech property bool middleStrech: strech padding: 0 // leftPadding: Kirigami.Units.smallSpacing*2 // rightPadding: Kirigami.Units.smallSpacing*2 signal unfolded() // onPlegableChanged: folded = plegable // onVisibleChanged: // { // if(control.visible) // control.height= implicitHeight // else // control.height= 0 // // } // background: Rectangle // { // id: headBarBG // color: colorScheme.backgroundColor // implicitHeight: toolBarHeightAlt // radius: floating ? radiusV : 0 // border.color: floating ? colorScheme.borderColor : "transparent" // // SequentialAnimation on radius // { // ColorAnimation { to: colorScheme.backgroundColor ; duration: 1000 } // } // // Kirigami.Separator // { // visible: drawBorder // color: colorScheme.borderColor // height: unit // anchors // { // left: parent.left // right: parent.right // bottom: control.position == ToolBar.Footer ? undefined : parent.bottom // top: control.position == ToolBar.Footer ? parent.top : undefined // } // } // // layer.enabled: dropShadow // layer.effect: DropShadow // { // anchors.fill: headBarBG // horizontalOffset: 0 // verticalOffset: unit * (altToolBars ? -1 : 1) // radius: 8 // samples: 25 // color: Qt.darker(colorScheme.backgroundColor, 1.4) // source: headBarBG // } // } Rectangle { width: parent.height height: iconSizes.tiny visible: !mainFlickable.atXEnd && mainFlickable.interactive rotation: 270 opacity: 0.2 anchors { top: parent.top bottom: parent.bottom right: parent.right } z: 999 gradient: Gradient { GradientStop { position: 0.0 color: "transparent" } GradientStop { position: 1.0 color: Kirigami.Theme.textColor } } } Rectangle { width: parent.height height: iconSizes.tiny visible: !mainFlickable.atXBeginning && mainFlickable.interactive rotation: 270 opacity: 0.2 anchors { top: parent.top bottom: parent.bottom left: parent.left } z: 999 gradient: Gradient { GradientStop { position: 0.0 color: Kirigami.Theme.textColor } GradientStop { position: 1.0 color: "transparent" } } } Flickable { id: mainFlickable anchors.fill: parent anchors.leftMargin: margins anchors.rightMargin: margins flickableDirection: Flickable.HorizontalFlick interactive: (contentWidth > control.width) && control.flickable contentWidth: ((control.margins * 2) + space.medium) + (control.stickyLeftContent ? leftRowContent.implicitWidth : leftRowContent.width) + (control.stickyMiddleContent ? middleRowContent.implicitWidth : middleRowContent.width) + (control.stickyRightContent ? rightRowContent.implicitWidth : rightRowContent.width) boundsBehavior: isMobile ? Flickable.DragOverBounds : Flickable.StopAtBounds clip: true RowLayout { id: layout height: mainFlickable.height width: mainFlickable.width RowLayout { id: leftRowContent property bool sticky : false Layout.leftMargin: rightRowContent.implicitWidth && implicitWidth === 0 && middleRowContent.implicitWidth && control.leftSretch ? rightRowContent.implicitWidth : undefined Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft spacing: leftContent.length > 0 ? control.spacing : 0 Layout.minimumWidth: !sticky ? undefined : implicitWidth Layout.fillWidth: control.leftSretch && implicitWidth Layout.fillHeight: true } RowLayout { id: middleRowContent property bool sticky : false Layout.alignment: Qt.AlignCenter spacing: middleContent.length === 1 ? 0 : control.spacing Layout.minimumWidth: !sticky ? undefined : implicitWidth // Layout.maximumWidth: control.width - leftRowContent.implicitWidth - rightRowContent.implicitWidth Layout.fillWidth: control.middleStrech Layout.fillHeight: true } RowLayout { id: rightRowContent property bool sticky : false Layout.rightMargin: leftRowContent.implicitWidth && implicitWidth === 0 && middleRowContent.implicitWidth && control.rightSretch ? leftRowContent.implicitWidth : undefined Layout.alignment: Qt.AlignVCenter | Qt.AlignRight spacing: rightContent.length > 0 ? control.spacing : 0 Layout.minimumWidth: implicitWidth Layout.fillWidth: false Layout.fillHeight: true } } // ScrollBar.horizontal: ScrollBar { visible: false} } }