1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

improve alignments for layouts delegates

This commit is contained in:
Michail Vourlakos 2020-03-16 14:47:42 +02:00
parent 9a3918763b
commit 92f37eef8c
3 changed files with 8 additions and 8 deletions

View File

@ -47,7 +47,7 @@ void CheckBox::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
QStyleOptionViewItem adjustedOption = option;
//! Remove the focus dotted lines
adjustedOption.state = (adjustedOption.state & ~QStyle::State_HasFocus);
adjustedOption.displayAlignment = Qt::AlignHCenter;
adjustedOption.displayAlignment = Qt::AlignHCenter | Qt::AlignVCenter;
bool isSharedCapable = index.data(Model::Layouts::LAYOUTISSHAREDROLE).toBool() && index.data(Model::Layouts::INMULTIPLELAYOUTSROLE).toBool();

View File

@ -122,7 +122,7 @@ void LayoutName::paint(QPainter *painter, const QStyleOptionViewItem &option, co
//! Lock Icon
QIcon firstIcon = isLocked && !showTwoIcons ? QIcon::fromTheme("object-locked") : QIcon::fromTheme("document-share");
QIcon::Mode mode = selected ? QIcon::Selected : QIcon::Normal;
QIcon::Mode mode = selected && (Latte::colorGroup(option) == QPalette::Active) ? QIcon::Selected : QIcon::Normal;
if (qApp->layoutDirection() == Qt::RightToLeft) {
painter->drawPixmap(QRect(option.rect.x(), option.rect.y(), thick, thick), firstIcon.pixmap(thick, thick, mode));

View File

@ -230,19 +230,19 @@ QVariant Layouts::headerData(int section, Qt::Orientation orientation, int role)
break;
case BACKGROUNDCOLUMN:
if (role == Qt::DisplayRole) {
return QString("");//(i18nc("column for layout background", "Background"));
return QIcon::fromTheme("games-config-background");//(i18nc("column for layout background", "Background"));
} else if (role == Qt::DecorationRole) {
return QIcon::fromTheme("games-config-background");//QString();//QIcon::fromTheme("games-config-background");
} else if (role == Qt::TextAlignmentRole ){
return QString("");//QIcon::fromTheme("games-config-background");//QString();//QIcon::fromTheme("games-config-background");
}/* else if (role == Qt::TextAlignmentRole ){
return QVariant::fromValue(Qt::AlignHCenter | Qt::AlignVCenter);
}
}*/
break;
case NAMECOLUMN:
if (role == Qt::DisplayRole) {
return QString(i18nc("column for layout name", "Name"));
} else if (role == Qt::TextAlignmentRole) {
}/* else if (role == Qt::TextAlignmentRole) {
return QVariant::fromValue(Qt::AlignLeft | Qt::AlignVCenter);
}
}*/
break;
case MENUCOLUMN:
if (role == Qt::DisplayRole) {