Fix options switch alignment within settings #161

Closed
jarolrod wants to merge 1 commit from fix-option-switch-alignment into main AGit
jarolrod commented 2022-08-15 19:15:18 +00:00 (Migrated from github.com)

Fixes alignment of the option switch within a settings row.

master PR
master-option fix-option-pr

Closes bitcoin-core/gui-qml#159

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

Fixes alignment of the option switch within a settings row. | master | PR | | --------- | ---- | | ![master-option](https://user-images.githubusercontent.com/23396902/184701651-89911f6c-5c9c-444e-8d37-93c7ba22e41b.png) | ![fix-option-pr](https://user-images.githubusercontent.com/23396902/184701668-44b61954-abe2-4af4-9c4e-76a7690ef466.png) | Closes bitcoin-core/gui-qml#159 [![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/161) [![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/161) [![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/161) [![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/161)
hebasto commented 2022-08-17 08:46:14 +00:00 (Migrated from github.com)

cc @GBKS

cc @GBKS
GBKS commented 2022-08-17 09:02:57 +00:00 (Migrated from github.com)

That looks correctly centered now. Is this automatic centering or by setting pixel coordinates (or top padding)? If it's the latter, then it may not be centered anymore if the content on the left changes (like a translation being longer).

That looks correctly centered now. Is this automatic centering or by setting pixel coordinates (or top padding)? If it's the latter, then it may not be centered anymore if the content on the left changes (like a translation being longer).
jarolrod commented 2022-08-17 17:44:29 +00:00 (Migrated from github.com)

@GBKS the centering is automatic, it's handled by the RowLayout. This change constrains the OptionSwitch to only the space needed for it's visual elements instead of having padding all around.

See comparison below where i gave the control a background:

Master PR
optionswitch-master optionsswitch-pr
@GBKS the centering is automatic, it's handled by the RowLayout. This change constrains the OptionSwitch to only the space needed for it's visual elements instead of having padding all around. See comparison below where i gave the control a background: | Master | PR | | --------- | ----- | | ![optionswitch-master](https://user-images.githubusercontent.com/23396902/185207914-4131d650-40a6-49e0-b0a9-60a7cee3bcd9.png) | ![optionsswitch-pr](https://user-images.githubusercontent.com/23396902/185207960-54445f56-938e-4b69-b62d-d998b97f1599.png) |
hebasto commented 2022-08-17 17:49:11 +00:00 (Migrated from github.com)

root.width == indicator.implicitWidth -- is it coincidence? If not, why a constant is duplicated?

`root.width` == `indicator.implicitWidth` -- is it coincidence? If not, why a constant is duplicated?
jarolrod commented 2022-08-17 17:56:02 +00:00 (Migrated from github.com)

updated from 250bb9f to 5af9c73

changes: set indicators implicitWidth/height to parent width/height

updated from 250bb9f to 5af9c73 changes: set indicators implicitWidth/height to parent width/height
shaavan (Migrated from github.com) reviewed 2022-09-06 19:08:58 +00:00
shaavan (Migrated from github.com) left a comment

ACK modulo nit

  • The optionswitch are correctly aligned.

Here's a screenshot I took on Ubuntu 22.04 with Qt version 5.15.3

Screenshot:

Master PR
Screenshot from 2022-09-07 00-36-42 Screenshot from 2022-09-07 00-28-21
ACK modulo nit - The optionswitch are correctly aligned. Here's a screenshot I took on Ubuntu 22.04 with Qt version 5.15.3 **Screenshot:** |Master|PR| |---------|----| |![Screenshot from 2022-09-07 00-36-42](https://user-images.githubusercontent.com/85434418/188718638-8004d7d9-9972-4a50-86c8-abd02c026582.png)|![Screenshot from 2022-09-07 00-28-21](https://user-images.githubusercontent.com/85434418/188718665-ff7b8da7-fda5-475f-8f4c-f8862c1cf502.png)|
shaavan (Migrated from github.com) commented 2022-09-06 19:08:32 +00:00

nit:

    padding: 0
nit: ```suggestion padding: 0 ```
jarolrod commented 2022-09-07 03:00:19 +00:00 (Migrated from github.com)

updated from 5af9c73 to e6f8728 (pr161.01 -> pr161.02, Compare)

Changes: addressed spacing nit

updated from [5af9c73 ](https://github.com/bitcoin-core/gui-qml/commit/5af9c73e46f28b5b71ef43c1ea8d269c18a82ff8)to [e6f8728](https://github.com/bitcoin-core/gui-qml/commit/e6f87282d39ee5a86aa2e1835280097e2843bb7e) ([pr161.01](https://github.com/jarolrod/gui-qml/tree/pr161.01) -> [pr161.02](https://github.com/jarolrod/gui-qml/tree/pr161.02), [Compare](https://github.com/jarolrod/gui-qml/compare/pr161.01..pr161.02)) Changes: addressed spacing nit
jarolrod (Migrated from github.com) reviewed 2022-09-07 03:00:25 +00:00
jarolrod (Migrated from github.com) commented 2022-09-07 03:00:25 +00:00

done

done
hebasto commented 2022-09-15 20:20:23 +00:00 (Migrated from github.com)

https://github.com/bitcoin-core/gui-qml/pull/169#pullrequestreview-1101569629:

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

https://github.com/bitcoin-core/gui-qml/pull/169#pullrequestreview-1101569629: > Confirmed that this fixes the issue, and is a better approach than 161.
Sign in to join this conversation.
No description provided.