qml: split background and indicator on option switch #169

Manually merged
promag merged 1 commit from option-switch into main 2022-09-15 20:23:31 +00:00 AGit
promag commented 2022-09-08 13:38:40 +00:00 (Migrated from github.com)

Alternative to bitcoin-core/gui-qml#161.

nit, it also animates the indicator.

Links for Windows and macOS build artifacts

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

Alternative to bitcoin-core/gui-qml#161. nit, it also animates the indicator. Links for Windows and macOS build artifacts [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/169) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/169) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/169) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/169)
jarolrod (Migrated from github.com) approved these changes 2022-09-09 00:55:20 +00:00
jarolrod (Migrated from github.com) left a comment

ACK c50e6bc3ac

Confirmed that this fixes the issue, and is a better approach than 161.

master 161 169
master 161 169

The indicator is indeed now animated but I like it. It's not clear wether we wanted some type of animation or not, what better animation than a free one? CC: @GBKS @mouxdesign

ACK c50e6bc3ac822306bbae84c69fcc059bb20f59bd Confirmed that this fixes the issue, and is a better approach than 161. | master | 161 | 169 | | ------- | --- | ---- | | <img width="93" alt="master" src="https://user-images.githubusercontent.com/23396902/189249219-e8868758-2459-4823-8894-4eab9698460a.png"> | <img width="93" alt="161" src="https://user-images.githubusercontent.com/23396902/189249242-86e74e83-32b3-49b3-817c-4d678f87cfd5.png"> | <img width="93" alt="169" src="https://user-images.githubusercontent.com/23396902/189249264-dc643955-198d-4556-9463-31c479b863ba.png"> | The indicator is indeed now animated but I like it. It's not clear wether we wanted some type of animation or not, what better animation than a free one? CC: @GBKS @mouxdesign
shaavan (Migrated from github.com) reviewed 2022-09-09 16:52:18 +00:00
shaavan (Migrated from github.com) left a comment

I prefer this PR's approach over #161, as this creates proper segregation between the switch's background and the indicator.
The added animation is clearly noticeable, and I like the smoothness it provides while toggling switch states. However, I would like to listen to the designers' take on it as well before giving my final ACK on this.

I prefer this PR's approach over #161, as this creates proper segregation between the switch's background and the indicator. The added animation is clearly noticeable, and I like the smoothness it provides while toggling switch states. However, I would like to listen to the designers' take on it as well before giving my final ACK on this.
shaavan (Migrated from github.com) commented 2022-09-09 16:51:16 +00:00
        radius: 18

Though changing this value does not indicate visual difference, I think it is still better to make this change as this matches the value given in the design Figma file.

```suggestion radius: 18 ``` Though changing this value does not indicate visual difference, I think it is still better to make this change as this matches the value given in the [design Figma file](https://www.figma.com/file/GaCoOSNHB2yMB9ThiDtred/Bitcoin-Core-App).
promag (Migrated from github.com) reviewed 2022-09-09 19:07:51 +00:00
promag (Migrated from github.com) commented 2022-09-09 19:07:51 +00:00

more than 10 makes no sense, right?

more than 10 makes no sense, right?
shaavan (Migrated from github.com) reviewed 2022-09-12 10:55:18 +00:00
shaavan (Migrated from github.com) commented 2022-09-12 10:55:18 +00:00

Yes, it doesn't, and I agree with that.
But I feel a little iffy about having the value inconsistent with the design file.

However, this is just a tiny nit and can be safely ignored if you want.

Yes, it doesn't, and I agree with that. But I feel a little iffy about having the value inconsistent with the design file. However, this is just a tiny nit and can be safely ignored if you want.
promag (Migrated from github.com) reviewed 2022-09-12 20:02:15 +00:00
promag (Migrated from github.com) commented 2022-09-12 20:02:15 +00:00

@GBKS thoughts?

@GBKS thoughts?
GBKS (Migrated from github.com) reviewed 2022-09-13 05:50:29 +00:00
GBKS (Migrated from github.com) commented 2022-09-13 05:50:29 +00:00

In Figma, the small circle in the toggle is 20px tall, the big one is 28px tall. So the radii of 10px and 14px would be the minimum.

I sometimes set them to 500px or some other ridiculously high number because it doesn't matter in Figma if you're over the exact value. But if you want to be precise, then half the height is what it should be. Looks like for the smaller size, I simply kept the value of the larger one. 10px would be the precise number.

In Figma, the small circle in the toggle is 20px tall, the big one is 28px tall. So the radii of 10px and 14px would be the minimum. I sometimes set them to 500px or some other ridiculously high number because it doesn't matter in Figma if you're over the exact value. But if you want to be precise, then half the height is what it should be. Looks like for the smaller size, I simply kept the value of the larger one. 10px would be the precise number.
Sign in to join this conversation.
No description provided.