2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-24 19:27:17 +00:00

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-22 02:25:01 +03:00
class InputField;
class IconButton;
2021-10-22 02:25:01 +03:00
enum class InputSubmitSettings;
2019-07-25 20:55:11 +02:00
2019-11-27 11:02:56 +03:00
class RateCallBox : public Ui::BoxContent {
public:
2021-10-22 02:25:01 +03: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-22 02:25:01 +03:00
const InputSubmitSettings _sendWay;
int _rating = 0;
std::vector<object_ptr<Ui::IconButton>> _stars;
object_ptr<Ui::InputField> _comment = { nullptr };
2021-10-22 02:25:01 +03:00
rpl::event_stream<Result> _sends;
};
2021-10-22 02:25:01 +03:00
} // namespace Ui