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:
parent
9a3918763b
commit
92f37eef8c
@ -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();
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user