tdesktop/Telegram/SourceFiles/ui/boxes/rate_call_box.h

52 lines
1.0 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 "boxes/abstract_box.h"
namespace Ui {
2021-10-21 23:25:01 +00:00
class InputField;
class IconButton;
2021-10-21 23:25:01 +00:00
enum class InputSubmitSettings;
2019-07-25 18:55:11 +00:00
2019-11-27 08:02:56 +00:00
class RateCallBox : public Ui::BoxContent {
public:
2021-10-21 23:25:01 +00:00
RateCallBox(QWidget*, InputSubmitSettings sendWay);
struct Result {
int rating = 0;
QString comment;
};
[[nodiscard]] rpl::producer<Result> sends() const;
protected:
void prepare() override;
void setInnerFocus() override;
void resizeEvent(QResizeEvent *e) override;
private:
void updateMaxHeight();
void ratingChanged(int value);
void send();
void commentResized();
2021-10-21 23:25:01 +00:00
const InputSubmitSettings _sendWay;
int _rating = 0;
std::vector<object_ptr<Ui::IconButton>> _stars;
object_ptr<Ui::InputField> _comment = { nullptr };
2021-10-21 23:25:01 +00:00
rpl::event_stream<Result> _sends;
};
2021-10-21 23:25:01 +00:00
} // namespace Ui