VirtualBox

Ignore:
Timestamp:
Feb 14, 2008 12:34:59 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: Shared Folders: Better solution for painting root items on focus gain (no expensive repants and flickers).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h

    r6940 r6942  
    102102                    int aColumn, int aWidth, int aAlign)
    103103    {
    104         /* Make parental cells combined. */
    105104        if (!parent())
    106105        {
    107             /* Do not paint other columns except the first one. */
    108             if (aColumn)
     106            /* Make root items occupy the whole width */
     107            aWidth = listView()->viewport()->width();
     108
     109            if (aColumn > 0)
     110            {
     111                /* For columns other than the first one, paint the overlapping
     112                 * portion of the first column after correcting the window */
     113                aPainter->save();
     114                QRect wnd = aPainter->window();
     115                int dx = -listView()->treeStepSize();
     116                for (int i = 0; i < aColumn; ++ i)
     117                    dx += listView()->columnWidth (i);
     118                wnd.moveBy (dx, 0);
     119                aPainter->setWindow (wnd);
     120                QListViewItem::paintCell (aPainter, aColorGroup, 0, aWidth, aAlign);
     121                aPainter->restore();
    109122                return;
    110             /* Main column's painter width should take all other's. */
    111             aWidth = listView()->viewport()->width();
     123            }
     124
    112125            QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
    113 
    114             if (aPainter->window().width()  != listView()->viewport()->width() ||
    115                 aPainter->window().height() != listView()->viewport()->height())
    116                 repaint();
    117126        }
    118127        else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette