Changeset 765


Ignore:
Timestamp:
Jul 29, 2010, 3:51:24 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Fixed QFileDialog: Don't increase the item height in the side bar by increasing icon size as this causes ugly icon scaling; use the item size hint instead and make this increase dynamic (depending on the normal item height) [vendor bug].

Location:
trunk/src/gui/dialogs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/dialogs/qsidebar.cpp

    r651 r765  
    6666            option->state &= ~QStyle::State_Enabled;
    6767    }
     68}
     69
     70QSize QSideBarDelegate::sizeHint (const QStyleOptionViewItem &option,
     71                                  const QModelIndex &index) const
     72{
     73    // Make the item height in the side bar little bit bigger than in the
     74    // file list view (to emphasize it). Note that this is better than
     75    // previously used enforcing the icon size on the list with setIconSize()
     76    // because it doesn't cause icon scaling (whigh results in blurred images)
     77    QSize size = QStyledItemDelegate::sizeHint(option, index);
     78    int height = size.height();
     79    size.setHeight(height + height / 4);
     80    return size;
    6881}
    6982
     
    375388{
    376389    // ### TODO make icon size dynamic
    377     setIconSize(QSize(24,24));
     390    //setIconSize(QSize(24,24));
     391    //setSpacing(4);
    378392    setUniformItemSizes(true);
    379393    urlModel = new QUrlModel(this);
  • trunk/src/gui/dialogs/qsidebar_p.h

    r651 r765  
    7171     void initStyleOption(QStyleOptionViewItem *option,
    7272                          const QModelIndex &index) const;
     73     QSize sizeHint (const QStyleOptionViewItem &option,
     74                     const QModelIndex &index) const;
    7375};
    7476
Note: See TracChangeset for help on using the changeset viewer.