ZaStoGram_desktop/Telegram/SourceFiles/editor/editor_layer_widget.h

53 lines
1.3 KiB
C++

/*
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/unique_qptr.h"
#include "editor/photo_editor_common.h"
#include "ui/effects/layer_backdrop.h"
#include "ui/image/image.h"
#include "ui/layers/layer_widget.h"
enum class ImageRoundRadius;
namespace Window {
class Controller;
class SessionController;
} // namespace Window
namespace Editor {
class LayerWidget final : public Ui::LayerWidget {
public:
LayerWidget(
not_null<QWidget*> parent,
base::unique_qptr<Ui::RpWidget> content,
Fn<void()> shown = nullptr);
void parentResized() override;
void showFinished() override;
bool closeByOutsideClick() const override;
private:
bool eventHook(QEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;
void keyReleaseEvent(QKeyEvent *e) override;
int resizeGetHeight(int newWidth) override;
void forwardKeyEvent(not_null<QKeyEvent*> e);
void start();
const base::unique_qptr<Ui::RpWidget> _content;
Fn<void()> _shown;
Ui::LayerBackdrop _backdrop;
bool _forwardingKeyEvent = false;
bool _keyEventIgnored = false;
};
} // namespace Editor