mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow setting focus rect width to 2px
This commit is contained in:
parent
79095ba971
commit
17206c3a95
@ -873,7 +873,7 @@ class Application(QApplication):
|
||||
v = pcache[v]
|
||||
icon_map[type('')(getattr(style, 'SP_'+k))] = v
|
||||
style.setProperty(u'calibre_icon_map', icon_map)
|
||||
style.setProperty(u'calibre_item_view_focus', True)
|
||||
style.setProperty(u'calibre_item_view_focus', 1)
|
||||
self.__icon_map_memory_ = icon_map
|
||||
|
||||
def setup_styles(self, force_calibre_style):
|
||||
|
@ -3698,7 +3698,7 @@ bool Style::event(QEvent *event) {
|
||||
}
|
||||
return true;
|
||||
} else if (e->propertyName() == QString("calibre_item_view_focus")) {
|
||||
calibre_item_view_focus = property("calibre_item_view_focus").toBool();
|
||||
calibre_item_view_focus = property("calibre_item_view_focus").toInt();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -4803,10 +4803,11 @@ void Style::drawPrimitive(PrimitiveElement element, const QStyleOption *option,
|
||||
painter->setBrush(QBrush(patternCol, Qt::Dense4Pattern));
|
||||
painter->setBrushOrigin(r.topLeft());
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->drawRect(r.left(), r.top(), r.width(), 1); // Top
|
||||
painter->drawRect(r.left(), r.bottom(), r.width(), 1); // Bottom
|
||||
painter->drawRect(r.left(), r.top(), 1, r.height()); // Left
|
||||
painter->drawRect(r.right(), r.top(), 1, r.height()); // Right
|
||||
int fwidth = (calibre_item_view_focus > 1) ? 2 : 1;
|
||||
painter->drawRect(r.left(), r.top(), r.width(), fwidth); // Top
|
||||
painter->drawRect(r.left(), r.bottom(), r.width(), fwidth); // Bottom
|
||||
painter->drawRect(r.left(), r.top(), fwidth, r.height()); // Left
|
||||
painter->drawRect(r.right(), r.top(), fwidth, r.height()); // Right
|
||||
painter->restore();
|
||||
}
|
||||
else
|
||||
|
@ -355,7 +355,7 @@ class Style : public QCommonStyle
|
||||
mutable QList<int> itsMdiButtons[2]; // 0=left, 1=right
|
||||
mutable int itsTitlebarHeight;
|
||||
QHash<int,QString> calibre_icon_map;
|
||||
bool calibre_item_view_focus;
|
||||
int calibre_item_view_focus;
|
||||
bool is_kde_session;
|
||||
|
||||
// Required for Q3Header hover...
|
||||
|
Loading…
x
Reference in New Issue
Block a user