diff --git a/example/qml/Qt5/example.qml b/example/qml/Qt5/example.qml index f41575c..ba40e7c 100644 --- a/example/qml/Qt5/example.qml +++ b/example/qml/Qt5/example.qml @@ -16,8 +16,9 @@ RibbonWindow { id: msg_bar implicitWidth: windowItems.width x: windowItems.x - y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + (RibbonTheme.modernStyle ? 5 : 0) + y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + msg_bar.topMargin target: windowItems + targetRect: Qt.rect(tab_bar.x,y,width,height) Component.onCompleted: { messageModel.append([{ type: RibbonMessageBar.Info, @@ -59,7 +60,6 @@ RibbonWindow { externalURL: "https://github.com/mentalfl0w/RibbonUI", externalURLLabel: "Visit our website." }]) - messageBar.showMessage(RibbonMessageBar.Info, "test") } } @@ -157,7 +157,6 @@ RibbonWindow { pageWidth: (page_slider.value / 100.0) * width spacing: 0 isMainView: true - topBorderFix: msg_bar.folded ? msg_bar.barHeight : 0 ColumnLayout{ Layout.alignment: Qt.AlignCenter Layout.topMargin: 30 diff --git a/example/qml/Qt6/example.qml b/example/qml/Qt6/example.qml index 42460a3..169a996 100644 --- a/example/qml/Qt6/example.qml +++ b/example/qml/Qt6/example.qml @@ -16,8 +16,9 @@ RibbonWindow { id: msg_bar implicitWidth: windowItems.width x: windowItems.x - y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + (RibbonTheme.modernStyle ? 5 : 0) + y: titleBar.height + tab_bar.y + tab_bar.height - tab_bar.modernMargin + msg_bar.topMargin target: windowItems + targetRect: Qt.rect(tab_bar.x,y,width,height) Component.onCompleted: { messageModel.append([{ type: RibbonMessageBar.Info, @@ -59,7 +60,6 @@ RibbonWindow { externalURL: "https://github.com/mentalfl0w/RibbonUI", externalURLLabel: "Visit our website." }]) - messageBar.showMessage(RibbonMessageBar.Info, "test") } } @@ -157,7 +157,6 @@ RibbonWindow { pageWidth: (page_slider.value / 100.0) * width spacing: 0 isMainView: true - topBorderFix: msg_bar.folded ? msg_bar.barHeight : 0 ColumnLayout{ Layout.alignment: Qt.AlignCenter Layout.topMargin: 30 diff --git a/lib_source/qml/Qt5/RibbonMessageBarGroup.qml b/lib_source/qml/Qt5/RibbonMessageBarGroup.qml index f726c6d..50ce050 100644 --- a/lib_source/qml/Qt5/RibbonMessageBarGroup.qml +++ b/lib_source/qml/Qt5/RibbonMessageBarGroup.qml @@ -7,9 +7,9 @@ RibbonBlur { id: control parent: Overlay.overlay implicitWidth: parent.width - useSolidBg: true implicitHeight: 30 - maskColor: folded ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) + maskColor: folded && !handler.visible ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) + maskOpacity: 0 bottomLeftRadius: folded ? 0 : 5 bottomRightRadius: bottomLeftRadius enableEffect: handler.visible || !folded @@ -17,6 +17,7 @@ RibbonBlur { property int animationTime: 400 property real barHeight: implicitHeight - handler.height property alias messageModel: messageModel + property real topMargin: RibbonTheme.modernStyle ? 5 : 0 Behavior on implicitHeight { NumberAnimation { @@ -154,12 +155,8 @@ RibbonBlur { id: handler x: message_list.x + (message_list.width - width) / 2 y: message_list.y + message_list.height * (folded ? 1 : 0) - implicitHeight: 20 + implicitHeight: folded ? 10 : 20 implicitWidth: parent.width - topLeftRadius: folded ? 0 : 10 - topRightRadius: topLeftRadius - bottomLeftRadius: folded ? 10 : 0 - bottomRightRadius: bottomLeftRadius visible: hover.hovered && messageModel.count color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5) Behavior on color { @@ -176,6 +173,7 @@ RibbonBlur { showBg: false showHoveredBg: false iconSource: RibbonIcons.DismissCircle + ribbonIcon.iconSize: handler.implicitHeight - 2 tipText: qsTr("Clear All") onClicked: clearMessages() visible: !folded @@ -186,6 +184,7 @@ RibbonBlur { checkable: true showBg: false showHoveredBg: false + ribbonIcon.iconSize: handler.implicitHeight - 2 iconSource: RibbonIcons.TriangleDown rotation: checked ? 0 : 180 checked: true diff --git a/lib_source/qml/Qt6/RibbonMessageBarGroup.qml b/lib_source/qml/Qt6/RibbonMessageBarGroup.qml index 3e37e50..9663762 100644 --- a/lib_source/qml/Qt6/RibbonMessageBarGroup.qml +++ b/lib_source/qml/Qt6/RibbonMessageBarGroup.qml @@ -7,9 +7,9 @@ RibbonBlur { id: control parent: Overlay.overlay implicitWidth: parent.width - useSolidBg: true implicitHeight: 30 - maskColor: folded ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) + maskColor: folded && !handler.visible ? "transparent" : RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) + maskOpacity: 0 bottomLeftRadius: folded ? 0 : 5 bottomRightRadius: bottomLeftRadius enableEffect: handler.visible || !folded @@ -17,6 +17,7 @@ RibbonBlur { property int animationTime: 400 property real barHeight: implicitHeight - handler.height property alias messageModel: messageModel + property real topMargin: RibbonTheme.modernStyle ? 5 : 0 Behavior on implicitHeight { NumberAnimation { @@ -154,12 +155,8 @@ RibbonBlur { id: handler x: message_list.x + (message_list.width - width) / 2 y: message_list.y + message_list.height * (folded ? 1 : 0) - implicitHeight: 20 + implicitHeight: folded ? 10 : 20 implicitWidth: parent.width - topLeftRadius: folded ? 0 : 10 - topRightRadius: topLeftRadius - bottomLeftRadius: folded ? 10 : 0 - bottomRightRadius: bottomLeftRadius visible: hover.hovered && messageModel.count color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5) Behavior on color { @@ -176,6 +173,7 @@ RibbonBlur { showBg: false showHoveredBg: false iconSource: RibbonIcons.DismissCircle + ribbonIcon.iconSize: handler.implicitHeight - 2 tipText: qsTr("Clear All") onClicked: clearMessages() visible: !folded @@ -186,6 +184,7 @@ RibbonBlur { checkable: true showBg: false showHoveredBg: false + ribbonIcon.iconSize: handler.implicitHeight - 2 iconSource: RibbonIcons.TriangleDown rotation: checked ? 0 : 180 checked: true