WIP: qml: Add DropShadow to the OptionSwitch indicatorButton #111

Closed
shaavan wants to merge 1 commit from 220113-drop_shadow into main AGit
shaavan commented 2022-01-13 10:58:35 +00:00 (Migrated from github.com)
  • This PR is a follow-up to #101 and addresses the suggestions given there after it was merged.
  • This PR also adds the DropShadow for the OptionSwitch's indicatorButton, as per the main design file of the project.

Some points to note:

- This PR is a follow-up to #101 and addresses the suggestions given there after it was merged. - This PR also adds the **DropShadow** for the **OptionSwitch**'s `indicatorButton`, as per the [main design file](https://www.figma.com/file/GaCoOSNHB2yMB9ThiDtred/Bitcoin-Core-App-Main?node-id=1035%3A1883) of the project. Some points to note: - Used `===` instead of `==` to avoid type coercion. - Chose sample value based on official recommended guidelines (sample = 2*radius + 1) https://doc.qt.io/qt-5/qml-qtgraphicaleffects-dropshadow.html#samples-prop - Used rgba to hex convertor for shadow color: https://rgbacolorpicker.com/rgba-to-hex
shaavan commented 2022-01-13 11:03:06 +00:00 (Migrated from github.com)

Running the current version of the PR will cause the following error.

qrc:/qml/controls/OptionSwitch.qml:7:1: module "QtGraphicalEffects" is not installed

And to create dropShadow, we require this module. I tried to figure out some workaround, but I thought it's better to ask and go with the correct approach on the get-go.

Running the current version of the PR will cause the following error. ``` qrc:/qml/controls/OptionSwitch.qml:7:1: module "QtGraphicalEffects" is not installed ``` And to create _dropShadow_, we require this module. I tried to figure out some workaround, but I thought it's better to ask and go with the correct approach on the get-go.
shaavan commented 2022-01-13 11:08:18 +00:00 (Migrated from github.com)

Updated from e2d1635 to 2e8b096.

Changes:

  • Made appropriate styling changes.

Diff:

diff --git a/src/qml/components/ConnectionSettings.qml b/src/qml/components/ConnectionSettings.qml
index 090e8e793..35f8e5d3a 100644
--- a/src/qml/components/ConnectionSettings.qml
+++ b/src/qml/components/ConnectionSettings.qml
@@ -15,21 +15,21 @@ ColumnLayout {
     }
     Setting {
         Layout.fillWidth: true
-        header:  qsTr("Daily upload limit")
+        header: qsTr("Daily upload limit")
     }
     Setting {
         Layout.fillWidth: true
-        header:  qsTr("Connection limit")
+        header: qsTr("Connection limit")
     }
     Setting {
         Layout.fillWidth: true
-        header:  qsTr("Listening enabled")
-        description:  qsTr("Reduces data usage.")
+        header: qsTr("Listening enabled")
+        description: qsTr("Reduces data usage.")
     }
     Setting {
         last: true
         Layout.fillWidth: true
-        header:  qsTr("Blocks Only")
-        description:  qsTr("Do not transfer unconfirmed transactions. Also disabled listening.")
+        header: qsTr("Blocks Only")
+        description: qsTr("Do not transfer unconfirmed transactions. Also disabled listening.")
     }
 }

Updated from e2d1635 to 2e8b096. Changes: - Made appropriate styling changes. **Diff:** ```diff diff --git a/src/qml/components/ConnectionSettings.qml b/src/qml/components/ConnectionSettings.qml index 090e8e793..35f8e5d3a 100644 --- a/src/qml/components/ConnectionSettings.qml +++ b/src/qml/components/ConnectionSettings.qml @@ -15,21 +15,21 @@ ColumnLayout { } Setting { Layout.fillWidth: true - header: qsTr("Daily upload limit") + header: qsTr("Daily upload limit") } Setting { Layout.fillWidth: true - header: qsTr("Connection limit") + header: qsTr("Connection limit") } Setting { Layout.fillWidth: true - header: qsTr("Listening enabled") - description: qsTr("Reduces data usage.") + header: qsTr("Listening enabled") + description: qsTr("Reduces data usage.") } Setting { last: true Layout.fillWidth: true - header: qsTr("Blocks Only") - description: qsTr("Do not transfer unconfirmed transactions. Also disabled listening.") + header: qsTr("Blocks Only") + description: qsTr("Do not transfer unconfirmed transactions. Also disabled listening.") } } ```
jarolrod (Migrated from github.com) reviewed 2022-01-13 13:42:19 +00:00
jarolrod (Migrated from github.com) commented 2022-01-13 13:37:55 +00:00

Follow ups to #101 should be in their own PR with well structured and focused commits.

Follow ups to #101 should be in their own PR with well structured and focused commits.
jarolrod (Migrated from github.com) commented 2022-01-13 13:38:15 +00:00
```suggestion ```
promag commented 2022-01-13 16:27:01 +00:00 (Migrated from github.com)

Running the current version of the PR will cause the following error.

qrc:/qml/controls/OptionSwitch.qml:7:1: module "QtGraphicalEffects" is not installed

@shaavan try adding

Q_IMPORT_PLUGIN(QtGraphicalEffectsPlugin)
Q_IMPORT_PLUGIN(QtGraphicalEffectsPrivatePlugin)

github.com/bitcoin-core/gui-qml@ef98ffa9e0/src/qml/bitcoin.cpp (L43-L52)

> Running the current version of the PR will cause the following error. > > ``` > qrc:/qml/controls/OptionSwitch.qml:7:1: module "QtGraphicalEffects" is not installed > ``` @shaavan try adding ```cpp Q_IMPORT_PLUGIN(QtGraphicalEffectsPlugin) Q_IMPORT_PLUGIN(QtGraphicalEffectsPrivatePlugin) ``` https://github.com/bitcoin-core/gui-qml/blob/ef98ffa9e0a1054d7c910221b76bd13d1a81ef28/src/qml/bitcoin.cpp#L43-L52
shaavan commented 2022-01-17 06:49:14 +00:00 (Migrated from github.com)

Updated from 2e8b096 to 109682b (pr111.01 -> pr112.02)
Addressed @jarolrod, @promag suggestions.

Changes:

  • Follow-ups related to #101 have been removed from this PR. The stated follow-ups were merged in #112.
  • Used Q_IMPORT_PLUGIN to import relevant modules in src/qml/bitcoin.cpp file.

The PR is still in WIP. Currently, using the Q_IMPORT_PLUGIN caused the following error.

/usr/bin/ld: qt/libbitcoinqt.a(qt_libbitcoinqt_a-bitcoin.o): in function `_GLOBAL__sub_I__Z10QmlGuiMainiPPc':
bitcoin.cpp:(.text.startup+0xc2): undefined reference to `qt_static_plugin_QtGraphicalEffectsPlugin()'
/usr/bin/ld: bitcoin.cpp:(.text.startup+0xd2): undefined reference to `qt_static_plugin_QtGraphicalEffectsPrivatePlugin()'
collect2: error: ld returned 1 exit status
Updated from 2e8b096 to 109682b ([pr111.01](https://github.com/shaavan/gui-qml/tree/pr111.01) -> [pr112.02](https://github.com/shaavan/gui-qml/tree/pr111.02)) Addressed @jarolrod, @promag suggestions. Changes: - Follow-ups related to #101 have been removed from this PR. The stated follow-ups were merged in #112. - Used **Q_IMPORT_PLUGIN** to import relevant modules in `src/qml/bitcoin.cpp` file. The PR is still in WIP. Currently, using the **Q_IMPORT_PLUGIN** caused the following error. ``` /usr/bin/ld: qt/libbitcoinqt.a(qt_libbitcoinqt_a-bitcoin.o): in function `_GLOBAL__sub_I__Z10QmlGuiMainiPPc': bitcoin.cpp:(.text.startup+0xc2): undefined reference to `qt_static_plugin_QtGraphicalEffectsPlugin()' /usr/bin/ld: bitcoin.cpp:(.text.startup+0xd2): undefined reference to `qt_static_plugin_QtGraphicalEffectsPrivatePlugin()' collect2: error: ld returned 1 exit status ```
shaavan (Migrated from github.com) reviewed 2022-01-17 06:49:50 +00:00
shaavan (Migrated from github.com) commented 2022-01-17 06:49:50 +00:00

Addressed in 109682b971

Addressed in 109682b971e08bf282b82b7362c136f68340abee
shaavan (Migrated from github.com) reviewed 2022-01-17 06:50:09 +00:00
shaavan (Migrated from github.com) commented 2022-01-17 06:50:09 +00:00

Addressed in #112

Addressed in #112
jarolrod (Migrated from github.com) reviewed 2022-01-23 07:05:10 +00:00
jarolrod (Migrated from github.com) left a comment

@shaavan as properly supporting this requires OpenGL support, let's leave the dropshadows for later.

@shaavan as properly supporting this requires OpenGL support, let's leave the dropshadows for later.
shaavan commented 2022-01-23 13:34:24 +00:00 (Migrated from github.com)

supporting this requires OpenGL support, let's leave the dropshadows for later.

I understand. I shall close this PR for now. We can restart work on this once OpenGL support is appropriately integrated.

> supporting this requires OpenGL support, let's leave the dropshadows for later. I understand. I shall close this PR for now. We can restart work on this once OpenGL support is appropriately integrated.
shaavan commented 2022-06-20 19:04:40 +00:00 (Migrated from github.com)

This PR is moved to #132.

Rationale:

  • For some reason. Force pushing the PR branch was not updating the PR. Hence decided to move the PR.
This PR is moved to #132. Rationale: - For some reason. Force pushing the PR branch was not updating the PR. Hence decided to move the PR.
Sign in to join this conversation.
No description provided.