Skip to content

Commit

Permalink
优化关于页UI
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroi-sora committed Mar 27, 2024
1 parent 5cee3fb commit 564c233
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
2 changes: 2 additions & 0 deletions UmiOCR-data/qt_res/qml/TabPages/About/About.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ TabPage {
Column {
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: size_.spacing * 2
spacing: size_.spacing
clip: true

// ==================== 标题 ====================

Expand Down
22 changes: 20 additions & 2 deletions UmiOCR-data/qt_res/qml/TabPages/About/UrlButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,28 @@ import QtQuick.Controls 2.15
import "../../Widgets"

Button_ {
id: btn
property string url: ""
textColor_: theme.specialTextColor
toolTip: url
// toolTip: url
height: size_.text + size_.spacing * 2
bgHoverColor_: theme.coverColor1

contentItem: Text_ {
text: btn.text_
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: theme.specialTextColor

// 手动绘制下划线,减少抖动现象。不使用 font.underline
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.bottomMargin: -2
height: 1
color: theme.specialTextColor
}
}

onClicked: {
Qt.openUrlExternally(url)
Expand Down
29 changes: 18 additions & 11 deletions UmiOCR-data/qt_res/qml/TabPages/About/UrlList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,40 @@ import QtQuick.Controls 2.15
import ".."
import "../../Widgets"

Flow {
Item {
id: uRoot
property string title: ""
property var urlList: [] // {"text", "url"}
property int textSize: size_.text

anchors.left: parent.left
anchors.right: parent.right
// spacing: size_.spacing
spacing: 0
height: flow.height

Text_ {
id: lText
anchors.left: parent.left
anchors.top: parent.top
height: textSize + size_.spacing * 2
verticalAlignment: Text.AlignVCenter
text: title + ""
font.pixelSize: textSize
}
// Item { height: 1; width: size_.spacing }

Repeater {
model: urlList
Flow {
id: flow
anchors.left: lText.right
anchors.right: parent.right
spacing: 0
Repeater {
model: urlList

UrlButton {
height: textSize + size_.spacing * 2
text_: urlList[index].text
url: urlList[index].url
textSize: uRoot.textSize
UrlButton {
height: textSize + size_.spacing * 2
text_: urlList[index].text
url: urlList[index].url
textSize: uRoot.textSize
}
}
}
}

0 comments on commit 564c233

Please sign in to comment.