/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once #include "base/weak_ptr.h" #include "base/timer.h" #include "base/object_ptr.h" #include "base/unique_qptr.h" #include "ui/effects/animations.h" #include "ui/effects/gradient.h" #include "ui/rp_widget.h" namespace Ui { class IconButton; class AbstractButton; class LabelSimple; class FlatLabel; struct GroupCallUser; class GroupCallUserpics; } // namespace Ui namespace Main { class Session; } // namespace Main namespace Calls { class Call; class GroupCall; class SignalBars; class Mute; enum class MuteState; enum class BarState; class TopBar : public Ui::RpWidget { public: TopBar(QWidget *parent, const base::weak_ptr &call); TopBar(QWidget *parent, const base::weak_ptr &call); ~TopBar(); void initBlobsUnder( QWidget *blobsParent, rpl::producer barGeometry); protected: void resizeEvent(QResizeEvent *e) override; void paintEvent(QPaintEvent *e) override; private: struct User; TopBar( QWidget *parent, const base::weak_ptr &call, const base::weak_ptr &groupCall); void initControls(); void updateInfoLabels(); void setInfoLabels(); void updateDurationText(); void updateControlsGeometry(); void startDurationUpdateTimer(crl::time currentDuration); void setMuted(bool mute); void subscribeToMembersChanges(not_null call); void updateUserpics(); const base::weak_ptr _call; const base::weak_ptr _groupCall; bool _muted = false; std::vector _users; std::unique_ptr _userpics; int _userpicsWidth = 0; object_ptr _durationLabel; object_ptr _signalBars; object_ptr _fullInfoLabel; object_ptr _shortInfoLabel; object_ptr _hangupLabel; object_ptr _mute; object_ptr _info; object_ptr _hangup; base::unique_qptr _blobs; rpl::variable _isGroupConnecting = false; QBrush _groupBrush; anim::linear_gradients _gradients; Ui::Animations::Simple _switchStateAnimation; base::Timer _updateDurationTimer; }; } // namespace Calls