Ticket #205: fileicons.diff
File fileicons.diff, 2.3 KB (added by , 13 years ago) |
---|
-
src/plugins/coreplugin/fileiconprovider.cpp
159 159 { 160 160 QPixmap iconPixmap = qApp->style()->standardIcon(baseIcon).pixmap(size); 161 161 QPainter painter(&iconPixmap); 162 painter.drawPixmap(0, 0, overlayIcon.pixmap(size)); 162 QPixmap overlayPixmap = overlayIcon.pixmap(size); 163 painter.drawPixmap((size.width() - overlayPixmap.width()) / 2, 164 (size.height() - overlayPixmap.height()) / 2, overlayPixmap); 163 165 painter.end(); 164 166 return iconPixmap; 165 167 } … … 178 180 179 181 QTC_ASSERT(!icon.isNull() && !suffix.isEmpty(), return) 180 182 181 const QPixmap fileIconPixmap = overlayIcon(QStyle::SP_FileIcon, icon, QSize(16, 16));183 const QPixmap fileIconPixmap = overlayIcon(QStyle::SP_FileIcon, icon, iconSize()); 182 184 // replace old icon, if it exists 183 185 const CacheIterator it = findBySuffix(suffix, d->m_cache.begin(), d->m_cache.end()); 184 186 if (it == d->m_cache.end()) { … … 208 210 return FileIconProviderPrivate::m_instance; 209 211 } 210 212 213 /*! 214 Returns the size of a small icon 215 */ 216 217 QSize FileIconProvider::iconSize() 218 { 219 int s = qApp->style()->pixelMetric(QStyle::PM_SmallIconSize); 220 return QSize(s, s); 221 } 222 211 223 } // namespace core -
src/plugins/coreplugin/fileiconprovider.h
69 69 70 70 static FileIconProvider *instance(); 71 71 72 static QSize iconSize(); 73 72 74 private: 73 75 FileIconProviderPrivate *d; 74 76 }; -
src/plugins/projectexplorer/foldernavigationwidget.cpp
149 149 #endif 150 150 m_fileSystemModel->setFilter(filters); 151 151 m_filterModel->setSourceModel(m_fileSystemModel); 152 m_listView->setIconSize( QSize(16,16));152 m_listView->setIconSize(Core::FileIconProvider::iconSize()); 153 153 m_listView->setModel(m_filterModel); 154 154 m_listView->setFrameStyle(QFrame::NoFrame);