Hash: e53f968 (currrent master), bug filed at the request of amyspark on IRC SUMMARY While working on the HSV color selector (https://invent.kde.org/graphics/krita/-/merge_requests/1434) I've noticed that `Kis{Integer,Double}ParseSpinBox` `sizeHint().height()` returns different sizes. STEPS TO REPRODUCE 1. Pull the code from https://invent.kde.org/graphics/krita/-/merge_requests/1434 2. On this line: https://invent.kde.org/graphics/krita/-/merge_requests/1434/diffs#c802f9b62a00b267298f79be7ad4b5dc821ee2bd_438_480 3. Add a `qDebug() << input->sizeHint().height()` 4. On this line: https://invent.kde.org/graphics/krita/-/merge_requests/1434/diffs#c802f9b62a00b267298f79be7ad4b5dc821ee2bd_56_57 5. Add a `qDebug() << m_input->sizeHint().height` here 6. Open the Specific Color Selector 7. The first qDebug() outputs 26 8. The second qDebug outputs 25 OBSERVED RESULT 26 EXPECTED RESULT 25 SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux
The links from the MR doesn't seem to work, here's them again: The line references are: 1. https://invent.kde.org/graphics/krita/-/blob/c3b812170829a38ab2df92a26ca0974bc9d336a8/libs/widgets/kis_color_input.cpp#L57 2. https://invent.kde.org/graphics/krita/-/blob/c3b812170829a38ab2df92a26ca0974bc9d336a8/libs/widgets/kis_color_input.cpp#L480 Place `qDebug() << m_input->sizeHint().height();` and `qDebug() << input->sizeHint().height();` in those positions respectively.
I remade the slider spin boxes but I didn't touch those color sliders. Do everything points to that weird +1, maybe a leftover of the old widgets. I cannot check right now, but if you can, try removing that and see if it is solved, and tell me.
Gu(In reply to Deif Lou from comment #2) > I remade the slider spin boxes but I didn't touch those color sliders. Do > everything points to that weird +1, maybe a leftover of the old widgets. I > cannot check right now, but if you can, try removing that and see if it is > solved, and tell me. I've removed the sliders and it does not help. I've created an easy reproduction here (patch onto master): https://invent.kde.org/lllf/krita/-/commit/7279a8c797d3dffaf348e4e37006858f5d1ca4a6 Creating the component in the constructor results in 26, creating the component in the update() methods results in 25
The issue is not in Krita's slider spinbox widgets. It can be reproduced using QDoubleSpinBox as well. And I don't think it is an issue with sizeHint. If one uses: > qDebug() << input->fontMetrics().height(); instead of: > qDebug() << input->sizeHint().height() it can be seen that the real problem is in the font size. I don't know yet how the font size is changing, but it seems that there is not a problem specific to this docker.
The issue is that the font of the dockers is set to one with smaller size with: > dockWidget->setFont(KisUiFont::dockFont()); and docFont is: > QFont dockFont() > { > QFont font = normalFont(); > font.setPointSizeF(font.pointSizeF() * 0.9); > return font; > } Since the font size is taken into account in the QDoubleSpinBox::sizeHint, this also influences the spinbox size. It seems to be an intentional thing, so I'm nor sure this is a bug.