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

Extend settings component #143

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

jarolrod
Copy link
Member

@jarolrod jarolrod commented Aug 3, 2022

#124 Introduced information.qml which is a mutation of Setting.qml but introduces an additional two loaders and respective properties to handle the scenarios where a setting doesn't use an option switch and needs to instead display a link, display an image, or take input.

The issue, despite large amounts of duplicate code is that, following this design pattern, we will be introducing a new mutation of Settings.qml everytime we have a scenario when there should be something aside from an option switch.

Instead of endless mutations, Settings.qml can just be made extensible by simply introducing a loader which gives it an actionItem. an actionItem is the interact-able element of this setting; that could be an option switch, a url, a text input box, or something completely new.

An example of something new, see the current simplification of the AboutOptions.qml developer settings button:

-    RowLayout {
-        Header {
-            Layout.fillWidth: true
-            center: false
-            header: qsTr("Developer options")
-            headerSize: 18
-            description: qsTr("Only use these if you have development experience")
-            descriptionSize: 15
-            descriptionMargin: 10
-            wrap: false
-            }
-        Loader {
-            Layout.fillWidth: true
-            Layout.preferredWidth: 0
-            Layout.alignment: Qt.AlignRight
-            Layout.rightMargin: 5
-            active: true
-            visible: active
-            sourceComponent: TextButton {
-                text: ">"
-                bold: false
-                rightalign: true
-                onClicked: {
-                    introductions.incrementCurrentIndex()
-                    swipeView.inSubPage = true
-                }
+    Setting {
+        Layout.fillWidth: true
+        header: qsTr("Developer options")
+        description: qsTr("Only use these if you have development experience")
+        actionItem: TextButton {
+            text: ">"
+            bold: false
+            rightalign: true
+            onClicked: {
+                introductions.incrementCurrentIndex()
+                swipeView.inSubPage = true
             }

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strong Concept ACK

  • I agree with this change for all the reasons explained in the description. Especially because this helps remove redundant code while making the Settings.qml scalable.
  • The code changes are complete and exhaustive and completely map the functionality with the master.
  • While testing this PR on my laptop (Ubuntu 22.04, Qt version 5.15.3), I observed some key differences from the master.

Testing differences:

  1. Hovering over links no more shows the edit cursor.

Screenshot:

Master PR
Screenshot from 2022-08-03 18-43-03 Screenshot from 2022-08-03 18-42-39
  1. The optionswitch is misaligned from the divider line.

Screenshot:

Master PR
Screenshot from 2022-08-03 18-46-34 Screenshot from 2022-08-03 18-46-07

There is a few more change that needs to be fixed in master as well, which I would suggest adding to this PR. However, these can be taken up in separate PR as well.

  1. The button for the Developers option on the About Options page is not right-aligned properly. (Fixed by PR#144)

Screenshot:
Screenshot from 2022-08-03 18-42-39

Edit: #144 fixes the misaligned Developers option arrow.

@jarolrod jarolrod force-pushed the extend-settings-component branch from ac4dbd2 to 0935349 Compare August 4, 2022 02:47
@jarolrod
Copy link
Member Author

jarolrod commented Aug 4, 2022

updated from ac4dbd2 to 0935349 (PR143.01 -> PR143.02, diff)

changes:

  • rebase over changes on Introduce ExternalLink control #141
  • update one temporary setting with no importance from an ExternalLink to ValueInput to prevent a warning in the terminal when running the gui

@jarolrod jarolrod force-pushed the extend-settings-component branch from 0935349 to 3b53ae6 Compare August 5, 2022 23:28
@jarolrod
Copy link
Member Author

jarolrod commented Aug 5, 2022

updated from 0935349 to 3b53ae6 (pr143.02 -> pr143.03, diff)

changes: rebased over changes in #141

@jarolrod jarolrod force-pushed the extend-settings-component branch from 3b53ae6 to 69d0778 Compare August 6, 2022 23:20
@jarolrod
Copy link
Member Author

jarolrod commented Aug 6, 2022

updated from 3b53ae6 to 69d0778 (pr143.03 -> pr143.04, diff)

changes: rebased over changes in #141

This was referenced Aug 10, 2022
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 69d0778, tested on Ubuntu 22.04.

hebasto added a commit that referenced this pull request Aug 11, 2022
@hebasto
Copy link
Member

hebasto commented Aug 11, 2022

@jarolrod

changes: rebased over changes in #141

One more rebase?

@jarolrod jarolrod force-pushed the extend-settings-component branch from 69d0778 to d4db4d1 Compare August 11, 2022 20:23
@jarolrod
Copy link
Member Author

updated from 69d0778 to d4db4d1 (pr143r.04 -> pr143.05, diff)

Changes: rebased over changes on master

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK d4db4d1

This extends the usability of the settings component so that it is able 
to load any action item. This means that this component can be used for
all settings regardless of what action is meant to be on the right side.
This prevents the need for endless mutations on the settings component
to accomodate for different use-cases; the information component being
one such mutation.
This is no longer needed.
@jarolrod jarolrod force-pushed the extend-settings-component branch from d4db4d1 to ee82e9c Compare August 11, 2022 21:01
@jarolrod
Copy link
Member Author

updated from d4db4d1 to ee82e9c Compare

changes: rebase over changes on master

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK ee82e9c

Edited PR links in the PR description.

@hebasto hebasto merged commit c2ea2a6 into bitcoin-core:main Aug 11, 2022
@jarolrod jarolrod deleted the extend-settings-component branch August 21, 2022 19:44
header: qsTr("Version")
actionItem: ExternalLink {
description: qsTr("v22.99.0-1e7564eca8a6 >")
link: "https://bitcoin.org/en/download"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this link or update it to https://bitcoincore.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants