/* 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 "ui/rp_widget.h" namespace Ui { class IconButton; class AbstractButton; class LabelSimple; class FlatLabel; } // namespace Ui namespace Calls { class Call; class SignalBars; class TopBar : public Ui::RpWidget, private base::Subscriber { public: TopBar(QWidget *parent, const base::weak_ptr &call); ~TopBar(); protected: void resizeEvent(QResizeEvent *e) override; void paintEvent(QPaintEvent *e) override; private: void initControls(); void updateInfoLabels(); void setInfoLabels(); void updateDurationText(); void updateControlsGeometry(); void startDurationUpdateTimer(TimeMs currentDuration); void setMuted(bool mute); base::weak_ptr _call; bool _muted = false; 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::Timer _updateDurationTimer; }; } // namespace Calls