diff --git a/Telegram/Resources/colors.palette b/Telegram/Resources/colors.palette index ec28a02c4..60b942ea8 100644 --- a/Telegram/Resources/colors.palette +++ b/Telegram/Resources/colors.palette @@ -255,7 +255,7 @@ emojiPanHeaderFg: windowSubTextFg; // emoji panel section header text emojiPanHeaderBg: #fffffff2 | emojiPanBg; // emoji panel section header background emojiIconFg: checkboxFg; // emoji category icon emojiIconFgActive: windowBgActive; // active emoji category icon -stickerPanDeleteBg: #000000cc; // delete X button background for custom sent stickers in stickers panel (legacy) +stickerPanDeleteBg: #000000ff; // delete X button background for custom sent stickers in stickers panel (legacy) stickerPanDeleteFg: windowFgActive; // delete X button icon for custom sent stickers in stickers panel (legacy) stickerPreviewBg: #ffffffb0; // sticker and GIF preview background (when you press and hold on a sticker) diff --git a/Telegram/Resources/icons/emoji_delete.png b/Telegram/Resources/icons/emoji_delete.png index 8023fa423..864252d7f 100644 Binary files a/Telegram/Resources/icons/emoji_delete.png and b/Telegram/Resources/icons/emoji_delete.png differ diff --git a/Telegram/Resources/icons/emoji_delete@2x.png b/Telegram/Resources/icons/emoji_delete@2x.png index bae82620a..6283a9eba 100644 Binary files a/Telegram/Resources/icons/emoji_delete@2x.png and b/Telegram/Resources/icons/emoji_delete@2x.png differ diff --git a/Telegram/Resources/icons/emoji_delete_bg.png b/Telegram/Resources/icons/emoji_delete_bg.png index 6f973e511..251e7cd2e 100644 Binary files a/Telegram/Resources/icons/emoji_delete_bg.png and b/Telegram/Resources/icons/emoji_delete_bg.png differ diff --git a/Telegram/Resources/icons/emoji_delete_bg@2x.png b/Telegram/Resources/icons/emoji_delete_bg@2x.png index 08c327685..2c4f0a08a 100644 Binary files a/Telegram/Resources/icons/emoji_delete_bg@2x.png and b/Telegram/Resources/icons/emoji_delete_bg@2x.png differ diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index 3a8b8d6e0..fc9e0dd85 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -194,11 +194,12 @@ hashtagClose: IconButton { stickerPanSize: size(64px, 64px); stickerPanPadding: 11px; -stickerPanDelete: icon { - { "emoji_delete_bg", stickerPanDeleteBg }, - { "emoji_delete", stickerPanDeleteFg }, -}; -stickerPanDeleteOpacity: 0.5; +stickerPanDeleteIconBg: icon {{ "emoji_delete_bg", stickerPanDeleteBg }}; +stickerPanDeleteIconFg: icon {{ "emoji_delete", stickerPanDeleteFg }}; +stickerPanDeleteOpacityBg: 0.3; +stickerPanDeleteOpacityBgOver: 0.5; +stickerPanDeleteOpacityFg: 0.8; +stickerPanDeleteOpacityFgOver: 1.; stickerPanRemoveSet: hashtagClose; stickerIconPadding: 5px; stickerIconOpacity: 0.7; diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index bab357f2c..b18d8517f 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -839,10 +839,12 @@ void StickersListWidget::paintSticker(Painter &p, Set &set, int y, int index, bo } if (selected && stickerHasDeleteButton(set, index)) { - auto xPos = pos + QPoint(st::stickerPanSize.width() - st::stickerPanDelete.width(), 0); - if (!deleteSelected) p.setOpacity(st::stickerPanDeleteOpacity); - st::stickerPanDelete.paint(p, xPos, width()); - if (!deleteSelected) p.setOpacity(1.); + auto xPos = pos + QPoint(st::stickerPanSize.width() - st::stickerPanDeleteIconBg.width(), 0); + p.setOpacity(deleteSelected ? st::stickerPanDeleteOpacityBgOver : st::stickerPanDeleteOpacityBg); + st::stickerPanDeleteIconBg.paint(p, xPos, width()); + p.setOpacity(deleteSelected ? st::stickerPanDeleteOpacityFgOver : st::stickerPanDeleteOpacityFg); + st::stickerPanDeleteIconFg.paint(p, xPos, width()); + p.setOpacity(1.); } } @@ -1466,7 +1468,7 @@ void StickersListWidget::updateSelected() { if (stickerHasDeleteButton(set, index)) { auto inx = sx - (columnIndex * st::stickerPanSize.width()); auto iny = yOffset - (rowIndex * st::stickerPanSize.height()); - if (inx >= st::stickerPanSize.width() - st::stickerPanDelete.width() && iny < st::stickerPanDelete.height()) { + if (inx >= st::stickerPanSize.width() - st::stickerPanDeleteIconBg.width() && iny < st::stickerPanDeleteIconBg.height()) { overDelete = true; } } diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index 7158b2e25..078dad98d 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -201,17 +201,19 @@ void Gif::paint(Painter &p, const QRect &clip, const PaintContext *context) cons } if (_delete && (_state & StateFlag::Over)) { - float64 deleteOver = _a_deleteOver.current(context->ms, (_state & StateFlag::DeleteOver) ? 1 : 0); - QPoint deletePos = QPoint(_width - st::stickerPanDelete.width(), 0); - p.setOpacity(deleteOver + (1 - deleteOver) * st::stickerPanDeleteOpacity); - st::stickerPanDelete.paint(p, deletePos, _width); - p.setOpacity(1); + auto deleteSelected = (_state & StateFlag::DeleteOver); + auto deletePos = QPoint(_width - st::stickerPanDeleteIconBg.width(), 0); + p.setOpacity(deleteSelected ? st::stickerPanDeleteOpacityBgOver : st::stickerPanDeleteOpacityBg); + st::stickerPanDeleteIconBg.paint(p, deletePos, width()); + p.setOpacity(deleteSelected ? st::stickerPanDeleteOpacityFgOver : st::stickerPanDeleteOpacityFg); + st::stickerPanDeleteIconFg.paint(p, deletePos, width()); + p.setOpacity(1.); } } void Gif::getState(ClickHandlerPtr &link, HistoryCursorState &cursor, QPoint point) const { if (QRect(0, 0, _width, st::inlineMediaHeight).contains(point)) { - if (_delete && rtlpoint(point, _width).x() >= _width - st::stickerPanDelete.width() && point.y() < st::stickerPanDelete.height()) { + if (_delete && rtlpoint(point, _width).x() >= _width - st::stickerPanDeleteIconBg.width() && point.y() < st::stickerPanDeleteIconBg.height()) { link = _delete; } else { link = _send;