Bug 154054

Summary: oxygen style problems in itemviews
Product: [Unmaintained] kdelibs Reporter: Dag Andersen <dag.andersen>
Component: kstyleAssignee: Camilla Boemann <cbo>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: kplato.png

Description Dag Andersen 2007-12-14 20:44:39 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
 
OS:                Linux

I have two issues with the oxygen style:
* The indication of current item cannot be seen. There should be a frame, qt uses a light grey, dotted rectangle which is hard enough to see, it doesn't contrast well with neither white nor the greyish blue used for selected items. With oxygen though it's totally impossible to see any frame at all.

* The text is partially obscured when editing an item with a combo box. There is a frame  (green/orange) that hides parts of the text. In a QTreeView the height of an item is only just enough to hold the text so there is no room 
for extra stuff.
Comment 1 Camilla Boemann 2007-12-26 01:17:10 UTC
Accepting the first part

The second part is prabably a Qt bug though, or you may be squeezing the widget yourself.
Comment 2 Dag Andersen 2007-12-28 10:15:02 UTC
No, the second part is about using the widget inside a QTreeView (editing an item), so the size of the widget will be the size of the item. The height of the items are dependent on the height of the displayed text, and there isn't much spare room, so adding any type of frame more than one or possibly two pixels is going to cause problems.
Comment 3 Camilla Boemann 2007-12-28 19:23:15 UTC
That would make it a qt bug imo, but could you tell me where i can see this bug.

Preferably along with pointers to the the code.
Comment 4 Camilla Boemann 2007-12-29 01:41:19 UTC
SVN commit 754073 by boemann:

Fix focus in itemviews that have multiple selection.
BUG:154054


 M  +7 -0      oxygen.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=754073
Comment 5 Dag Andersen 2007-12-29 10:36:22 UTC
Fredag 28 december 2007 19:23 skrev Casper Boemann:
[bugs.kde.org quoted mail]
I doubt *very* much the trolls will think it is a qt bug, but that just my 
opinion :)
You can see it in koffice/kplato (which I'm working on). I took a snapshot so 
you can see what it looks like.
>
> Preferably along with pointers to the the code.

The code that sets this up is in qitemdelegate.cpp:

void QItemDelegate::updateEditorGeometry(QWidget *editor,
                                         const QStyleOptionViewItem &option,
                                         const QModelIndex &index) const
{
    if (!editor)
        return;
    Q_ASSERT(index.isValid());
    QPixmap pixmap = decoration(option, index.data(Qt::DecorationRole));
    QString text = 
QItemDelegatePrivate::replaceNewLine(index.data(Qt::DisplayRole).toString());
    QRect pixmapRect = QRect(QPoint(0, 0), 
option.decorationSize).intersected(pixmap.rect());
    QRect textRect = textRectangle(0, option.rect, option.font, text);
    QRect checkRect = check(option, textRect, index.data(Qt::CheckStateRole));
    QStyleOptionViewItem opt = option;
    opt.showDecorationSelected = true; // let the editor take up all available 
space
    doLayout(opt, &checkRect, &pixmapRect, &textRect, false);
    editor->setGeometry(textRect);
}


Created an attachment (id=22748)
kplato.png
Comment 6 Dag Andersen 2007-12-29 10:57:40 UTC
Just to clearify, it's not limited to oxygen/comboboxes.
It's the same with spinbox variants (doublespinbox, date/time edit...),
and the plastik style, which also draws a frame (a dotted line).
This isn't as obstructive as the oxygen style but still doesn't look good.
Comment 7 Dag Andersen 2007-12-29 11:22:13 UTC
Lørdag 29 december 2007 01:41 skrev Casper Boemann:
[bugs.kde.org quoted mail]
This seems to draw a blue(ish) background which is almost the same as the 
color used for selected items and it is not possible to see which item has 
focus if it is also selected. (You may have a whole row selected while only 
one item has focus)
I think using a background color to identify focused item is (maybe) a good 
idea, it must contrast with selected item and it must have precedence over 
selected item as some operations targets focused item only.
>
>
>  M  +7 -0      oxygen.cpp
>
>
> WebSVN link: http://websvn.kde.org/?view=rev&revision=754073

Comment 8 Camilla Boemann 2007-12-29 17:10:47 UTC
SVN commit 754339 by boemann:

Do the focus rect in itemviews in a different way
Also make them show on top of selected items

CCBUG: 154054


 M  +12 -4     oxygen.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=754339