Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change checkbox style #2160

Merged
merged 4 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/themes/Binance - Dark/colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"gradientButtonTextHoveredColor": "#000000FF",
"gradientButtonTextPressedColor": "#000000FF",

"checkBoxTickColor": "#FFFFFFFF",
"checkBoxGradientStartColor": "#cb9800FF",
"checkBoxGradientEndColor": "#EBB514FF",

Expand Down
5 changes: 3 additions & 2 deletions assets/themes/Default - Dark/colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"gradientButtonTextHoveredColor": "#FFFFFFFF",
"gradientButtonTextPressedColor": "#FFFFFFFF",

"checkBoxGradientStartColor": "#8892EBFF",
"checkBoxGradientEndColor": "#9DD4F3FF",
"checkBoxTickColor": "#FFFFFFFF",
"checkBoxGradientStartColor": "#6673E3FF",
"checkBoxGradientEndColor": "#5EBBF0FF",

"switchGradientStartColor": "#1D80B0FF",
"switchGradientEndColor": "#5B69E6FF",
Expand Down
1 change: 1 addition & 0 deletions assets/themes/Default - Light/colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"gradientButtonTextHoveredColor": "#FFFFFFFF",
"gradientButtonTextPressedColor": "#FFFFFFFF",

"checkBoxTickColor": "#456078FF",
"checkBoxGradientStartColor": "#8892EBFF",
"checkBoxGradientEndColor": "#9DD4F3FF",

Expand Down
26 changes: 16 additions & 10 deletions atomic_defi_design/Dex/Addressbook/AddAddressForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,22 @@ Dex.Rectangle
showAssetStandards: useStandardsCheckBox.checked
}

Dex.DefaultCheckBox
{
id: useStandardsCheckBox
Layout.preferredWidth: 150
Layout.fillHeight: true
Layout.leftMargin: 4
boxWidth: 22
boxHeight: 22
text: qsTr("Use standard network address")
font: Dex.DexTypo.caption
RowLayout {
id: rowLayout
spacing: 4
Dex.DefaultCheckBox
{
id: useStandardsCheckBox
Layout.preferredWidth: 30
Layout.fillHeight: true
Layout.leftMargin: 4
}
Dex.DefaultText {
Layout.minimumWidth: 120
Layout.maximumWidth: 120
text: qsTr("Use standard network address")
font: Dex.DexTypo.caption
}
}
}

Expand Down
23 changes: 20 additions & 3 deletions atomic_defi_design/Dex/Components/DexCheckBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ CheckBox
id: _indicator
anchors.verticalCenter: control.verticalCenter

implicitWidth: 26
implicitHeight: 26
radius: 20
implicitWidth: 20
implicitHeight: 20
radius: 4

gradient: Gradient
{
Expand All @@ -37,6 +37,23 @@ CheckBox
GradientStop { position: 0.6; color: Dex.CurrentTheme.checkBoxGradientEndColor }
}

DefaultImage {
id: check_icon
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: parent.width - 6
height: parent.height - 6
source: General.image_path + "white_check.svg"
visible: control.checkState === Qt.Checked
}

DefaultColorOverlay
{
anchors.fill: check_icon
source: check_icon
color: Dex.CurrentTheme.checkBoxTickColor
}

DefaultRectangle
{
visible: !control.checked
Expand Down
2 changes: 0 additions & 2 deletions atomic_defi_design/Dex/Portfolio/Portfolio.qml
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ Item {
id: hide_zero_balance_checkbox

spacing: 2
boxWidth: 24
boxHeight: 24

label.wrapMode: Label.NoWrap
label.font.pixelSize: 14
Expand Down
2 changes: 2 additions & 0 deletions atomic_defi_design/Dex/Themes/CurrentTheme.qml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ ThemeData
gradientButtonTextHoveredColor = Dex.Color.argbStrFromRgbaStr(themeData.gradientButtonTextHoveredColor || defaultTheme.gradientButtonTextHoveredColor);
gradientButtonTextPressedColor = Dex.Color.argbStrFromRgbaStr(themeData.gradientButtonTextPressedColor || defaultTheme.gradientButtonTextPressedColor);

checkBoxTickColor = Dex.Color.argbStrFromRgbaStr(themeData.checkBoxTickColor || defaultTheme.checkBoxTickColor);
checkBoxGradientStartColor = Dex.Color.argbStrFromRgbaStr(themeData.checkBoxGradientStartColor || defaultTheme.checkBoxGradientStartColor);
checkBoxGradientEndColor = Dex.Color.argbStrFromRgbaStr(themeData.checkBoxGradientEndColor || defaultTheme.checkBoxGradientEndColor);

Expand Down Expand Up @@ -240,6 +241,7 @@ ThemeData
console.info("Dex.Themes.CurrentTheme.printValues.gradientButtonTextHoveredColor : %1".arg(gradientButtonTextHoveredColor));
console.info("Dex.Themes.CurrentTheme.printValues.gradientButtonTextPressedColor : %1".arg(gradientButtonTextPressedColor));

console.info("Dex.Themes.CurrentTheme.printValues.checkBoxTickColor : %1".arg(checkBoxTickColor));
console.info("Dex.Themes.CurrentTheme.printValues.checkBoxGradientStartColor : %1".arg(checkBoxGradientStartColor));
console.info("Dex.Themes.CurrentTheme.printValues.checkBoxGradientEndColor : %1".arg(checkBoxGradientEndColor));

Expand Down
1 change: 1 addition & 0 deletions atomic_defi_design/Dex/Themes/DefaultTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function getHardcoded()
gradientButtonTextHoveredColor: "#FFFFFFFF",
gradientButtonTextPressedColor: "#FFFFFFFF",

checkBoxTickColor: "#000000FF",
checkBoxGradientStartColor: "#8892EBFF",
checkBoxGradientEndColor: "#9DD4F3FF",

Expand Down
1 change: 1 addition & 0 deletions atomic_defi_design/Dex/Themes/ThemeData.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ QtObject
property color gradientButtonTextHoveredColor
property color gradientButtonTextPressedColor

property color checkBoxTickColor
property color checkBoxGradientStartColor
property color checkBoxGradientEndColor

Expand Down
40 changes: 40 additions & 0 deletions atomic_defi_design/assets/images/white_check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.