From 79feb0c6d9b2e3105162999b9c4a24953a944506 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 12 Aug 2020 12:47:19 +0400 Subject: [PATCH] Show video icon in call bubble in history. --- Telegram/SourceFiles/history/history.style | 14 +++++++++----- .../history/view/media/history_view_call.cpp | 8 +++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history/history.style b/Telegram/SourceFiles/history/history.style index 6cb70c8bcd..9b7bdbf425 100644 --- a/Telegram/SourceFiles/history/history.style +++ b/Telegram/SourceFiles/history/history.style @@ -437,11 +437,15 @@ historyCallArrowOut: icon {{ "call_arrow_out", historyCallArrowOutFg }}; historyCallArrowOutSelected: icon {{ "call_arrow_out", historyCallArrowOutFgSelected }}; historyCallWidth: 240px; historyCallHeight: 56px; -historyCallInIcon: icon {{ "menu_calls", msgFileInBg }}; -historyCallInIconSelected: icon {{ "menu_calls", msgFileInBgSelected }}; -historyCallOutIcon: icon {{ "menu_calls", msgFileOutBg }}; -historyCallOutIconSelected: icon {{ "menu_calls", msgFileOutBgSelected }}; -historyCallIconPosition: point(17px, 18px); +historyCallInIcon: icon {{ "call_answer", msgFileInBg }}; +historyCallInIconSelected: icon {{ "call_answer", msgFileInBgSelected }}; +historyCallOutIcon: icon {{ "call_answer", msgFileOutBg }}; +historyCallOutIconSelected: icon {{ "call_answer", msgFileOutBgSelected }}; +historyCallCameraInIcon: icon {{ "call_camera_active", msgFileInBg }}; +historyCallCameraInIconSelected: icon {{ "call_camera_active", msgFileInBgSelected }}; +historyCallCameraOutIcon: icon {{ "call_camera_active", msgFileOutBg }}; +historyCallCameraOutIconSelected: icon {{ "call_camera_active", msgFileOutBgSelected }}; +historyCallIconPosition: point(12px, 10px); historyCallLeft: 16px; historyCallTop: 9px; historyCallStatusTop: 29px; diff --git a/Telegram/SourceFiles/history/view/media/history_view_call.cpp b/Telegram/SourceFiles/history/view/media/history_view_call.cpp index 50518f0a28..52941ce3ca 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_call.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_call.cpp @@ -105,7 +105,13 @@ void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time m p.setPen(statusFg); p.drawTextLeft(statusleft, statustop, paintw, _status); - auto &icon = outbg ? (selected ? st::historyCallOutIconSelected : st::historyCallOutIcon) : (selected ? st::historyCallInIconSelected : st::historyCallInIcon); + const auto &icon = _video + ? (outbg + ? (selected ? st::historyCallCameraOutIconSelected : st::historyCallCameraOutIcon) + : (selected ? st::historyCallCameraInIconSelected : st::historyCallCameraInIcon)) + : (outbg + ? (selected ? st::historyCallOutIconSelected : st::historyCallOutIcon) + : (selected ? st::historyCallInIconSelected : st::historyCallInIcon)); icon.paint(p, paintw - st::historyCallIconPosition.x() - icon.width(), st::historyCallIconPosition.y() - topMinus, paintw); }