Bug 441154 - Foreground/background colors on popup palette don't visually update when clicking them, with wide gamut selector
Summary: Foreground/background colors on popup palette don't visually update when clic...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 5.0.0-beta1
Platform: Appimage Linux
: NOR minor
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-19 04:54 UTC by tomtomtomreportingin
Modified: 2022-06-03 13:24 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2021-08-19 04:54:24 UTC
In 5.0.0-beta1 (can't currently specify this version in the tracker):

SUMMARY
Left-clicking or right-clicking the foreground/background color buttons on the top left of the pop-up palette does not visually update the buttons, until hovering off the buttons.

STEPS TO REPRODUCE
1. Select red as a foreground color and white as a background color.
2. Open pop-up palette.
3. Right-click the foreground/background color buttons on the top-left.

OBSERVED RESULT
The buttons continue to show red and white until the cursor hovers off.

EXPECTED RESULT
The button colors should update as soon as they're clicked.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.12.11 (Appimage)
Comment 1 Tiar 2021-08-22 22:23:14 UTC
Weird, it does do it immediately for me...
System info:
Krita

 Version: 5.0.0-beta1
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.11
  Version (loaded): 5.12.11

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.3.7-050307-generic
  Pretty Productname: Linux Mint 19.3
  Product Type: linuxmint
  Product Version: 19.3
  Desktop: X-Cinnamon
Comment 2 tomtomtomreportingin 2021-08-22 23:58:43 UTC
Apparently, it only happens when using the new Wide Gamut Selector in the pop-up palette instead of the sRGB Triangle Selector.
Comment 3 wolthera 2021-09-21 15:48:09 UTC
Can confirm.

------------------------
diff --git a/libs/ui/kis_popup_palette.cpp b/libs/ui/kis_popup_palette.cpp
index 63a46a8281..fee4c44eed 100644
--- a/libs/ui/kis_popup_palette.cpp
+++ b/libs/ui/kis_popup_palette.cpp
@@ -381,6 +381,7 @@ void KisPopupPalette::slotDisplayConfigurationChanged()
 void KisPopupPalette::slotExternalFgColorChanged(const KoColor &color)
 {
     m_colorSelector->slotSetColor(color);
+    repaint();
 }
 
 void KisPopupPalette::slotEmitColorChanged()

-------------------------

This fixes the problem, however, it is somewhat of a sledgehammer approach? I suspect the main problem is that the wide gamut color selector doesn't sent out updates when receiving them from external sources to avoid endless updates...
Comment 4 Lynx3d 2021-09-22 09:29:52 UTC
Yeah I would just move the update() from slotEmitColorChanged() to slotExternalFgColorChanged(), and also connect background color updates to update(), because the popup palette is not truly modal, and also a reset may only actually change the background color.
So relying on the selector re-emitting the change seems not the best choice here.

In any case, avoid repaint(), that forces an immediate async repaint on every call while update() schedules it for the next round of synchronized widget repaints, which is more efficient.

Btw. commit b117b85f378f09027385f209a9333a43d3538dcc killed the right-click reset functionality, but I'm not sure we should use right-click or that anyway, because people need to be careful where to close the popup palette, especially when using the canvas rotation feature of it.
Comment 5 Lynx3d 2022-06-03 13:24:44 UTC
Git commit d335b6f7a50dec28f658a2edb26ff60029adfed6 by Mathias Wein.
Committed on 03/06/2022 at 13:15.
Pushed by mwein into branch 'master'.

Update popup palette color labels on external FG/BG color changes

KisVisualColorSelector doesn't emit change signals when setting color,
and external background color changes were not handled at all.

This also fixes updates when swapping foreground/background colors
by clicking the labels.

M  +4    -0    libs/ui/kis_popup_palette.cpp

https://invent.kde.org/graphics/krita/commit/d335b6f7a50dec28f658a2edb26ff60029adfed6