Compare commits

...

3 Commits

6 changed files with 30 additions and 22 deletions

View File

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

View File

@ -16,6 +16,8 @@ Item {
Shape { Shape {
id: shape id: shape
anchors.fill: parent 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 { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: 0 strokeWidth: 0
@ -39,9 +41,11 @@ Item {
width: shape.width width: shape.width
height: shape.height height: shape.height
anchors.centerIn: parent anchors.centerIn: parent
layer.enabled: true
layer.samples: 4
ShapePath { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: control.borderWidth strokeWidth: control.borderWidth * 2
strokeColor: control.borderColor strokeColor: control.borderColor
fillColor: "transparent" fillColor: "transparent"
joinStyle: ShapePath.RoundJoin joinStyle: ShapePath.RoundJoin

View File

@ -40,7 +40,7 @@ Item {
if(Window.window.tabBar) if(Window.window.tabBar)
w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin)
if(Window.window.messageBar) 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 return w
} }

View File

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

View File

@ -18,6 +18,8 @@ Item {
Shape { Shape {
id: shape id: shape
anchors.fill: parent 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 { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: 0 strokeWidth: 0
@ -41,9 +43,11 @@ Item {
width: shape.width width: shape.width
height: shape.height height: shape.height
anchors.centerIn: parent anchors.centerIn: parent
layer.enabled: true
layer.samples: 4
ShapePath { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: control.borderWidth strokeWidth: control.borderWidth * 2
strokeColor: control.borderColor strokeColor: control.borderColor
fillColor: "transparent" fillColor: "transparent"
joinStyle: ShapePath.RoundJoin joinStyle: ShapePath.RoundJoin

View File

@ -40,7 +40,7 @@ Item {
if(Window.window.tabBar) if(Window.window.tabBar)
w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) w += Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin)
if(Window.window.messageBar) 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 return w
} }