Bug 418282 - Palette docker does not refresh correctly after a color is added from color picker
Summary: Palette docker does not refresh correctly after a color is added from color p...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Dockers (show other bugs)
Version: 4.2.8
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Ashwin Dhakaita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-28 10:10 UTC by Anna Medonosova
Modified: 2020-04-02 13:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screen capture of the problem (3.86 MB, video/x-matroska)
2020-02-28 10:10 UTC, Anna Medonosova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Medonosova 2020-02-28 10:10:35 UTC
Created attachment 126473 [details]
Screen capture of the problem

SUMMARY
When the Color Selector Tool is used to add picked colors to a palette, the palette docker does not refresh correctly after a color is picked from a canvas. The swatch appears on next use of the tool or upon redraw of the palette docker. 

STEPS TO REPRODUCE
1. Open a document, draw some colorful blobs on the canvas
2. In the palette docker, create a new palette, 'picker_test'
3. Switch the tool to Color Selector Tool
4. In the Tool Options, check the 'Add to palette' checkbox and set the combo box to 'picker_test'
5. With the Color Selector Tool, pick the blobs from the canvas

OBSERVED RESULT
The swatches in palette docker do not appear when they the color is picked from canvas. They are either appear after the next use of the Color Selector Tool, or after redraw of the docker (different palette selected, or switch to different window and back).

EXPECTED RESULT
The swatch appears in the palette docker right after it is picked from the canvas.

ADDITIONAL INFORMATION
Krita

 Version: 4.2.8
 Languages: en_US
 Hidpi: true

Qt

  Version (compiled): 5.12.5
  Version (loaded): 5.12.5

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.3.0-40-generic
  Pretty Productname: Ubuntu 19.10
  Product Type: ubuntu
  Product Version: 19.10
Comment 1 Ahab Greybeard 2020-02-28 17:33:26 UTC
I can confirm this for the 4.2.8 and Feb 21st 4.3.0 prealpha appimage (git 2b45b5d) appimages.
Comment 2 Dmitry Kazakov 2020-03-19 23:16:32 UTC
Git commit 43c06ea3a54761b965ba860981c3ce7fe24dc640 by Dmitry Kazakov, on behalf of Ashwin Dhakaita.
Committed on 19/03/2020 at 23:15.
Pushed by dkazakov into branch 'master'.

Fix Palette Docker to refresh correctly after a color is added from color picker

The palette docker does not refresh correctly after any color
is added through color picker. Don't know if this is the right
approach to solve the problem but have solved it by setting
PaletteDocker as an observer for PaletteResourceServer and triggering
an update signal whenever the palette in the palette server is
updated using color picker.

M  +35   -0    plugins/dockers/palettedocker/palettedocker_dock.cpp
M  +10   -1    plugins/dockers/palettedocker/palettedocker_dock.h
M  +3    -0    plugins/tools/basictools/kis_tool_colorpicker.cc

https://invent.kde.org/kde/krita/commit/43c06ea3a54761b965ba860981c3ce7fe24dc640
Comment 3 Halla Rempt 2020-04-02 13:34:33 UTC
Git commit 45068abdde47462da30fd334a76e31759d423e52 by Boudewijn Rempt, on behalf of Ashwin Dhakaita.
Committed on 02/04/2020 at 13:30.
Pushed by rempt into branch 'krita/4.3'.

Fix Palette Docker to refresh correctly after a color is added from color picker

The palette docker does not refresh correctly after any color
is added through color picker. Don't know if this is the right
approach to solve the problem but have solved it by setting
PaletteDocker as an observer for PaletteResourceServer and triggering
an update signal whenever the palette in the palette server is
updated using color picker.
(cherry picked from commit 43c06ea3a54761b965ba860981c3ce7fe24dc640)

M  +35   -0    plugins/dockers/palettedocker/palettedocker_dock.cpp
M  +10   -1    plugins/dockers/palettedocker/palettedocker_dock.h
M  +3    -0    plugins/tools/basictools/kis_tool_colorpicker.cc

https://invent.kde.org/kde/krita/commit/45068abdde47462da30fd334a76e31759d423e52