From 3673603e5a63794d97280d5c234ebca8f2a8a5b9 Mon Sep 17 00:00:00 2001 From: Camila San Date: Wed, 11 Jul 2018 17:29:06 +0200 Subject: [PATCH] Fixes buttons clickable area in the activities list. - Their size was not correctly calculated so it was hard to filter the clicks on the list. User had to click multiple times before clicking on the right acceptable area. Signed-off-by: Camila San --- src/gui/activityitemdelegate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/activityitemdelegate.cpp b/src/gui/activityitemdelegate.cpp index 9596dc16b..1733f0ad8 100644 --- a/src/gui/activityitemdelegate.cpp +++ b/src/gui/activityitemdelegate.cpp @@ -171,9 +171,9 @@ void ActivityItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem & // save info to be able to filter mouse clicks _buttonHeight = buttonSize; - _spaceBetweenButtons = leftMargin; _primaryButtonWidth = primaryButton.rect.size().width(); _secondaryButtonWidth = secondaryButton.rect.size().width(); + _spaceBetweenButtons = secondaryButton.rect.left() - primaryButton.rect.right(); } else if(activityType == Activity::Type::ErrorType){ @@ -187,11 +187,12 @@ void ActivityItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem & // save info to be able to filter mouse clicks _buttonHeight = buttonSize; - _spaceBetweenButtons = leftMargin; _primaryButtonWidth = primaryButton.rect.size().width(); _secondaryButtonWidth = secondaryButton.rect.size().width(); + _spaceBetweenButtons = secondaryButton.rect.left() - primaryButton.rect.right(); + } else { - _spaceBetweenButtons = margin * offset; + _spaceBetweenButtons = leftMargin; _primaryButtonWidth = 0; _secondaryButtonWidth = 0; }