-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added SwitcherType and TabButtonType
- change CheckBoxType root type - added PageTest
- Loading branch information
Showing
9 changed files
with
492 additions
and
280 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
|
||
Switch { | ||
id: root | ||
|
||
property string checkedIndicatorColor: "#412102" | ||
property string defaultIndicatorColor: "transparent" | ||
property string checkedIndicatorBorderColor: "#412102" | ||
property string defaultIndicatorBorderColor: "#494B50" | ||
|
||
property string checkedInnerCircleColor: "#FBB26A" | ||
property string defaultInnerCircleColor: "#D7D8DB" | ||
|
||
property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08) | ||
property string defaultIndicatorBackgroundColor: "transparent" | ||
|
||
indicator: Rectangle { | ||
implicitWidth: 52 | ||
implicitHeight: 32 | ||
x: content.width - width | ||
radius: 16 | ||
color: root.checked ? checkedIndicatorColor : defaultIndicatorColor | ||
border.color: root.checked ? checkedIndicatorBorderColor : defaultIndicatorBorderColor | ||
|
||
Behavior on color { | ||
PropertyAnimation { duration: 200 } | ||
} | ||
Behavior on border.color { | ||
PropertyAnimation { duration: 200 } | ||
} | ||
|
||
Rectangle { | ||
id: innerCircle | ||
|
||
anchors.verticalCenter: parent.verticalCenter | ||
x: root.checked ? parent.width - width - 4 : 8 | ||
width: root.checked ? 24 : 16 | ||
height: root.checked ? 24 : 16 | ||
radius: 23 | ||
color: root.checked ? checkedInnerCircleColor : defaultInnerCircleColor | ||
|
||
Behavior on x { | ||
PropertyAnimation { duration: 200 } | ||
} | ||
} | ||
|
||
Rectangle { | ||
anchors.centerIn: innerCircle | ||
width: 40 | ||
height: 40 | ||
radius: 23 | ||
color: hovered ? hoveredIndicatorBackgroundColor : defaultIndicatorBackgroundColor | ||
|
||
Behavior on color { | ||
PropertyAnimation { duration: 200 } | ||
} | ||
} | ||
} | ||
|
||
contentItem: ColumnLayout { | ||
id: content | ||
|
||
Text { | ||
text: root.text | ||
color: "#D7D8DB" | ||
font.pixelSize: 18 | ||
font.weight: 400 | ||
font.family: "PT Root UI VF" | ||
|
||
height: 22 | ||
Layout.fillWidth: true | ||
Layout.bottomMargin: 16 | ||
} | ||
} | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
cursorShape: Qt.PointingHandCursor | ||
enabled: false | ||
} | ||
} |
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,56 @@ | ||
import QtQuick | ||
import QtQuick.Controls | ||
|
||
TabButton { | ||
id: root | ||
|
||
property string hoveredColor: "#412102" | ||
property string defaultColor: "#2C2D30" | ||
property string selectedColor: "#FBB26A" | ||
|
||
property string textColor: "#D7D8DB" | ||
|
||
property bool isSelected: false | ||
|
||
implicitHeight: 48 | ||
|
||
hoverEnabled: true | ||
|
||
background: Rectangle { | ||
id: background | ||
|
||
anchors.fill: parent | ||
color: "transparent" | ||
|
||
Rectangle { | ||
width: parent.width | ||
height: 1 | ||
y: parent.height - height | ||
color: { | ||
if(root.isSelected) { | ||
return selectedColor | ||
} | ||
return hovered ? hoveredColor : defaultColor | ||
} | ||
|
||
Behavior on color { | ||
PropertyAnimation { duration: 200 } | ||
} | ||
} | ||
} | ||
|
||
contentItem: Text { | ||
anchors.fill: background | ||
height: 24 | ||
|
||
font.family: "PT Root UI" | ||
font.styleName: "normal" | ||
font.weight: 500 | ||
font.pixelSize: 16 | ||
color: textColor | ||
text: root.text | ||
|
||
horizontalAlignment: Text.AlignHCenter | ||
verticalAlignment: Text.AlignVCenter | ||
} | ||
} |
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
Oops, something went wrong.