diff --git a/client.qrc b/client.qrc index f9952965a4809..1d27ffd922428 100644 --- a/client.qrc +++ b/client.qrc @@ -19,7 +19,7 @@ resources/files.svg resources/state-error.svg resources/state-warning.svg - resources/folder.svg + resources/rename.png resources/network.svg resources/settings.svg resources/public-white.svg diff --git a/resources/folder.svg b/resources/folder.svg deleted file mode 100644 index c311e426b664b..0000000000000 --- a/resources/folder.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/rename.png b/resources/rename.png new file mode 100644 index 0000000000000..02e364d93fb74 Binary files /dev/null and b/resources/rename.png differ diff --git a/src/gui/activityitemdelegate.cpp b/src/gui/activityitemdelegate.cpp index 1d49af7d7e5e6..d3df8256d6e85 100644 --- a/src/gui/activityitemdelegate.cpp +++ b/src/gui/activityitemdelegate.cpp @@ -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' @@ -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 @@ -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); }