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

Common widget GzColor (Citadel) #410

Merged
merged 13 commits into from
Jun 28, 2022
Merged

Common widget GzColor (Citadel) #410

merged 13 commits into from
Jun 28, 2022

Conversation

AzulRadio
Copy link
Contributor

@AzulRadio AzulRadio commented Jun 2, 2022

New feature

Summary

Pack RGB color GUI into a common widget GzColorRGB.qml

Replace the color GUI in Grid3d with the common widget

Test it

(New)
demo_grid3d_new

(Deprecated)
demo_gzcolor_grid3d

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Jun 2, 2022
@codecov
Copy link

codecov bot commented Jun 2, 2022

Codecov Report

Merging #410 (96f0078) into ign-gui3 (9b27bec) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           ign-gui3     #410   +/-   ##
=========================================
  Coverage     66.10%   66.10%           
=========================================
  Files            29       29           
  Lines          3216     3216           
=========================================
  Hits           2126     2126           
  Misses         1090     1090           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b27bec...96f0078. Read the comment docs.

@chapulina chapulina added the OOBE 📦✨ Out-of-box experience label Jun 3, 2022
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Looking good! Just a few comments

include/ignition/gui/resources.qrc Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColorRGB.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColorRGB.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColorRGB.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColorRGB.qml Outdated Show resolved Hide resolved
Signed-off-by: youhy <[email protected]>
@AzulRadio AzulRadio marked this pull request as ready for review June 3, 2022 20:30
@AzulRadio AzulRadio requested a review from jennuine as a code owner June 3, 2022 20:30
@AzulRadio AzulRadio changed the title Add common widget for color Common widget GzColor (Citadel) Jun 3, 2022


GridLayout {
id: root
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's name this to something else like gzColorRoot for safety

Copy link
Contributor Author

@AzulRadio AzulRadio Jun 13, 2022

Choose a reason for hiding this comment

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

Fix in 8835c72

property alias b: b_spin.value
property alias a: a_spin.value

property bool textVisible: false
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: textVisible isn't very descriptive. Can we rename this to showColorText?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove textVisible in 8835c72

Copy link
Contributor

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

Looks good so far! A couple of things,

Anytime the color dialog is open, this warning appears in the terminal:

Gtk-Message: 11:24:17.963: GtkDialog mapped without a transient parent. This is discouraged.

This happened before anytime the native dialog is used (but doesn't happen with Fortress' material color dialog). It would be nice to resolve it so it doesn't spam the console if a user changes colors often.

Also, when I select a custom color, the color appears twice next to the custom color section:
Peek 2022-06-16 11-22

include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
src/plugins/grid_3d/Grid3D.qml Outdated Show resolved Hide resolved
src/plugins/grid_3d/Grid3D.qml Outdated Show resolved Hide resolved
@AzulRadio
Copy link
Contributor Author

AzulRadio commented Jun 17, 2022

@jennuine

Anytime the color dialog is open, this warning appears in the terminal:

Gtk-Message: 11:24:17.963: GtkDialog mapped without a transient parent. This is discouraged.

I don't have this warning on Ogre but I think I might know how to fix this. An attempt to fix is included in 86d1b1a.

Also, when I select a custom color, the color appears twice next to the custom color section

This seems to be a bug of Qt. Even if I use the example code from their official page, this bug still persists. https://doc.qt.io/qt-5/qml-qtquick-dialogs-colordialog.html

All the other changes have also been included to commit 86d1b1a

Copy link
Contributor

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

Thanks for iterating. A few more minor comments.

I don't have this warning on Ogre but I think I might know how to fix this. An attempt to fix is included in 86d1b1a.

I didn't see the attempt to fix the warning. Was it included in that commit? The warning still appears.

Also, when I select a custom color, the color appears twice next to the custom color section

This seems to be a bug of Qt. Even if I use the example code from their official page, this bug still persists. https://doc.qt.io/qt-5/qml-qtquick-dialogs-colordialog.html

I see, it does the same w/o this PR too. Strange, this wasn't an issue before. Anyways, thanks for looking into this

include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
include/ignition/gui/qml/GzColor.qml Outdated Show resolved Hide resolved
Copy link
Contributor

@jennuine jennuine left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!


Anytime the color dialog is open, this warning appears in the terminal:

Gtk-Message: 11:24:17.963: GtkDialog mapped without a transient parent. This is discouraged.

This message is coming from the OS's native dialog, not from this PR. The fix would be to use Qt's color dialog but there is no way to easily use that through QML currently.

@AzulRadio AzulRadio dismissed chapulina’s stale review June 28, 2022 19:00

All the requested changes have been made.

@AzulRadio AzulRadio merged commit f29fe15 into ign-gui3 Jun 28, 2022
@AzulRadio AzulRadio deleted the azulradio/common_widget branch June 28, 2022 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel OOBE 📦✨ Out-of-box experience
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants