Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<file>resources/files.svg</file>
<file>resources/state-error.svg</file>
<file>resources/state-warning.svg</file>
<file>resources/folder.svg</file>
<file>resources/rename.png</file>
<file>resources/network.svg</file>
<file>resources/settings.svg</file>
<file>resources/public-white.svg</file>
Expand Down
1 change: 0 additions & 1 deletion resources/folder.svg

This file was deleted.

Binary file added resources/rename.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions src/gui/activityitemdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void ActivityItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
} else if(activityType == Activity::SyncResultType){

// Secondary will be 'open file manager' with the folder icon
secondaryButton.icon = QIcon(QLatin1String(":/client/resources/folder.svg"));
secondaryButton.icon = QIcon(QLatin1String(":/client/resources/rename.png"));
secondaryButton.iconSize = QSize(iconSize, iconSize);

// Primary button will be 'open browser'
Expand All @@ -229,8 +229,13 @@ void ActivityItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &

} else if(activityType == Activity::SyncFileItemType){

// Secondary will be 'open file manager' with the folder icon
secondaryButton.icon = QIcon(QLatin1String(":/client/resources/folder.svg"));
_buttonHeight = buttonSize;
_primaryButtonWidth = primaryButton.rect.size().width();
_secondaryButtonWidth = secondaryButton.rect.size().width();
_spaceBetweenButtons = secondaryButton.rect.left() - primaryButton.rect.right();

// Secondary will be 'open file manager' with the rename icon
secondaryButton.icon = QIcon(QLatin1String(":/client/resources/rename.png"));
secondaryButton.iconSize = QSize(iconSize, iconSize);

// No primary button on this case
Expand Down Expand Up @@ -309,27 +314,25 @@ bool ActivityItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
int buttonsWidth = _primaryButtonWidth + _spaceBetweenButtons + _secondaryButtonWidth;
int x = option.rect.left() + option.rect.width() - buttonsWidth - _timeWidth;
int y = option.rect.top();

// clickable area for ...
if (mouseEventX > x && mouseEventX < x + buttonsWidth){
if(mouseEventY > y && mouseEventY < y + _buttonHeight){

// ...primary button ('more information' or 'accept' on notifications or 'open browser' on errors)
if (mouseEventX > x && mouseEventX < x + _primaryButtonWidth){
emit primaryButtonClickedOnItemView(index);

// ...secondary button ('dismiss' on notifications or 'open file manager' on errors)
} else {
x += _primaryButtonWidth + _spaceBetweenButtons;
if (mouseEventX > x && mouseEventX < x + _secondaryButtonWidth)
{
emit secondaryButtonClickedOnItemView(index);
}
}
}
}
}
}
}

return QStyledItemDelegate::editorEvent(event, model, option, index);
}

Expand Down