/* 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 "ui/effects/animations.h" #include "ui/effects/gradient.h" #include "ui/rp_widget.h" namespace Ui { class IconButton; class AbstractButton; class LabelSimple; class FlatLabel; } // namespace Ui namespace Main { class Session; } // namespace Main namespace Calls { class Call; class GroupCall; class SignalBars; class Mute; enum class MuteState; class TopBar : public Ui::RpWidget { public: TopBar(QWidget *parent, const base::weak_ptr &call); TopBar(QWidget *parent, const base::weak_ptr &call); ~TopBar(); protected: void resizeEvent(QResizeEvent *e) override; void paintEvent(QPaintEvent *e) override; private: 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); const base::weak_ptr _call; const base::weak_ptr _groupCall; bool _muted = false; QImage _userpics; object_ptr _durationLabel; object_ptr _signalBars; object_ptr _fullInfoLabel; object_ptr _shortInfoLabel; object_ptr _hangupLabel; object_ptr _mute; object_ptr _info; object_ptr _hangup; QBrush _groupBrush; anim::linear_gradients _gradients; Ui::Animations::Simple _switchStateAnimation; base::Timer _updateDurationTimer; }; } // namespace Calls