Allow creating SeparatePanel with a parent.

This commit is contained in:
John Preston 2022-05-02 07:57:52 +04:00
parent b77fb45083
commit 283cb25dfd
2 changed files with 16 additions and 15 deletions

View file

@ -27,8 +27,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Ui { namespace Ui {
SeparatePanel::SeparatePanel() SeparatePanel::SeparatePanel(QWidget *parent)
: _close(this, st::separatePanelClose) : RpWidget(parent)
, _close(this, st::separatePanelClose)
, _back(this, object_ptr<Ui::IconButton>(this, st::separatePanelBack)) , _back(this, object_ptr<Ui::IconButton>(this, st::separatePanelBack))
, _body(this) { , _body(this) {
setMouseTracking(true); setMouseTracking(true);

View file

@ -25,9 +25,9 @@ class FadeWrapScaled;
namespace Ui { namespace Ui {
class SeparatePanel final : public Ui::RpWidget { class SeparatePanel final : public RpWidget {
public: public:
SeparatePanel(); explicit SeparatePanel(QWidget *parent = nullptr);
void setTitle(rpl::producer<QString> title); void setTitle(rpl::producer<QString> title);
void setInnerSize(QSize size); void setInnerSize(QSize size);
@ -37,10 +37,10 @@ public:
void showAndActivate(); void showAndActivate();
int hideGetDuration(); int hideGetDuration();
void showInner(base::unique_qptr<Ui::RpWidget> inner); void showInner(base::unique_qptr<RpWidget> inner);
void showBox( void showBox(
object_ptr<Ui::BoxContent> box, object_ptr<BoxContent> box,
Ui::LayerOptions options, LayerOptions options,
anim::type animated); anim::type animated);
void showToast(const TextWithEntities &text); void showToast(const TextWithEntities &text);
void destroyLayer(); void destroyLayer();
@ -83,12 +83,12 @@ private:
void finishAnimating(); void finishAnimating();
void finishClose(); void finishClose();
object_ptr<Ui::IconButton> _close; object_ptr<IconButton> _close;
object_ptr<Ui::FlatLabel> _title = { nullptr }; object_ptr<FlatLabel> _title = { nullptr };
object_ptr<Ui::FadeWrapScaled<Ui::IconButton>> _back; object_ptr<FadeWrapScaled<IconButton>> _back;
object_ptr<Ui::RpWidget> _body; object_ptr<RpWidget> _body;
base::unique_qptr<Ui::RpWidget> _inner; base::unique_qptr<RpWidget> _inner;
base::unique_qptr<Ui::LayerStackWidget> _layer = { nullptr }; base::unique_qptr<LayerStackWidget> _layer = { nullptr };
rpl::event_stream<> _synteticBackRequests; rpl::event_stream<> _synteticBackRequests;
rpl::event_stream<> _userCloseRequests; rpl::event_stream<> _userCloseRequests;
rpl::event_stream<> _closeEvents; rpl::event_stream<> _closeEvents;
@ -101,10 +101,10 @@ private:
QPoint _dragStartMousePosition; QPoint _dragStartMousePosition;
QPoint _dragStartMyPosition; QPoint _dragStartMyPosition;
Ui::Animations::Simple _titleLeft; Animations::Simple _titleLeft;
bool _visible = false; bool _visible = false;
Ui::Animations::Simple _opacityAnimation; Animations::Simple _opacityAnimation;
QPixmap _animationCache; QPixmap _animationCache;
QPixmap _borderParts; QPixmap _borderParts;