mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added AbstractSinglePreview.
This commit is contained in:
parent
c1e86418c2
commit
5431541694
6 changed files with 41 additions and 11 deletions
|
@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
AbstractSingleFilePreview::AbstractSingleFilePreview(QWidget *parent)
|
AbstractSingleFilePreview::AbstractSingleFilePreview(QWidget *parent)
|
||||||
: RpWidget(parent)
|
: AbstractSinglePreview(parent)
|
||||||
, _editMedia(this, st::sendBoxAlbumGroupButtonFile)
|
, _editMedia(this, st::sendBoxAlbumGroupButtonFile)
|
||||||
, _deleteMedia(this, st::sendBoxAlbumGroupButtonFile) {
|
, _deleteMedia(this, st::sendBoxAlbumGroupButtonFile) {
|
||||||
|
|
||||||
|
@ -37,6 +37,10 @@ rpl::producer<> AbstractSingleFilePreview::deleteRequests() const {
|
||||||
return _deleteMedia->clicks() | rpl::to_empty;
|
return _deleteMedia->clicks() | rpl::to_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpl::producer<> AbstractSingleFilePreview::modifyRequests() const {
|
||||||
|
return rpl::never<>();
|
||||||
|
}
|
||||||
|
|
||||||
void AbstractSingleFilePreview::prepareThumbFor(
|
void AbstractSingleFilePreview::prepareThumbFor(
|
||||||
Data &data,
|
Data &data,
|
||||||
const QImage &preview) {
|
const QImage &preview) {
|
||||||
|
|
|
@ -7,20 +7,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/chat/attach/attach_abstract_single_preview.h"
|
||||||
#include "base/object_ptr.h"
|
#include "base/object_ptr.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
class IconButton;
|
class IconButton;
|
||||||
|
|
||||||
class AbstractSingleFilePreview : public RpWidget {
|
class AbstractSingleFilePreview : public AbstractSinglePreview {
|
||||||
public:
|
public:
|
||||||
AbstractSingleFilePreview(QWidget *parent);
|
AbstractSingleFilePreview(QWidget *parent);
|
||||||
~AbstractSingleFilePreview();
|
~AbstractSingleFilePreview();
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<> deleteRequests() const;
|
[[nodiscard]] rpl::producer<> deleteRequests() const override;
|
||||||
[[nodiscard]] rpl::producer<> editRequests() const;
|
[[nodiscard]] rpl::producer<> editRequests() const override;
|
||||||
|
[[nodiscard]] rpl::producer<> modifyRequests() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct Data {
|
struct Data {
|
||||||
|
|
|
@ -23,7 +23,7 @@ constexpr auto kMinPreviewWidth = 20;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AbstractSingleMediaPreview::AbstractSingleMediaPreview(QWidget *parent)
|
AbstractSingleMediaPreview::AbstractSingleMediaPreview(QWidget *parent)
|
||||||
: RpWidget(parent)
|
: AbstractSinglePreview(parent)
|
||||||
, _minThumbH(st::sendBoxAlbumGroupSize.height()
|
, _minThumbH(st::sendBoxAlbumGroupSize.height()
|
||||||
+ st::sendBoxAlbumGroupSkipTop * 2)
|
+ st::sendBoxAlbumGroupSkipTop * 2)
|
||||||
, _photoEditorButton(base::make_unique_q<AbstractButton>(this))
|
, _photoEditorButton(base::make_unique_q<AbstractButton>(this))
|
||||||
|
|
|
@ -7,21 +7,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/chat/attach/attach_abstract_single_preview.h"
|
||||||
#include "ui/abstract_button.h"
|
#include "ui/abstract_button.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
class AttachControlsWidget;
|
class AttachControlsWidget;
|
||||||
|
|
||||||
class AbstractSingleMediaPreview : public RpWidget {
|
class AbstractSingleMediaPreview : public AbstractSinglePreview {
|
||||||
public:
|
public:
|
||||||
AbstractSingleMediaPreview(QWidget *parent);
|
AbstractSingleMediaPreview(QWidget *parent);
|
||||||
~AbstractSingleMediaPreview();
|
~AbstractSingleMediaPreview();
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<> deleteRequests() const;
|
[[nodiscard]] rpl::producer<> deleteRequests() const override;
|
||||||
[[nodiscard]] rpl::producer<> editRequests() const;
|
[[nodiscard]] rpl::producer<> editRequests() const override;
|
||||||
[[nodiscard]] rpl::producer<> modifyRequests() const;
|
[[nodiscard]] rpl::producer<> modifyRequests() const override;
|
||||||
|
|
||||||
[[nodiscard]] bool isPhoto() const;
|
[[nodiscard]] bool isPhoto() const;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
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/rp_widget.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
|
||||||
|
class AbstractSinglePreview : public RpWidget {
|
||||||
|
public:
|
||||||
|
using RpWidget::RpWidget;
|
||||||
|
|
||||||
|
[[nodiscard]] virtual rpl::producer<> deleteRequests() const = 0;
|
||||||
|
[[nodiscard]] virtual rpl::producer<> editRequests() const = 0;
|
||||||
|
[[nodiscard]] virtual rpl::producer<> modifyRequests() const = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Ui
|
|
@ -110,6 +110,7 @@ PRIVATE
|
||||||
ui/chat/attach/attach_abstract_single_file_preview.h
|
ui/chat/attach/attach_abstract_single_file_preview.h
|
||||||
ui/chat/attach/attach_abstract_single_media_preview.cpp
|
ui/chat/attach/attach_abstract_single_media_preview.cpp
|
||||||
ui/chat/attach/attach_abstract_single_media_preview.h
|
ui/chat/attach/attach_abstract_single_media_preview.h
|
||||||
|
ui/chat/attach/attach_abstract_single_preview.h
|
||||||
ui/chat/attach/attach_album_preview.cpp
|
ui/chat/attach/attach_album_preview.cpp
|
||||||
ui/chat/attach/attach_album_preview.h
|
ui/chat/attach/attach_album_preview.h
|
||||||
ui/chat/attach/attach_album_thumbnail.cpp
|
ui/chat/attach/attach_album_thumbnail.cpp
|
||||||
|
|
Loading…
Add table
Reference in a new issue