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 <hello@camila.codes>
This commit is contained in:
Camila San 2018-07-11 17:29:06 +02:00 committed by Roeland Jago Douma
parent 9f9be7814c
commit 3673603e5a
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -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;
}