init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
58
Telegram/SourceFiles/ui/chat/attach/attach_controls.h
Normal file
58
Telegram/SourceFiles/ui/chat/attach/attach_controls.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
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 "ui/abstract_button.h"
|
||||
#include "ui/round_rect.h"
|
||||
#include "ui/rp_widget.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
class AttachControls final {
|
||||
public:
|
||||
enum class Type {
|
||||
Full,
|
||||
EditOnly,
|
||||
None,
|
||||
};
|
||||
|
||||
AttachControls();
|
||||
|
||||
void paint(QPainter &p, int x, int y);
|
||||
void setType(Type type);
|
||||
void setVertical(bool vertical);
|
||||
|
||||
[[nodiscard]] int width() const;
|
||||
[[nodiscard]] int height() const;
|
||||
[[nodiscard]] Type type() const;
|
||||
[[nodiscard]] bool vertical() const;
|
||||
|
||||
private:
|
||||
RoundRect _rect;
|
||||
Type _type = Type::Full;
|
||||
bool _vertical = false;
|
||||
|
||||
};
|
||||
|
||||
class AttachControlsWidget final : public RpWidget {
|
||||
public:
|
||||
AttachControlsWidget(
|
||||
not_null<RpWidget*> parent,
|
||||
AttachControls::Type type = AttachControls::Type::Full);
|
||||
|
||||
[[nodiscard]] rpl::producer<> editRequests() const;
|
||||
[[nodiscard]] rpl::producer<> deleteRequests() const;
|
||||
|
||||
private:
|
||||
const base::unique_qptr<AbstractButton> _edit;
|
||||
const base::unique_qptr<AbstractButton> _delete;
|
||||
AttachControls _controls;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Ui
|
||||
Reference in New Issue
Block a user