mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure there is some space between the separator handle dots and the separator edge
This commit is contained in:
parent
87ca4d6fe2
commit
0b0070167d
@ -292,12 +292,12 @@ void CalibreStyle::drawControl(ControlElement element, const QStyleOption *optio
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
const bool horizontal = (option->state & QStyle::State_Horizontal) ? true : false;
|
||||
static const int dot_count = 4;
|
||||
const int handle_width = pixelMetric(PM_SplitterWidth, option, widget);
|
||||
const int available_diameter = horizontal ? option->rect.width() : option->rect.height();
|
||||
const int dot_size = std::max(1, std::min(handle_width, available_diameter));
|
||||
const float handle_width = pixelMetric(PM_SplitterWidth, option, widget);
|
||||
const float available_diameter = (horizontal ? option->rect.width() : option->rect.height());
|
||||
const float dot_size = std::max(1.f, std::min(handle_width, available_diameter - 1));
|
||||
const int start_point = (horizontal ? option->rect.height()/2 : option->rect.width()/2) - (dot_count*dot_size/2);
|
||||
const int offset = (available_diameter - dot_size) / 2;
|
||||
QRect dot_rect = QRect(option->rect.left(), option->rect.top(), dot_size, dot_size);
|
||||
const float offset = (available_diameter - dot_size) / 2.f;
|
||||
QRectF dot_rect = QRectF(option->rect.left(), option->rect.top(), dot_size, dot_size);
|
||||
if (horizontal) dot_rect.moveLeft(dot_rect.left() + offset);
|
||||
else dot_rect.moveTop(dot_rect.top() + offset);
|
||||
for (int i = 0; i < dot_count; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user