Compare commits

...

3 Commits

6 changed files with 30 additions and 22 deletions

View File

@ -7,7 +7,7 @@ RibbonBlur {
id: control
parent: Overlay.overlay
implicitWidth: parent.width
implicitHeight: 30
implicitHeight: folded ? barHeight : Window.window.viewItems.height
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
@ -15,7 +15,8 @@ RibbonBlur {
enableEffect: handler.visible || !folded
readonly property alias folded: folded_btn.checked
property int animationTime: 400
property real barHeight: implicitHeight - handler.height
property real currentMessageHeight: message_list.currentItem ? message_list.currentItem.height : 36
property real barHeight: 36
property alias messageModel: messageModel
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
@ -67,7 +68,7 @@ RibbonBlur {
onIsCurrentItemChanged: {
if(folded){
message_list.height = item.implicitHeight
control.implicitHeight = item.implicitHeight + handler.height
control.barHeight = item.implicitHeight + handler.height
}
}
@ -110,7 +111,7 @@ RibbonBlur {
onImplicitHeightChanged:{
if(message_list.currentIndex === index && folded){
message_list.height = item.implicitHeight
control.implicitHeight = item.implicitHeight + handler.height
control.barHeight = item.implicitHeight + handler.height
}
}
}
@ -119,7 +120,7 @@ RibbonBlur {
add: Transition {
NumberAnimation {
properties: "y"
from: message_list.height
from: -message_list.height
duration: control.animationTime
}
}
@ -157,7 +158,7 @@ RibbonBlur {
y: message_list.y + message_list.height * (folded ? 1 : 0)
implicitHeight: folded ? 10 : 20
implicitWidth: parent.width
visible: hover.hovered && messageModel.count
visible: hover.hovered && messageModel.count > 1
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
Behavior on color {
ColorAnimation {
@ -192,12 +193,10 @@ RibbonBlur {
textColor: RibbonTheme.isDarkMode ? "white" : "black"
onClicked:{
if(!folded){
control.implicitHeight = Window.window.viewItems.height - control.x
message_list.height = control.implicitHeight
}
else{
message_list.height = message_list.currentItem.implicitHeight
control.implicitHeight = message_list.currentItem.implicitHeight + handler.height
auto_scroll_btn_timer.restart()
}
}
@ -243,7 +242,8 @@ RibbonBlur {
folded_btn.checked = true
messageModel.clear()
implicitHeight = 0
barHeight = 0
barHeight = folded ? handler.height : 0
currentMessageHeight = 0
message_list.height = 0
}
}

View File

@ -16,6 +16,8 @@ Item {
Shape {
id: shape
anchors.fill: parent
layer.enabled: true
layer.samples: 4 // Workaround for Qt 6.5 and below, for Qt 6.6, just set "preferredRendererType" to "Shape.CurveRenderer"
ShapePath {
capStyle: ShapePath.RoundCap
strokeWidth: 0
@ -39,9 +41,11 @@ Item {
width: shape.width
height: shape.height
anchors.centerIn: parent
layer.enabled: true
layer.samples: 4
ShapePath {
capStyle: ShapePath.RoundCap
strokeWidth: control.borderWidth
strokeWidth: control.borderWidth * 2
strokeColor: control.borderColor
fillColor: "transparent"
joinStyle: ShapePath.RoundJoin

View File

@ -40,7 +40,7 @@ Item {
if(Window.window.tabBar)
w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin)
if(Window.window.messageBar)
w += (Window.window.messageBar.folded ? Window.window.messageBar.barHeight + Window.window.messageBar.topMargin : 0)
w += (Window.window.messageBar.folded ? Window.window.messageBar.currentMessageHeight : 0) + Window.window.messageBar.topMargin
}
return w
}

View File

@ -7,7 +7,7 @@ RibbonBlur {
id: control
parent: Overlay.overlay
implicitWidth: parent.width
implicitHeight: 30
implicitHeight: folded ? barHeight : Window.window.viewItems.height
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
@ -15,7 +15,8 @@ RibbonBlur {
enableEffect: handler.visible || !folded
readonly property alias folded: folded_btn.checked
property int animationTime: 400
property real barHeight: implicitHeight - handler.height
property real currentMessageHeight: message_list.currentItem ? message_list.currentItem.height : 36
property real barHeight: 36
property alias messageModel: messageModel
property real topMargin: RibbonTheme.modernStyle ? 5 : 0
@ -67,7 +68,7 @@ RibbonBlur {
onIsCurrentItemChanged: {
if(folded){
message_list.height = item.implicitHeight
control.implicitHeight = item.implicitHeight + handler.height
control.barHeight = item.implicitHeight + handler.height
}
}
@ -110,7 +111,7 @@ RibbonBlur {
onImplicitHeightChanged:{
if(message_list.currentIndex === index && folded){
message_list.height = item.implicitHeight
control.implicitHeight = item.implicitHeight + handler.height
control.barHeight = item.implicitHeight + handler.height
}
}
}
@ -119,7 +120,7 @@ RibbonBlur {
add: Transition {
NumberAnimation {
properties: "y"
from: message_list.height
from: -message_list.height
duration: control.animationTime
}
}
@ -157,7 +158,7 @@ RibbonBlur {
y: message_list.y + message_list.height * (folded ? 1 : 0)
implicitHeight: folded ? 10 : 20
implicitWidth: parent.width
visible: hover.hovered && messageModel.count
visible: hover.hovered && messageModel.count > 1
color: RibbonTheme.isDarkMode ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
Behavior on color {
ColorAnimation {
@ -192,12 +193,10 @@ RibbonBlur {
textColor: RibbonTheme.isDarkMode ? "white" : "black"
onClicked:{
if(!folded){
control.implicitHeight = Window.window.viewItems.height - control.x
message_list.height = control.implicitHeight
}
else{
message_list.height = message_list.currentItem.implicitHeight
control.implicitHeight = message_list.currentItem.implicitHeight + handler.height
auto_scroll_btn_timer.restart()
}
}
@ -243,7 +242,8 @@ RibbonBlur {
folded_btn.checked = true
messageModel.clear()
implicitHeight = 0
barHeight = 0
barHeight = folded ? handler.height : 0
currentMessageHeight = 0
message_list.height = 0
}
}

View File

@ -18,6 +18,8 @@ Item {
Shape {
id: shape
anchors.fill: parent
layer.enabled: true
layer.samples: 4 // Workaround for Qt 6.5 and below, for Qt 6.6, just set "preferredRendererType" to "Shape.CurveRenderer"
ShapePath {
capStyle: ShapePath.RoundCap
strokeWidth: 0
@ -41,9 +43,11 @@ Item {
width: shape.width
height: shape.height
anchors.centerIn: parent
layer.enabled: true
layer.samples: 4
ShapePath {
capStyle: ShapePath.RoundCap
strokeWidth: control.borderWidth
strokeWidth: control.borderWidth * 2
strokeColor: control.borderColor
fillColor: "transparent"
joinStyle: ShapePath.RoundJoin

View File

@ -40,7 +40,7 @@ Item {
if(Window.window.tabBar)
w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin)
if(Window.window.messageBar)
w += (Window.window.messageBar.folded ? Window.window.messageBar.barHeight + Window.window.messageBar.topMargin : 0)
w += (Window.window.messageBar.folded ? Window.window.messageBar.currentMessageHeight : 0) + Window.window.messageBar.topMargin
}
return w
}