Skip to content

Commit

Permalink
优化UI:渲染器不兼容时,减少渲染层级错误的影响。 (hiroi-sora#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroi-sora committed Dec 22, 2023
1 parent 423c51c commit b7170f2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
27 changes: 14 additions & 13 deletions UmiOCR-data/qt_res/qml/TabView_/TabView_.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ import "../TabBar_"
Rectangle {

anchors.fill: parent

// 标签栏容器
Rectangle {
id: topBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: size_.hTabBarHeight
color: theme.tabBarColor

HTabBar { }
}

// 标签页容器
Rectangle {
Expand All @@ -29,9 +17,22 @@ Rectangle {
anchors.right: parent.right
anchors.bottom: parent.bottom
color: theme.bgColor

Component.onCompleted: {
qmlapp.tab.page.pagesNest.parent = this
}
}

// 标签栏容器
Rectangle {
id: topBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: size_.hTabBarHeight
color: theme.tabBarColor
clip: true

HTabBar { }
}
}
58 changes: 29 additions & 29 deletions UmiOCR-data/qt_res/qml/Widgets/TabPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,35 @@ Item {
} */
property var tabsModel: []
clip: true


// 下方 选项页
SwipeView {
id: swipeView
anchors.left: parent.left
anchors.right: parent.right
anchors.top: topContainer.bottom
anchors.bottom: parent.bottom
anchors.topMargin: size_.smallSpacing
currentIndex: bar.currentIndex
interactive: false // 禁止直接滑动视图本身
Component.onCompleted:{
if(!qmlapp.enabledEffect) // 关闭动画
contentItem.highlightMoveDuration = 0
}

Repeater {
model: tabsModel

Item {
visible: SwipeView.isCurrentItem
Component.onCompleted: {
modelData.component.parent = this
modelData.component.visible = true
}
}
}
}

// 上方 选项栏
Item {
id: topContainer
Expand Down Expand Up @@ -140,32 +168,4 @@ Item {
}

}

// 下方 选项页
SwipeView {
id: swipeView
anchors.left: parent.left
anchors.right: parent.right
anchors.top: topContainer.bottom
anchors.bottom: parent.bottom
anchors.topMargin: size_.smallSpacing
currentIndex: bar.currentIndex
interactive: false // 禁止直接滑动视图本身
Component.onCompleted:{
if(!qmlapp.enabledEffect) // 关闭动画
contentItem.highlightMoveDuration = 0
}

Repeater {
model: tabsModel

Item {
visible: SwipeView.isCurrentItem
Component.onCompleted: {
modelData.component.parent = this
modelData.component.visible = true
}
}
}
}
}

0 comments on commit b7170f2

Please sign in to comment.