VirtualBox

Changeset 6865 in vbox


Ignore:
Timestamp:
Feb 8, 2008 1:13:33 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28004
Message:

Splitting parental list items into one column for Shared Folder list.

Location:
trunk/src/VBox/Frontends/VirtualBox/ui
Files:
2 edited

Legend:

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

    r6811 r6865  
    232232    <include location="global" impldecl="in implementation">qregexp.h</include>
    233233    <include location="global" impldecl="in implementation">qtimer.h</include>
     234    <include location="global" impldecl="in implementation">qpainter.h</include>
    234235</includes>
    235236<variables>
     
    249250    <slot>processDoubleClick( QListViewItem* )</slot>
    250251    <slot>adjustList()</slot>
     252    <slot>updateList()</slot>
    251253</slots>
    252254<functions>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSharedFoldersSettings.ui.h

    r6847 r6865  
    102102                    int aColumn, int aWidth, int aAlign)
    103103    {
    104         processColumn (aColumn, aWidth);
    105         QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
     104                /* Make parental cells splitted. */
     105        if (!parent())
     106        {
     107            /* Other columns except main should be semi-transparent. */
     108            if (aColumn)
     109                aPainter->setRasterOp (Qt::AndROP);
     110            /* Main column's painter width should take all other's. */
     111            else
     112                aWidth = listView()->viewport()->width();
     113            QListViewItem::paintCell (aPainter, aColorGroup, aColumn,
     114                                      aWidth, aAlign);
     115        }
     116        else
     117        {
     118            processColumn (aColumn, aWidth);
     119            QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
     120        }
    106121    }
    107122
     
    373388             this, SLOT (processCurrentChanged (QListViewItem *)));
    374389
     390        /* Make after-paining list update to ensure all columns repainted correctly. */
     391    connect (listView->header(), SIGNAL (sizeChange (int, int, int)),
     392             this, SLOT (updateList()));
     393
    375394    mIsListViewChanged = false;
    376395
     
    389408}
    390409
     410
     411void VBoxSharedFoldersSettings::updateList()
     412{
     413    /* Updating list after all pending cell-repaint enevts. */
     414    QTimer::singleShot (0, listView, SLOT (updateContents()));
     415}
    391416
    392417void VBoxSharedFoldersSettings::adjustList()
     
    405430
    406431    /* We are adjusting columns 0 and 2 and resizing column 1 to feat
    407      * visible listView' width according two adjusted columns. Due to 
     432     * visible listView' width according two adjusted columns. Due to
    408433     * adjusting column 2 influent column 0 restoring all widths. */
    409434    listView->setColumnWidth (0, w0);
     
    411436    listView->setColumnWidth (2, w2);
    412437}
    413    
     438
    414439bool VBoxSharedFoldersSettings::eventFilter (QObject *aObject, QEvent *aEvent)
    415440{
Note: See TracChangeset for help on using the changeset viewer.

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