diff --git a/Telegram/SourceFiles/ui/controls/swipe_handler.cpp b/Telegram/SourceFiles/ui/controls/swipe_handler.cpp index 654399fc53..091ebf01e1 100644 --- a/Telegram/SourceFiles/ui/controls/swipe_handler.cpp +++ b/Telegram/SourceFiles/ui/controls/swipe_handler.cpp @@ -332,7 +332,8 @@ void SetupSwipeHandler( SwipeBackResult SetupSwipeBack( not_null widget, Fn()> colors, - bool mirrored) { + bool mirrored, + bool iconMirrored) { struct State { base::unique_qptr back; SwipeContextData data; @@ -398,17 +399,22 @@ SwipeBackResult SetupSwipeBack( const auto arrowHalf = arrowSize / 2; const auto arrowX = st::swipeBackSize / 8 + rect.x() - + halfSize - - arrowHalf; + + halfSize; const auto arrowY = rect.y() + halfSize; auto arrowPath = QPainterPath(); - arrowPath.moveTo(arrowX + arrowSize, arrowY); - arrowPath.lineTo(arrowX, arrowY); - arrowPath.lineTo(arrowX + arrowHalf, arrowY - arrowHalf); - arrowPath.moveTo(arrowX, arrowY); - arrowPath.lineTo(arrowX + arrowHalf, arrowY + arrowHalf); + const auto direction = iconMirrored ? -1 : 1; + arrowPath.moveTo(arrowX + direction * arrowSize, arrowY); + arrowPath.lineTo(arrowX, arrowY); + arrowPath.lineTo( + arrowX + direction * arrowHalf, + arrowY - arrowHalf); + arrowPath.moveTo(arrowX, arrowY); + arrowPath.lineTo( + arrowX + direction * arrowHalf, + arrowY + arrowHalf); + arrowPath.translate(-direction * arrowHalf, 0); p.drawPath(arrowPath); } if (reachRatio) { diff --git a/Telegram/SourceFiles/ui/controls/swipe_handler.h b/Telegram/SourceFiles/ui/controls/swipe_handler.h index 7c5e3ff20f..744f5f5b3a 100644 --- a/Telegram/SourceFiles/ui/controls/swipe_handler.h +++ b/Telegram/SourceFiles/ui/controls/swipe_handler.h @@ -40,7 +40,8 @@ void SetupSwipeHandler( [[nodiscard]] SwipeBackResult SetupSwipeBack( not_null widget, Fn()> colors, - bool mirrored = false); + bool mirrored = false, + bool iconMirrored = false); [[nodiscard]] SwipeHandlerFinishData DefaultSwipeBackHandlerFinishData( Fn callback);