1
0
mirror of https://github.com/jaredtao/TaoQuick.git synced 2025-01-31 21:22:58 +08:00

add PageIndicator

This commit is contained in:
jared 2020-10-22 10:23:38 +08:00
parent cc9ac69b36
commit 7095ab73c2
8 changed files with 74 additions and 6 deletions

View File

@ -74,5 +74,14 @@ Item {
busyColor: Qt.lighter("#008b8b", 1.6)
}
}
CusLabel {
text: qsTr("PageIndicator") + trans.transString
wrapMode: Label.WordWrap
width: 400
}
CusPageIndicator {
width: 200
count: 15
}
}
}

View File

@ -3,8 +3,8 @@ import QtQuick 2.9
import TaoQuick 1.0
CusButton_Image {
width: 20
height: 20
implicitWidth: 24
implicitHeight: 24
tipText: qsTr("Close") + trans.transString
btnImgUrl: imgPath + (hovered || pressed ? "Window/close_white.png" : "Window/close_gray.png")
}

View File

@ -24,12 +24,14 @@ Rectangle {
property bool isMaxed: view.isMax
Row {
id: controlButtons
height: 16
height: 24
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
spacing: 20
CusButton_Image {
width: 24
height: 24
btnImgUrl: imgPath + (hovered || pressed ? "Window/minimal_white.png" : "Window/minimal_gray.png")
tipText: qsTr("minimal") + trans.transString
onClicked: {
@ -37,6 +39,8 @@ Rectangle {
}
}
CusButton_Image {
width: 24
height: 24
visible: !isMaxed
btnImgUrl: imgPath + (hovered || pressed ? "Window/max_white.png" : "Window/max_gray.png")
tipText: qsTr("maximize") + trans.transString
@ -45,6 +49,8 @@ Rectangle {
}
}
CusButton_Image {
width: 24
height: 24
visible: isMaxed
btnImgUrl: imgPath
+ (hovered || pressed ? "Window/normal_white.png" : "Window/normal_gray.png")
@ -54,6 +60,8 @@ Rectangle {
}
}
CloseBtn {
width: 24
height: 24
onClicked: {
view.close()
}
@ -70,18 +78,24 @@ Rectangle {
}
Row {
id: toolRow
height: 16
height: 24
anchors.verticalCenter: parent.verticalCenter
anchors.right: splitLine.left
anchors.rightMargin: 20
spacing: 20
SkinBtn {
width: 24
height: 24
anchors.verticalCenter: parent.verticalCenter
}
LangBtn {
width: 24
height: 24
anchors.verticalCenter: parent.verticalCenter
}
CusButton_Image {
width: 24
height: 24
anchors.verticalCenter: parent.verticalCenter
tipText: qsTr("Settings") + trans.transString
btnImgUrl: imgPath
@ -91,6 +105,8 @@ Rectangle {
}
}
CusButton_Image {
width: 24
height: 24
anchors.verticalCenter: parent.verticalCenter
tipText: qsTr("About") + trans.transString
btnImgUrl: imgPath

View File

@ -5,8 +5,8 @@ import "../.."
Button {
id: cusButtonImage
implicitWidth: 30
implicitHeight: 30
implicitWidth: 24
implicitHeight: 24
property alias tipText: toolTip.text
property alias tipItem: toolTip

View File

@ -0,0 +1,27 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import ".."
import "../.."
PageIndicator {
id: control
implicitHeight: CusConfig.fixedHeight
delegate: Rectangle {
implicitWidth: 40
implicitHeight: control.height
color: area.containsMouse ? CusConfig.controlBorderColor_hovered : (index === control.currentIndex ? CusConfig.controlColor_pressed : CusConfig.controlBorderColor)
CusLabel {
anchors.centerIn: parent
text: index
}
MouseArea {
id: area
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
control.currentIndex = index
}
}
}
}

View File

@ -73,6 +73,7 @@
<file>Qml/Misc/CusDialog.qml</file>
<file>Qml/Misc/CusDragItem.qml</file>
<file>Qml/Misc/CusFPS.qml</file>
<file>Qml/Misc/CusPageIndicator.qml</file>
<file>Qml/Misc/CusRectDraw.qml</file>
<file>Qml/Misc/CusResizeBorder.qml</file>
<file>Qml/Misc/CusShortCutKeys.qml</file>

View File

@ -965,6 +965,20 @@ MetaInfo {
Property { name: "height"; type: "int"; value: 80 }
}
}
Type {
name: "TaoQuick.Qml.Misc.CusPageIndicator"
icon: "images/CusPageIndicator.png"
ItemLibraryEntry {
name: "CusPageIndicator"
category: "TaoQuick - Misc"
libraryIcon: "images/CusPageIndicator.png"
version: "1.0"
requiredImport: "TaoQuick"
Property { name: "width"; type: "int"; value: 120 }
Property { name: "height"; type: "int"; value: 80 }
}
}
Type {
name: "TaoQuick.Qml.Misc.CusRectDraw"
icon: "images/CusRectDraw.png"

View File

@ -70,6 +70,7 @@ CusBusyIndicator 1.0 Qml/Misc/CusBusyIndicator.qml
CusDialog 1.0 Qml/Misc/CusDialog.qml
CusDragItem 1.0 Qml/Misc/CusDragItem.qml
CusFPS 1.0 Qml/Misc/CusFPS.qml
CusPageIndicator 1.0 Qml/Misc/CusPageIndicator.qml
CusRectDraw 1.0 Qml/Misc/CusRectDraw.qml
CusResizeBorder 1.0 Qml/Misc/CusResizeBorder.qml
CusShortCutKeys 1.0 Qml/Misc/CusShortCutKeys.qml