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

Implement a global Color Picker #432

Merged
merged 17 commits into from
Sep 3, 2020

Conversation

isneezy
Copy link
Contributor

@isneezy isneezy commented Aug 30, 2020

Summary / How this PR fixes the problem?

Implement a global Color Picker ported from this awesome little tool https://github.com/RonnyDo/ColorPicker

Steps to Test

  1. Draw a and select a shape
  2. Click on the first delete icon from the left to right of the Fills panel
  3. Pick a color

Screenshots

Screen record from 2020-08-31 11 24 03

Known Issues / Things To Do

  • When used on multi-monitor setup the application window should be on the primary monitor otherwise it won't pick colors from other monitors
  • Wayland compatibility, mentioned by @bilelmoussaoui here

This PR fixes/implements the following bugs/features:

@bilelmoussaoui
Copy link
Collaborator

The current implementation won't work under wayland. The proper solution would be using the xdg portals to pick the color and fallback to this in case the dbus interface is not available. See https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-method-org-freedesktop-portal-Screenshot.PickColor

The XDG portals are not Flatpak specific, they are just a bunch of dbus interfaces (as a specification) that have to be implemented by the desktop environment, there are two implementation currently, kde & gtk which should cover most use cases.

@isneezy
Copy link
Contributor Author

isneezy commented Aug 30, 2020

@bilelmoussaoui thanks for your quick feedback. I'll first finish up this implementation and get it working and then I'll move forward into the XDG implementation as you suggested. I'm new to vala and Linux programming so in the meantime, I'll ping you for help.

@bilelmoussaoui
Copy link
Collaborator

Sure, no problem :) thanks for the contribution! let us know if we can help somehow & good luck in your journey.

@isneezy
Copy link
Contributor Author

isneezy commented Aug 30, 2020

@bilelmoussaoui thanks. Do you know the name or how I can get the eyedropper icon? I Can't find any.

@Alecaddd
Copy link
Member

@bilelmoussaoui thanks. Do you know the name or how I can get the eyedropper icon? I Can't find any.

The elementary icon theme doesn't currently have a symbolic color picker.
I will create a dedicated icon for it. For now don't worry about it and you can temporarily use the preferences-color-symbolic.

Thank you so much for your contributions, you're helping us a lot!

Copy link
Member

@Alecaddd Alecaddd left a comment

Choose a reason for hiding this comment

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

Just a few changes on your awesome contribution.

src/Lib/ColorPicker.vala Outdated Show resolved Hide resolved
src/Layouts/Partials/FillItem.vala Show resolved Hide resolved
src/Layouts/Partials/FillItem.vala Outdated Show resolved Hide resolved
@isneezy isneezy marked this pull request as ready for review August 31, 2020 09:49
Copy link
Member

@Alecaddd Alecaddd left a comment

Choose a reason for hiding this comment

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

Here's a bunch of fixes and improvements.

src/Layouts/Partials/BorderItem.vala Outdated Show resolved Hide resolved
src/Layouts/Partials/FillItem.vala Outdated Show resolved Hide resolved
src/Services/ActionManager.vala Outdated Show resolved Hide resolved
src/Utils/ColorPicker.vala Outdated Show resolved Hide resolved
src/Utils/ColorPicker.vala Outdated Show resolved Hide resolved
src/meson.build Outdated Show resolved Hide resolved
@Alecaddd Alecaddd merged commit cba933a into akiraux:master Sep 3, 2020
@Alecaddd Alecaddd mentioned this pull request Sep 3, 2020
46 tasks
@isneezy isneezy deleted the feature/global-color-picker branch September 3, 2020 09:17
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.

None yet

3 participants