Added background cat. Proof of concept :3
This commit is contained in:
parent
7e222c3e8f
commit
d67d58e662
@ -33,9 +33,15 @@ ListViewDelegate::ListViewDelegate ( QObject* parent ) : QStyledItemDelegate ( p
|
||||
|
||||
void drawSelectionRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect)
|
||||
{
|
||||
if (!(option.state & QStyle::State_Selected))
|
||||
return;
|
||||
painter->fillRect ( rect, option.palette.brush ( QPalette::Highlight ) );
|
||||
if ((option.state & QStyle::State_Selected))
|
||||
painter->fillRect ( rect, option.palette.brush ( QPalette::Highlight ) );
|
||||
else
|
||||
{
|
||||
QColor backgroundColor = option.palette.color(QPalette::Background);
|
||||
backgroundColor.setAlpha(160);
|
||||
painter->fillRect ( rect, QBrush(backgroundColor) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect)
|
||||
|
@ -66,6 +66,21 @@ MainWindow::MainWindow ( QWidget *parent ) :
|
||||
// Create the widget
|
||||
view = new KCategorizedView ( ui->centralWidget );
|
||||
drawer = new KCategoryDrawer ( view );
|
||||
/*
|
||||
QPalette pal = view->palette();
|
||||
pal.setBrush(QPalette::Base, QBrush(QPixmap(QString::fromUtf8(":/backgrounds/kitteh"))));
|
||||
view->setPalette(pal);
|
||||
*/
|
||||
view->setStyleSheet(
|
||||
"QListView\
|
||||
{\
|
||||
background-image: url(:/backgrounds/kitteh);\
|
||||
background-attachment: fixed;\
|
||||
background-clip: padding;\
|
||||
background-position: top right;\
|
||||
background-repeat: none;\
|
||||
background-color:palette(base);\
|
||||
}");
|
||||
|
||||
view->setSelectionMode ( QAbstractItemView::SingleSelection );
|
||||
//view->setSpacing( KDialog::spacingHint() );
|
||||
|
@ -34,4 +34,7 @@
|
||||
<file alias="scalable/apps/multimc.svg">resources/icons/multimc.svg</file>
|
||||
<file alias="index.theme">resources/XdgIcon.theme</file>
|
||||
</qresource>
|
||||
<qresource prefix="/backgrounds">
|
||||
<file alias="kitteh">resources/catbgrnd2.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
resources/catbgrnd2.png
Normal file
BIN
resources/catbgrnd2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
Loading…
Reference in New Issue
Block a user