-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
208 additions
and
28 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/TaoQuick/imports/TaoQuick/Qml/CusButton/CusButton_ImageBackground.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import QtQuick 2.10 | ||
import QtQuick.Controls 2.2 | ||
import ".." | ||
import "../.." | ||
Button { | ||
id: cusButtonImage | ||
|
||
property alias tipText: toolTip.text | ||
property alias tipItem: toolTip | ||
property alias tipVisible: toolTip.visible | ||
property alias tipDelay: toolTip.delay | ||
property alias tipTimeout: toolTip.timeout | ||
|
||
property string btnImgUr | ||
property color backgroundColor: "transparent" | ||
property color backgroundColor_pressed | ||
property color backgroundColor_hovered | ||
|
||
BasicTooltip { | ||
id: toolTip | ||
visible: cusButtonImage.hovered && String(text).length | ||
} | ||
background: Rectangle { | ||
width: cusButtonImage.width | ||
height: cusButtonImage.height | ||
color: cusButtonImage.pressed ? backgroundColor_pressed : ( cusButtonImage.hovered ? backgroundColor_hovered : backgroundColor) | ||
CusImage { | ||
anchors.centerIn: parent | ||
width: cusButtonImage.width | ||
height: cusButtonImage.height | ||
source: btnImgUr | ||
} | ||
} | ||
TransArea {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/TaoQuick/imports/TaoQuick/Qml/CusButton/CusRadioButton.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import QtQuick 2.10 | ||
import QtQuick.Controls 2.2 | ||
import ".." | ||
import "../.." | ||
|
||
RadioButton { | ||
id: cusRadioButton | ||
|
||
implicitHeight: Config.fixedHeight | ||
implicitWidth: 200 | ||
property alias tipText: toolTip.text | ||
property alias tipItem: toolTip | ||
property alias tipVisible: toolTip.visible | ||
property alias tipDelay: toolTip.delay | ||
property alias tipTimeout: toolTip.timeout | ||
|
||
property string btnImgNormal: Config.imagePathPrefix + "0_Common/RadioBtn.png" | ||
property string btnImgHovered: Config.imagePathPrefix + "0_Common/RadioBtn_Hover.png" | ||
property string btnImgPressed: Config.imagePathPrefix + "0_Common/RadioBtn_Checked.png" | ||
property string btnImgDisbaled: Config.imagePathPrefix + "0_Common/RadioBtn_Disabled.png" | ||
|
||
property string btnImgUr: { | ||
if (!cusRadioButton.enabled) { | ||
return btnImgDisbaled | ||
} else if (cusRadioButton.checked || cusRadioButton.pressed) { | ||
return btnImgPressed | ||
} else if (cusRadioButton.hovered) { | ||
return btnImgHovered | ||
} else { | ||
return btnImgNormal | ||
} | ||
} | ||
|
||
property color textColor: Config.textColor | ||
|
||
indicator: CusImage { | ||
x: cusRadioButton.leftPadding | ||
source: btnImgUr | ||
y: (cusRadioButton.height - height) /2 | ||
} | ||
|
||
contentItem: BasicText { | ||
height: cusRadioButton.height | ||
leftPadding: cusRadioButton.leftPadding + cusRadioButton.indicator.width + cusRadioButton.spacing | ||
text: cusRadioButton.text | ||
color: cusRadioButton.textColor | ||
horizontalAlignment: Text.AlignLeft | ||
} | ||
BasicTooltip { | ||
id: toolTip | ||
visible: cusRadioButton.hovered && String(text).length | ||
} | ||
TransArea {} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/TaoQuick/imports/TaoQuick/Qml/CusLabel/CusLabel_Center.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import QtQuick 2.10 | ||
import QtQuick.Controls 2.2 | ||
import ".." | ||
import "../.." | ||
Label { | ||
font.pixelSize: Config.fontSize_default | ||
color: Config.textColor | ||
height: Config.fixedHeight | ||
elide: Text.ElideRight | ||
verticalAlignment: Text.AlignVCenter | ||
horizontalAlignment: Text.AlignHCenter | ||
// renderType: Text.NativeRendering | ||
} |
13 changes: 13 additions & 0 deletions
13
src/TaoQuick/imports/TaoQuick/Qml/CusLabel/CusLabel_Left.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import QtQuick 2.10 | ||
import QtQuick.Controls 2.2 | ||
import ".." | ||
import "../.." | ||
Label { | ||
font.pixelSize: Config.fontSize_default | ||
color: Config.textColor | ||
height: Config.fixedHeight | ||
elide: Text.ElideRight | ||
verticalAlignment: Text.AlignVCenter | ||
horizontalAlignment: Text.AlignLeft | ||
// renderType: Text.NativeRendering | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters