Skip to content

Commit

Permalink
RibbonView and etc.: Fix border bug for RibbonMessageListView.
Browse files Browse the repository at this point in the history
  • Loading branch information
mentalfl0w committed Jun 28, 2024
1 parent 564cc8e commit ec77863
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions example/qml/Qt5/example.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ RibbonWindow {
anchors.fill: parent
pageWidth: (page_slider.value / 100.0) * width
spacing: 0
isMainView: true
ColumnLayout{
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 30
Expand Down
1 change: 1 addition & 0 deletions example/qml/Qt6/example.qml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ RibbonWindow {
anchors.fill: parent
pageWidth: (page_slider.value / 100.0) * width
spacing: 0
isMainView: true
ColumnLayout{
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 30
Expand Down
6 changes: 4 additions & 2 deletions lib_source/qml/Qt5/RibbonBottomBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Item {
maskOpacity: bgOpacity
useSolidBg: true
clip: true
target: Window.window.viewItems
targetRect: Qt.rect(x, Window.window.viewItems.y + Window.window.viewItems.height, width, height)
target: Window.window.viewItems ? Window.window.viewItems : null
targetRect: Window.window.viewItems ?
Qt.rect(x, Window.window.viewItems.y + Window.window.viewItems.height, width, height) :
Qt.rect(0,0,0,0)
bottomLeftRadius: Qt.platform.os === 'windows' ? RibbonUI.isWin11 ? 7 : 0 : 10
bottomRightRadius: bottomLeftRadius
Behavior on maskColor {
Expand Down
2 changes: 1 addition & 1 deletion lib_source/qml/Qt5/RibbonTabBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Item{
useSolidBg: true
radius: modernStyle ? 10 :0
clip: true
target: Window.window.viewItems ? Window.window.viewItems : undefined
target: Window.window.viewItems ? Window.window.viewItems : null
targetRect: Window.window.viewItems ? mapToItem(Window.window.viewItems, blur.x, blur.y, width, height) : Qt.rect(0,0,0,0)
Behavior on maskColor {
ColorAnimation {
Expand Down
10 changes: 7 additions & 3 deletions lib_source/qml/Qt5/RibbonView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Item {
property bool modernStyle: RibbonTheme.modernStyle
property bool isDarkMode: RibbonTheme.isDarkMode
property int spacing: 5
property bool isMainView: false
property alias bgColor: bg.color
property alias bgVisible: bg.visible
z:-2
Expand All @@ -31,7 +32,7 @@ Item {
right: parent.right
top: parent.top
}
height: Window.window.tabBar ? Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) : 0
height: isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) : 0 : 0 : 0
}

Item{
Expand Down Expand Up @@ -59,8 +60,11 @@ Item {
right: parent.right
bottom: parent.bottom
}
height: Window.window.tabBar ? Math.abs(Window.window.bottomBar.height) : 0
height: isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.bottomBar.height) : 0 : 0 : 0
}

Component.onCompleted: Window.window.viewItems = container
Component.onCompleted: {
if(isMainView && Window.window)
Window.window.viewItems = container
}
}
6 changes: 4 additions & 2 deletions lib_source/qml/Qt6/RibbonBottomBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Item {
maskOpacity: bgOpacity
useSolidBg: true
clip: true
target: Window.window.viewItems
targetRect: Qt.rect(x, Window.window.viewItems.y + Window.window.viewItems.height, width, height)
target: Window.window.viewItems ? Window.window.viewItems : null
targetRect: Window.window.viewItems ?
Qt.rect(x, Window.window.viewItems.y + Window.window.viewItems.height, width, height) :
Qt.rect(0,0,0,0)
bottomLeftRadius: Qt.platform.os === 'windows' ? RibbonUI.isWin11 ? 7 : 0 : 10
bottomRightRadius: bottomLeftRadius
Behavior on maskColor {
Expand Down
2 changes: 1 addition & 1 deletion lib_source/qml/Qt6/RibbonTabBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Item{
useSolidBg: true
radius: modernStyle ? 10 :0
clip: true
target: Window.window.viewItems ? Window.window.viewItems : undefined
target: Window.window.viewItems ? Window.window.viewItems : null
targetRect: Window.window.viewItems ? mapToItem(Window.window.viewItems, blur.x, blur.y, width, height) : Qt.rect(0,0,0,0)
Behavior on maskColor {
ColorAnimation {
Expand Down
10 changes: 7 additions & 3 deletions lib_source/qml/Qt6/RibbonView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Item {
property bool modernStyle: RibbonTheme.modernStyle
property bool isDarkMode: RibbonTheme.isDarkMode
property int spacing: 5
property bool isMainView: false
property alias bgColor: bg.color
property alias bgVisible: bg.visible
z:-2
Expand All @@ -31,7 +32,7 @@ Item {
right: parent.right
top: parent.top
}
height: Window.window.tabBar ? Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) : 0
height: isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.tabBar.height - Window.window.tabBar.modernMargin) : 0 : 0 : 0
}

Item{
Expand Down Expand Up @@ -59,8 +60,11 @@ Item {
right: parent.right
bottom: parent.bottom
}
height: Window.window.tabBar ? Math.abs(Window.window.bottomBar.height) : 0
height: isMainView ? Window.window ? Window.window.tabBar ? Math.abs(Window.window.bottomBar.height) : 0 : 0 : 0
}

Component.onCompleted: Window.window.viewItems = container
Component.onCompleted: {
if(isMainView && Window.window)
Window.window.viewItems = container
}
}

0 comments on commit ec77863

Please sign in to comment.