Summary: | Malplaced focus rectangle for checkboxes with no text | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kdelibs | Reporter: | Morten Hustveit <morten> |
Component: | kstyle | Assignee: | Karol Szwed <gallium> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Morten Hustveit
2002-11-11 23:08:22 UTC
Qt3.1.1 mostly fixed it, but now the focus rectangle is cutting accross the checkbox bevel with Keramik. Investigating. I've fixed it up in all of the styles; but didn't backport some of it yet; when I do that, I'll close this. Thanks a lot for your help with this. Subject: KDE_3_1_BRANCH: kdelibs/kstyles/keramik CVS commit by orlovich: Backport the adjustments to positioning of the focus indicator for labelless checkbox. CCMAIL: 50584-done@bugs.kde.org M +23 -1 keramik.cpp 1.88.2.2 --- kdelibs/kstyles/keramik/keramik.cpp #1.88.2.1:1.88.2.2 @@ -34,4 +34,5 @@ #include <qbitmap.h> +#include <qcheckbox.h> #include <qcombobox.h> #include <qdrawutil.h> @@ -208,4 +209,25 @@ QRect KeramikStyle::subRect(SubRect r, c { return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField ); + } + + case SR_CheckBoxFocusRect: + { + const QCheckBox* cb = static_cast<const QCheckBox*>(widget); + + //Only checkbox, no label + if (cb->text().isEmpty() && (cb->pixmap() == 0) ) + { + QRect bounding = cb->rect(); + QSize checkDim = Keramik::PixmapLoader::the().size( keramik_checkbox_on); + int cw = checkDim.width();; + int ch = checkDim.height(); + + QRect checkbox(bounding.x() + 1, bounding.y() + 1 + (bounding.height() - ch)/2, + cw - 3, ch - 4); + + return checkbox; + } + + //Fallthrough intentional } |