| Summary: | Unable to Ctrl+Scrollwheel zoom swatches in palette docker when docker width is < 220px | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Neviril <nevineviril> |
| Component: | Dockers | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | halla |
| Priority: | NOR | ||
| Version First Reported In: | 3.3.1 | ||
| Target Milestone: | --- | ||
| Platform: | Microsoft Windows | ||
| OS: | Microsoft Windows | ||
| Latest Commit: | https://commits.kde.org/krita/2f13d9350762efda0f328b2fc0ed9764f01c10a4 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: | Palette Docker scrolling patch | ||
|
Description
Neviril
2017-10-20 07:14:09 UTC
Um, that's actually intentional, I think, looking at the code:
int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 7;
int curSize = horizontalHeader()->sectionSize(0);
int setSize = numSteps + curSize;
if ( setSize >= 12 ) {
horizontalHeader()->setDefaultSectionSize(setSize);
verticalHeader()->setDefaultSectionSize(setSize);
KisConfig cfg;
cfg.setPaletteDockerPaletteViewSectionSize(setSize);
}
Quick and dirty workaround.
In /libs/ui/kis_palette_view.cpp
In KisPaletteView::wheelEvent
There is this check:
...
if ( setSize >= 12 ) {
...
Reducing the value setSize is checked against to a lower value (e.g. 1, although this is probably too small) appears to resolve this bug.
The main issue here is that all scroll wheel events are blocked, but it would be useful if scrolling up (e.g. increasing swatch size) was still allowed.
This modification makes it working as intended and solves an inconsistency in the UI (decreasing docker width to the minimum size sets swatch size to 8px, but this swatch size cannot be normally set while scroll-zooming):
if ( (event->delta() <= 0) && (setSize <= 8) ) {
// Ignore scroll-zooming down below a certain size
} else {
horizontalHeader()->setDefaultSectionSize(setSize);
verticalHeader()->setDefaultSectionSize(setSize);
KisConfig cfg;
cfg.setPaletteDockerPaletteViewSectionSize(setSize);
}
If you can give me a patch I can apply, I will push it :-) Created attachment 108469 [details]
Palette Docker scrolling patch
This patch solves an inconsistency in the UI where the user is unable to scrollwheel-zoom-in color swatches in the palette docker after the same has been reduced to its minimum width, which causes color swatch size to be set to 8px, a size that cannot be normally set with the ctrl+scrollwheel shortcut. This color swatch size is now made accessible with the scroll wheel, and scroll events are now blocked only when trying to further zoom out.
Git commit 98cdd4fdbe7ee991311a6f06546826d5b48cc63c by Boudewijn Rempt. Committed on 20/10/2017 at 09:00. Pushed by rempt into branch 'krita/3.3'. Fix using the wheel when the palettte docker is very small This patch solves an inconsistency in the UI where the user is unable to scrollwheel-zoom-in color swatches in the palette docker after the same has been reduced to its minimum width, which causes color swatch size to be set to 8px, a size that cannot be normally set with the ctrl+scrollwheel shortcut. This color swatch size is now made accessible with the scroll wheel, and scroll events are now blocked only when trying to further zoom out. Patch by Neviril <nevineviril@yahoo.com> Thanks! M +8 -6 libs/ui/kis_palette_view.cpp https://commits.kde.org/krita/98cdd4fdbe7ee991311a6f06546826d5b48cc63c Git commit 2f13d9350762efda0f328b2fc0ed9764f01c10a4 by Boudewijn Rempt. Committed on 20/10/2017 at 09:00. Pushed by rempt into branch 'master'. Fix using the wheel when the palettte docker is very small This patch solves an inconsistency in the UI where the user is unable to scrollwheel-zoom-in color swatches in the palette docker after the same has been reduced to its minimum width, which causes color swatch size to be set to 8px, a size that cannot be normally set with the ctrl+scrollwheel shortcut. This color swatch size is now made accessible with the scroll wheel, and scroll events are now blocked only when trying to further zoom out. Patch by Neviril <nevineviril@yahoo.com> Thanks! M +8 -6 libs/ui/kis_palette_view.cpp https://commits.kde.org/krita/2f13d9350762efda0f328b2fc0ed9764f01c10a4 |