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

update CheckBox;update ComboBox

This commit is contained in:
jared 2020-10-21 10:49:07 +08:00
parent e25e26ce39
commit 702e697d95
32 changed files with 180 additions and 193 deletions

View File

@ -63,10 +63,12 @@ Item {
CusComboBox {
model: 10
width: 120
displayText: qsTr(currentText) + trans.transString
}
CusComboBox {
model: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
width: 120
displayText: qsTr(currentText) + trans.transString
}
}
Item {

View File

@ -38,13 +38,7 @@
<file>Image/Effect/Dissolve_2.png</file>
<file>Image/Effect/girl.jpg</file>
<file>Image/Effect/soundRect.png</file>
<file>Image/Tao/qq.jpg</file>
<file>Image/Tao/qq_connect.jpg</file>
<file>Image/Tao/qqgroup.jpg</file>
<file>Image/Tao/qqgroup2.jpg</file>
<file>Image/Tao/weixin.jpg</file>
<file>Image/Tao/weixin_connect.jpg</file>
<file>Image/Tao/weixingongzhonghao.jpg</file>
<file>Image/Tao/zhifubao.jpg</file>
<file>Image/Common/left.png</file>
<file>Image/Common/left_hovered.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -11,5 +11,7 @@
<file>Qml/Pane/TitlePane.qml</file>
<file>Qml/Page/Home.qml</file>
<file>Qml/Pane/ContentModel.qml</file>
<file>Qml/Dialog/AboutDialog.qml</file>
<file>Qml/Dialog/SettingsDialog.qml</file>
</qresource>
</RCC>

View File

@ -1,128 +1,133 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import TaoQuick 1.0
import "../Biz"
Popup {
id: root
width: 600
height: 340
width: 680
height: 460
background: Rectangle {
id: back
background: Item {
width: root.width
height: root.height
radius: 8
color: gConfig.themeColor
border.width: 1
border.color: gConfig.reserverColor
MoveArea {
anchors.fill: parent
control: root
onMove: {
root.x += xOffset
root.y += yOffset
Rectangle {
id: back
anchors {
fill: parent
margins: 4
}
}
Image {
id: img
anchors.left: parent.left
anchors.leftMargin: 2
anchors.verticalCenter: parent.verticalCenter
source: imgPath + "logo/milk.png"
}
CusButton {
id: closeBtn
text: qsTr("Close")
width: 80
height: 38
radius: 8
backgroundColor: containsPress ? Qt.darker(gConfig.background, 1.2) : (containsMouse ? Qt.lighter(gConfig.background, 1.2) : gConfig.background)
textColor: gConfig.textColor
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 4
onClicked: {
root.close()
}
}
Column {
anchors.left: img.right
anchors.leftMargin: 4
anchors.top: parent.top
anchors.topMargin: 4
anchors.bottom: closeBtn.top
anchors.right: parent.right
spacing: 18
Text {
anchors.left: parent.left
anchors.right: parent.right
text: appInfo.appName + " " + appInfo.appVersion
font.pixelSize: 20
renderType: Text.NativeRendering
}
Text {
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
text: "Base on Qt " + appInfo.compilerVendor
font.pixelSize: 16
renderType: Text.NativeRendering
}
Text {
anchors.left: parent.left
anchors.right: parent.right
text: "Build on " + appInfo.buildDateTime
font.pixelSize: 16
renderType: Text.NativeRendering
}
TextInput {
anchors.left: parent.left
anchors.right: parent.right
readOnly: true
selectByMouse: true
text: "From revision " + appInfo.buildRevision
font.pixelSize: 16
font.underline: true
renderType: Text.NativeRendering
}
Text {
anchors.left: parent.left
anchors.right: parent.right
text: appInfo.copyRight
font.pixelSize: 16
renderType: Text.NativeRendering
}
Text {
anchors.left: parent.left
anchors.right: parent.right
textFormat: Text.RichText
text: "Author JaredTao <a href=\"https://jaredtao.github.io\">JaredTao Blog</a>"
onLinkActivated: {
Qt.openUrlExternally("https://jaredtao.github.io")
radius: 4
color: CusConfig.themeColor
MoveArea {
anchors.fill: parent
control: root
onMove: {
root.x += xOffset
root.y += yOffset
}
font.pixelSize: 16
renderType: Text.NativeRendering
}
TextArea {
readOnly: true
CusImage {
id: img
anchors.left: parent.left
anchors.right: parent.right
text: appInfo.descript
font.pixelSize: 16
renderType: Text.NativeRendering
anchors.leftMargin: 2
anchors.verticalCenter: parent.verticalCenter
source: imgPath + "logo/milk.png"
}
CusButton {
id: closeBtn
text: qsTr("Close") + trans.transString
width: 80
height: 38
radius: 8
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 4
onClicked: {
root.close()
}
}
Column {
anchors.left: img.right
anchors.leftMargin: 4
anchors.top: parent.top
anchors.topMargin: 4
anchors.bottom: closeBtn.top
anchors.bottomMargin: 260
anchors.right: parent.right
spacing: 18
BasicText {
anchors.horizontalCenter: parent.horizontalCenter
text: appInfo.appName + " " + appInfo.appVersion
font.pixelSize: 20
font.bold: true
}
BasicText {
anchors.horizontalCenter: parent.horizontalCenter
text: "Base on Qt " + appInfo.compilerVendor
}
BasicText {
anchors.horizontalCenter: parent.horizontalCenter
text: "Build on " + appInfo.buildDateTime
}
CusTextInput {
anchors.horizontalCenter: parent.horizontalCenter
readOnly: true
text: "From revision " + appInfo.buildRevision
font.underline: true
}
BasicText {
anchors.horizontalCenter: parent.horizontalCenter
text: appInfo.copyRight
}
BasicText {
anchors.horizontalCenter: parent.horizontalCenter
textFormat: Text.RichText
text: "Author JaredTao <a href=\"https://jaredtao.github.io\">JaredTao Blog</a>"
onLinkActivated: {
Qt.openUrlExternally("https://jaredtao.github.io")
}
TransArea {
cursorShape: Qt.PointingHandCursor
}
}
}
Row {
anchors {
bottom: closeBtn.top
bottomMargin: 4
horizontalCenter: parent.horizontalCenter
}
spacing: 20
BasicText {
text: qsTr("Sponsors") + trans.transString
anchors.verticalCenter: parent.verticalCenter
}
CusImage {
source: imgPath + "Tao/weixin.jpg"
}
CusImage {
source: imgPath + "Tao/zhifubao.jpg"
}
}
}
DropShadow {
source: back
anchors.fill: back
radius: 4
samples: 16
color: "#80000000"
}
}
function show()
{
function show() {
x = (parent.width - width) / 2
y = (parent.height - height) / 2
open()
}
}

View File

@ -18,6 +18,7 @@ Item {
right: parent.right
rightMargin: 4
}
placeholderText: qsTr("Search") + trans.transString
}
}
Rectangle {

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.2
import TaoQuick 1.0
import "./Page"
import "./Pane"
import "./Dialog"
//import Qt.labs.platform 1.1
CusBackground {
id: rootItem
@ -29,9 +30,9 @@ CusBackground {
// }
// }
// }
// AboutDialog {
// id: aboutDialog
// }
AboutDialog {
id: aboutDialog
}
// SettingsDialog {
// id: settingDialog
// }

View File

@ -15,7 +15,7 @@ static void prepareApp()
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setOrganizationName("JaredTao");
QCoreApplication::setOrganizationDomain("https://JaredTao.gitee.io");
QCoreApplication::setApplicationName("TaoQuickApp");
QCoreApplication::setApplicationName("TaoQuickShow");
}
int main(int argc, char** argv)

View File

@ -338,6 +338,11 @@
{
"key": "Misc",
"value": "杂项"
},
{
"key": "Sponsors",
"value": "赞助"
}
]
}

Binary file not shown.

View File

@ -13,12 +13,12 @@
#define VER_COMPANYNAME_STR "JaredTao\0"
#define VER_FILEDESCRIPTION_STR "TaoQuickDemo\0"
#define VER_FILEDESCRIPTION_STR "TaoQuickShow\0"
#define VER_INTERNALNAME_STR "jaredtao.github.io\0"
#define VER_LEGALCOPYRIGHT_STR "Copyright(C)2019-2029 JaredTao\0"
#define VER_LEGALTRADEMARKS_STR "JaredTao\0"
#define VER_ORIGINALFILENAME_STR "TaoQuickDemo.exe\0"
#define VER_PRODUCTNAME_STR "TaoQuickDemo\0"
#define VER_ORIGINALFILENAME_STR "TaoQuickShow.exe\0"
#define VER_PRODUCTNAME_STR "TaoQuickShow\0"
// version number (string)
#define TOSTRING2(arg) #arg

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

View File

@ -6,19 +6,12 @@ import "../.."
CheckBox {
id: cusCheckBox
height: CusConfig.fixedHeight
implicitHeight: CusConfig.fixedHeight
// background: Rectangle {
// color: cusCheckBox.enabled ? Config.controlBackgroundColor : Config.controlBackgroundColor_disabled
// radius: Config.controlBorderRadius
// border.width: 1
// border.color: cusCheckBox.hovered ? Config.controlBorderColor_hovered : Config.controlBorderColor
// }
checked: false
contentItem: CusLabel {
leftPadding: cusCheckBox.indicator.width + cusCheckBox.spacing
text: cusCheckBox.text
font: cusCheckBox.font
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
@ -28,14 +21,7 @@ CheckBox {
property color colorHovered: CusConfig.imageColor_hovered
property color colorPressed: CusConfig.imageColor_pressed
property color colorDisable: CusConfig.imageColor_disabled
// readonly property string imgUrlNormal: CusConfig.imagePathPrefix + "Checkbox_16.png"
// readonly property string imgUrlChecked: CusConfig.imagePathPrefix + "Checkbox_16_Checked.png"
// readonly property string imgUrlHovered: CusConfig.imagePathPrefix + "Checkbox_16_Hover.png"
// readonly property string imgUrlDisable: CusConfig.imagePathPrefix + "Checkbox_16_Disable.png"
// readonly property string imgUrlCheckedDisable: CusConfig.imagePathPrefix + "Checkbox_16_Checked_Disable.png"
readonly property string imgUrlBorder: CusConfig.imagePathPrefix + "checkbox_border.png"
readonly property string imgUrlCheck: CusConfig.imagePathPrefix + "checkbox_check.png"
readonly property string imgUrlCheck: CusConfig.imagePathPrefix + "Check.png"
CusImage {
id: baseImgCheck
@ -43,38 +29,24 @@ CheckBox {
visible: false
source: imgUrlCheck
}
CusImage {
id: baseImgBorder
smooth: true
visible: false
source: imgUrlBorder
}
indicator: ColorOverlay {
id: indicatorImg
indicator: Rectangle {
implicitWidth: 24
implicitHeight: 24
x: cusCheckBox.leftPadding
y: cusCheckBox.height / 2 - height / 2
source: baseImgBorder
width: baseImgBorder.width
height: baseImgBorder.height
cached: true
color: {
if (!cusCheckBox.enabled) {
return colorDisable
} else if (cusCheckBox.pressed) {
return colorPressed
} else if (cusCheckBox.hovered) {
return colorHovered
} else {
return colorNormal
}
}
y: (cusCheckBox.height - height) / 2
color: cusCheckBox.enabled ? CusConfig.controlColor : CusConfig.controlColor_disabled
radius: CusConfig.controlBorderRadius
border.width: 1
border.color: cusCheckBox.pressed ? CusConfig.controlBorderColor_pressed : (cusCheckBox.hovered ? CusConfig.controlBorderColor_hovered : CusConfig.controlBorderColor)
ColorOverlay {
anchors.fill: parent
anchors.margins: 2
id: indicatorImg
source: baseImgCheck
visible: cusCheckBox.checked
width: baseImgCheck.width
height: baseImgCheck.height
anchors.centerIn: parent
cached: true
visible: cusCheckBox.checked
color: {
if (!cusCheckBox.enabled) {
return colorDisable

View File

@ -11,7 +11,6 @@ ComboBox {
rightPadding: 4
currentIndex: 0
readonly property string imgUrlNormal: CusConfig.imagePathPrefix + "ComboBox_Down.png"
readonly property string imgUrlHovered: CusConfig.imagePathPrefix + "ComboBox_Down_Hover.png"
property real defaultHeight: CusConfig.fixedHeight * 6
displayText: qsTr(currentText)
@ -26,7 +25,6 @@ ComboBox {
leftPadding: cusComboBox.leftPadding
rightPadding: cusComboBox.indicator.width + cusComboBox.spacing
text: cusComboBox.displayText
font: cusComboBox.font
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
@ -45,28 +43,35 @@ ComboBox {
smooth: true
visible: false
}
indicator: ColorOverlay {
indicator: Item {
height: cusComboBox.height - cusComboBox.topPadding - cusComboBox.bottomPadding
width: height
x: cusComboBox.width - width - cusComboBox.rightPadding
y: cusComboBox.topPadding + (cusComboBox.availableHeight - height) / 2
source: baseImage
width: baseImage.width
height: baseImage.height
cached: true
color: {
if (!cusComboBox.enabled) {
return colorDisable
} else if (cusComboBox.pressed) {
return colorPressed
} else if (cusComboBox.hovered) {
return colorHovered
} else {
return colorNormal
y: (cusComboBox.height - height) / 2
ColorOverlay {
anchors {
centerIn: parent
}
}
rotation: cusComboBox.popup.visible ? 180 : 0
Behavior on rotation {
NumberAnimation {
duration: 200
source: baseImage
width: baseImage.width
height: baseImage.height
cached: true
color: {
if (!cusComboBox.enabled) {
return colorDisable
} else if (cusComboBox.pressed) {
return colorPressed
} else if (cusComboBox.hovered) {
return colorHovered
} else {
return colorNormal
}
}
rotation: cusComboBox.popup.visible ? 180 : 0
Behavior on rotation {
NumberAnimation {
duration: 200
}
}
}
}
@ -97,7 +102,7 @@ ComboBox {
background: Rectangle {
color: CusConfig.controlColor
// radius: CusConfig.controlBorderRadius
// radius: CusConfig.controlBorderRadius
border.width: 1
border.color: CusConfig.controlBorderColor
}

View File

@ -1,7 +1,6 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import ".."
import "../.."
Image {
width: sourceSize.width
height: sourceSize.height

View File

@ -11,11 +11,11 @@ TextField {
maximumLength: CusConfig.maximumLength
selectionColor: CusConfig.controlColor_pressed
selectedTextColor: CusConfig.textColor_pressed
font.pixelSize: CusConfig.fontPixel
background: Rectangle {
color: (cusTextField.enabled && !cusTextField.readOnly) ? CusConfig.controlColor : CusConfig.controlColor_disabled
radius: CusConfig.controlBorderRadius
border.width: 1
border.color: (cusTextField.enabled && !cusTextField.readOnly && (cusTextField.hovered || cusTextField.focus)) ? CusConfig.controlBorderColor_hovered : CusConfig.controlBorderColor
}
}

View File

@ -8,7 +8,7 @@ CusTextField {
implicitWidth: 240
height: CusConfig.fixedHeight
placeholderText: qsTr("Search")
leftPadding: 36
rightPadding: 30
background: Rectangle {

View File

@ -5,9 +5,13 @@ import "../.."
TextInput {
id: cusTextField
height: CusConfig.fixedHeight
font.pixelSize: CusConfig.fontPixel
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
selectByMouse: true
color: CusConfig.textColor
maximumLength: CusConfig.maximumLength
selectionColor: CusConfig.controlColor_pressed
selectedTextColor: CusConfig.textColor_pressed
renderType: Text.NativeRendering
}

View File

@ -13,7 +13,6 @@ SpinBox {
rightPadding: 4
readonly property string imgUrlNormal : CusConfig.imagePathPrefix + "Expanded.png";
readonly property string imgUrlHovered : CusConfig.imagePathPrefix + "Expanded_Hover.png";
background: Rectangle {
radius: CusConfig.controlBorderRadius
color: CusConfig.controlColor
@ -24,7 +23,6 @@ SpinBox {
id: input
z: 2
// text: cusSpinBox.value
font: cusSpinBox.font
color: CusConfig.textColor
width: cusSpinBox.width - cusSpinBox.up.indicator.width - cusSpinBox.leftPadding - cusSpinBox.rightPadding
selectionColor: CusConfig.controlColor_pressed

View File

@ -74,8 +74,7 @@
<file>Qml/Misc/CusRectDraw.qml</file>
<file>Qml/Misc/CusResizeBorder.qml</file>
<file>Qml/Misc/CusShortCutKeys.qml</file>
<file>Images/checkbox_border.png</file>
<file>Images/checkbox_check.png</file>
<file>Images/Check.png</file>
<file>Images/ComboBox_Down.png</file>
<file>Images/Expanded.png</file>
<file>Images/Search.png</file>