Bug 151711 - Color Picker: ColorSliderControl slider does not change colour pallet with picks on the ColorSliderControl, it becomes functional only with a pick from the ColorFieldControl or change in color mode
Summary: Color Picker: ColorSliderControl slider does not change colour pallet with pi...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.3
Keywords:
: 149600 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-23 10:38 UTC by Q
Modified: 2022-10-26 02:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Custom Colour.... (69.99 KB, image/png)
2022-10-23 10:40 UTC, Q
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Q 2022-10-23 10:38:58 UTC
Description:
Tested in Writer and Calc:

If you want to change the font colour, Character Highlighting Colour or cell background colour to a Custom Colour the colour picker does not change the "big" colour field (how do you call it? colour pallet? Pick a Colour area?) if you change it on the thin bar at the right side. But if you click in this area, it will pick the expected colour. E.g. you click at the shin bar in the blue area, the colour picker shows still red, but if you click in the red area in the bigger rectangle, you will see a blue colour as selected (in the field between the rectangle and "Help").

If you click outside the windows, at the colour bar the selection jumps to the end.


The only time it doesn't work is the FIRST time you use it for the object you want change. After that it does what is expected.  

Try to attach a screenshot.

Steps to Reproduce:
1. mark a word/cell
2. click e.g. at the font colour symbol at the bar
3. click on "Custom Colour..."
4. click first at a different colour at the thin colour bar in the middle (e.g. blue)
5. click for example in the deep red area in the colour picker area


Actual Results:
The colour picker area does not change the colour.

Expected Results:
The colour picker area change the colour as choosen in the bar.


Reproducible: Always


User Profile Reset: No

Additional Info:
The only time it doesn't work is the FIRST time you use it for the object you want change. After that it does what is expected.
Comment 1 Q 2022-10-23 10:40:39 UTC
Created attachment 183216 [details]
Custom Colour....

Unexpected situation
Comment 2 m_a_riosv 2022-10-23 12:24:17 UTC
OK, seems the big color area (BCA) it's not updated at first time when selecting in the vertical color sliding (VCS).
But doing a selection on VCS, clicking in the BCA and returning to select in the VCS then it updates properly.

Some update on BCA versus VCS and vice versa, is not always done.
Comment 3 V Stuart Foote 2022-10-23 17:47:57 UTC
Terms in source colorpickerdialog.ui 

ColorFieldControl -> your BCA
ColorSliderControl -> your VCS
ColorPreviewControl -> "shin bar" of OP's note
   preview  -> left half of the bar
   previous  -> right half of the bar

I think this is a corollary to bug 85590 where it was the 'Pick a color' circle on the ColorFieldControl that was misplaced on opening. Here it is the 'Color pointer' on the ColorSliderControl, and only when initially opened as noted.

Guess the color slider needs some kind of UpdatePosition() similar to what the 'Pick a color' circle got with https://cgit.freedesktop.org/libreoffice/core/commit/?id=7716d86f46dea72bd0e99f7074f718d558e88f49

Looks like it has been doing this since the Custom Color picker was reimplemented at 4.4

Easyhack?
Comment 4 V Stuart Foote 2022-10-23 18:26:48 UTC
So you can actually click the ColorSliderControl multiple times, relocating the slider, but the pallet hue displayed on the ColorFieldControl is not changed to match.  

Activating it requires a color selection click in the ColorFieldControl, or a change of mode in one of the radio buttons or value fields for the RGB, HSB or CMYK color palette modes (opens default with the 'Hue' radiobutton set, then only changes when a different control is selected).
Comment 5 Caolán McNamara 2022-10-23 19:55:58 UTC
This isn't my first run in with this dialog and I left baffled the last time, but I think I see the core problem this time around.
Comment 6 Caolán McNamara 2022-10-23 20:05:39 UTC
https://gerrit.libreoffice.org/c/core/+/141687
Comment 7 Commit Notification 2022-10-24 07:52:04 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/83334df9cfc34a2f740fe30db0f3359105cede83

Resolves: tdf#151711 don't use an intermediate Color to pass data around

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Caolán McNamara 2022-10-24 07:52:45 UTC
done in trunk, backport to 7-4 in gerrit
Comment 9 Caolán McNamara 2022-10-24 07:53:35 UTC
*** Bug 149600 has been marked as a duplicate of this bug. ***
Comment 10 Commit Notification 2022-10-25 08:57:37 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/1883d625b92e6c417bfb892364023063deb0fa7c

Resolves: tdf#151711 don't use an intermediate Color to pass data around

It will be available in 7.4.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 V Stuart Foote 2022-10-26 02:20:12 UTC
Verified.  The ColorSliderControl responds stays in sync with the ColorFieldControl which responds on selection, and all three color "modes" update as color picks are made.  Seems to function correctly now.

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 20ebccd6b349a1d9d3e057de55933c2805ff5d1a
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded