tdesktop/Telegram/SourceFiles/calls/calls_top_bar.h

67 lines
1.4 KiB
C
Raw Normal View History

/*
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"
2019-09-13 12:22:54 +00:00
#include "base/object_ptr.h"
2017-09-13 16:57:44 +00:00
#include "ui/rp_widget.h"
namespace Ui {
class IconButton;
class AbstractButton;
class LabelSimple;
class FlatLabel;
} // namespace Ui
2019-08-06 16:40:08 +00:00
namespace Main {
class Session;
} // namespace Main
namespace Calls {
class Call;
2018-05-27 08:24:47 +00:00
class SignalBars;
2020-07-16 16:23:55 +00:00
class TopBar : public Ui::RpWidget {
public:
TopBar(QWidget *parent, const base::weak_ptr<Call> &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(crl::time currentDuration);
void setMuted(bool mute);
2019-08-06 16:40:08 +00:00
const base::weak_ptr<Call> _call;
bool _muted = false;
object_ptr<Ui::LabelSimple> _durationLabel;
2018-05-27 08:24:47 +00:00
object_ptr<SignalBars> _signalBars;
object_ptr<Ui::FlatLabel> _fullInfoLabel;
object_ptr<Ui::FlatLabel> _shortInfoLabel;
object_ptr<Ui::LabelSimple> _hangupLabel;
object_ptr<Ui::IconButton> _mute;
object_ptr<Ui::AbstractButton> _info;
object_ptr<Ui::IconButton> _hangup;
base::Timer _updateDurationTimer;
};
} // namespace Calls