RibbonMessageBar,RibbonMessageBarGroup,RibbonRectangle,RibbonBackStageView: Property bug fix for Qt 5 and Qt 6.
This commit is contained in:
parent
3849ace771
commit
f317fcbde7
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Window 2.15
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
import RibbonUI 1.0
|
import RibbonUI 1.0
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Window 2.15
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
import RibbonUI 1.0
|
import RibbonUI 1.0
|
||||||
|
@ -15,8 +16,8 @@ RibbonBlur {
|
||||||
enableEffect: handler.visible || !folded
|
enableEffect: handler.visible || !folded
|
||||||
readonly property alias folded: folded_btn.checked
|
readonly property alias folded: folded_btn.checked
|
||||||
property int animationTime: 400
|
property int animationTime: 400
|
||||||
property real currentMessageHeight: message_list.currentItem ? message_list.currentItem.height : 36
|
property real currentMessageHeight: message_list.currentItem ? message_list.currentItem.height : 0
|
||||||
property real barHeight: 36
|
property real barHeight: folded ? currentMessageHeight + handler.height : 0
|
||||||
property alias messageModel: messageModel
|
property alias messageModel: messageModel
|
||||||
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
|
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ RibbonBlur {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
height: parent.height - (folded ? handler.height : 0)
|
height: control.implicitHeight - (folded ? handler.height : 0)
|
||||||
model: messageModel
|
model: messageModel
|
||||||
delegate: Item{
|
delegate: Item{
|
||||||
id: item
|
id: item
|
||||||
|
@ -65,15 +66,9 @@ RibbonBlur {
|
||||||
id: bar
|
id: bar
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
property bool isCurrentItem: item === message_list.currentItem
|
property bool isCurrentItem: item === message_list.currentItem
|
||||||
onIsCurrentItemChanged: {
|
|
||||||
if(folded){
|
|
||||||
message_list.height = item.implicitHeight
|
|
||||||
control.barHeight = item.implicitHeight + handler.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text: model.text
|
text: model.text
|
||||||
externalURL: model.externalURL
|
externalURL: model.externalURL ? model.externalURL : ""
|
||||||
dismissAction: ()=>messageModel.remove(index)
|
dismissAction: ()=>messageModel.remove(index)
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if(model.disableMultiline)
|
if(model.disableMultiline)
|
||||||
|
@ -108,13 +103,8 @@ RibbonBlur {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onImplicitHeightChanged:{
|
|
||||||
if(message_list.currentIndex === index && folded){
|
|
||||||
message_list.height = item.implicitHeight
|
|
||||||
control.barHeight = item.implicitHeight + handler.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
verticalLayoutDirection: ListView.BottomToTop
|
||||||
|
|
||||||
add: Transition {
|
add: Transition {
|
||||||
|
@ -192,13 +182,7 @@ RibbonBlur {
|
||||||
tipText: checked ? qsTr("Show all messages") : qsTr("Hide all messages")
|
tipText: checked ? qsTr("Show all messages") : qsTr("Hide all messages")
|
||||||
textColor: RibbonTheme.isDarkMode ? "white" : "black"
|
textColor: RibbonTheme.isDarkMode ? "white" : "black"
|
||||||
onClicked:{
|
onClicked:{
|
||||||
if(!folded){
|
auto_scroll_btn_timer.restart()
|
||||||
message_list.height = control.implicitHeight
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
message_list.height = message_list.currentItem.implicitHeight
|
|
||||||
auto_scroll_btn_timer.restart()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on rotation {
|
Behavior on rotation {
|
||||||
|
@ -241,9 +225,5 @@ RibbonBlur {
|
||||||
function clearMessages(){
|
function clearMessages(){
|
||||||
folded_btn.checked = true
|
folded_btn.checked = true
|
||||||
messageModel.clear()
|
messageModel.clear()
|
||||||
implicitHeight = 0
|
|
||||||
barHeight = folded ? handler.height : 0
|
|
||||||
currentMessageHeight = 0
|
|
||||||
message_list.height = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuick.Shapes 1.15
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@ -10,7 +12,7 @@ Item {
|
||||||
property int bottomLeftRadius: radius
|
property int bottomLeftRadius: radius
|
||||||
property int bottomRightRadius: radius
|
property int bottomRightRadius: radius
|
||||||
property real borderWidth: 0
|
property real borderWidth: 0
|
||||||
property var borderColor: Qt.color("transparent")
|
property string borderColor: "transparent"
|
||||||
default property alias contentItem: container.data
|
default property alias contentItem: container.data
|
||||||
|
|
||||||
Shape {
|
Shape {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import RibbonUI
|
import RibbonUI
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Window
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import RibbonUI
|
import RibbonUI
|
||||||
|
@ -15,8 +16,8 @@ RibbonBlur {
|
||||||
enableEffect: handler.visible || !folded
|
enableEffect: handler.visible || !folded
|
||||||
readonly property alias folded: folded_btn.checked
|
readonly property alias folded: folded_btn.checked
|
||||||
property int animationTime: 400
|
property int animationTime: 400
|
||||||
property real currentMessageHeight: message_list.currentItem ? message_list.currentItem.height : 36
|
property real currentMessageHeight: message_list.currentItem ? message_list.currentItem.height : 0
|
||||||
property real barHeight: 36
|
property real barHeight: folded ? currentMessageHeight + handler.height : 0
|
||||||
property alias messageModel: messageModel
|
property alias messageModel: messageModel
|
||||||
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
|
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ RibbonBlur {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
height: parent.height - (folded ? handler.height : 0)
|
height: control.implicitHeight - (folded ? handler.height : 0)
|
||||||
model: messageModel
|
model: messageModel
|
||||||
delegate: Item{
|
delegate: Item{
|
||||||
id: item
|
id: item
|
||||||
|
@ -65,15 +66,9 @@ RibbonBlur {
|
||||||
id: bar
|
id: bar
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
property bool isCurrentItem: item === message_list.currentItem
|
property bool isCurrentItem: item === message_list.currentItem
|
||||||
onIsCurrentItemChanged: {
|
|
||||||
if(folded){
|
|
||||||
message_list.height = item.implicitHeight
|
|
||||||
control.barHeight = item.implicitHeight + handler.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text: model.text
|
text: model.text
|
||||||
externalURL: model.externalURL
|
externalURL: model.externalURL ? model.externalURL : ""
|
||||||
dismissAction: ()=>messageModel.remove(index)
|
dismissAction: ()=>messageModel.remove(index)
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if(model.disableMultiline)
|
if(model.disableMultiline)
|
||||||
|
@ -108,13 +103,8 @@ RibbonBlur {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onImplicitHeightChanged:{
|
|
||||||
if(message_list.currentIndex === index && folded){
|
|
||||||
message_list.height = item.implicitHeight
|
|
||||||
control.barHeight = item.implicitHeight + handler.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
verticalLayoutDirection: ListView.BottomToTop
|
||||||
|
|
||||||
add: Transition {
|
add: Transition {
|
||||||
|
@ -192,13 +182,7 @@ RibbonBlur {
|
||||||
tipText: checked ? qsTr("Show all messages") : qsTr("Hide all messages")
|
tipText: checked ? qsTr("Show all messages") : qsTr("Hide all messages")
|
||||||
textColor: RibbonTheme.isDarkMode ? "white" : "black"
|
textColor: RibbonTheme.isDarkMode ? "white" : "black"
|
||||||
onClicked:{
|
onClicked:{
|
||||||
if(!folded){
|
auto_scroll_btn_timer.restart()
|
||||||
message_list.height = control.implicitHeight
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
message_list.height = message_list.currentItem.implicitHeight
|
|
||||||
auto_scroll_btn_timer.restart()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on rotation {
|
Behavior on rotation {
|
||||||
|
@ -241,9 +225,5 @@ RibbonBlur {
|
||||||
function clearMessages(){
|
function clearMessages(){
|
||||||
folded_btn.checked = true
|
folded_btn.checked = true
|
||||||
messageModel.clear()
|
messageModel.clear()
|
||||||
implicitHeight = 0
|
|
||||||
barHeight = folded ? handler.height : 0
|
|
||||||
currentMessageHeight = 0
|
|
||||||
message_list.height = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ Item {
|
||||||
property int bottomLeftRadius: radius
|
property int bottomLeftRadius: radius
|
||||||
property int bottomRightRadius: radius
|
property int bottomRightRadius: radius
|
||||||
property real borderWidth: 0
|
property real borderWidth: 0
|
||||||
property var borderColor: Qt.color("transparent")
|
property string borderColor: "transparent"
|
||||||
default property alias contentItem: container.data
|
default property alias contentItem: container.data
|
||||||
|
|
||||||
Shape {
|
Shape {
|
||||||
|
|
Loading…
Reference in New Issue