tdesktop/Telegram/SourceFiles/boxes/photo_crop_box.h

43 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
2017-04-06 14:38:10 +00:00
#include "boxes/abstract_box.h"
2019-09-18 11:19:05 +00:00
class PhotoCropBox : public Ui::BoxContent {
public:
2018-12-23 17:23:36 +00:00
PhotoCropBox(QWidget*, const QImage &img, const QString &title);
int32 mouseState(QPoint p);
2017-11-21 09:20:56 +00:00
rpl::producer<QImage> ready() const;
protected:
void prepare() override;
void keyPressEvent(QKeyEvent *e) override;
void paintEvent(QPaintEvent *e) override;
void mousePressEvent(QMouseEvent *e) override;
void mouseReleaseEvent(QMouseEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;
private:
void sendPhoto();
2015-11-09 09:51:22 +00:00
2015-09-16 13:04:08 +00:00
QString _title;
int32 _downState = 0;
int32 _thumbx, _thumby, _thumbw, _thumbh;
int32 _cropx, _cropy, _cropw;
int32 _fromposx, _fromposy, _fromcropx, _fromcropy, _fromcropw;
QImage _img;
QPixmap _thumb;
2016-11-24 19:28:23 +00:00
QImage _mask, _fade;
rpl::event_stream<QImage> _readyImages;
};