Skip to content

Commit

Permalink
Use icon loader for ItemSelector icons
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Sep 24, 2019
1 parent dcc4766 commit d240578
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/YQItemSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "YQUI.h"

#define ITEM_DESCRIPTION_INDENT 20
#define ICON_SIZE 64
#define VERBOSE_SELECTION 0

using std::string;
Expand Down Expand Up @@ -400,12 +401,13 @@ void YQSelectorItemWidget::createWidgets( const string & label,

if ( ! iconName.empty() )
{
_hBox->addStretch( 1000 ); // this takes up any excess space

_iconLabel = new QLabel( "", this );
YUI_CHECK_NEW( _iconLabel );

// FIXME use icon loader
_iconLabel->setPixmap( QPixmap( fromUTF8( iconName ) ) );
// FIXME use icon loader
QIcon icon = YQUI::ui()->loadIcon( iconName );
_iconLabel->setPixmap( icon.pixmap( ICON_SIZE ) );

_descriptionLabel->setObjectName( "YQSelectorItemIcon" ); // for QSS
_iconLabel->setIndent(0);
Expand Down

0 comments on commit d240578

Please sign in to comment.