summary refs log tree commit diff
path: root/include/dialogs
diff options
context:
space:
mode:
authorchristarazi <christarazi@users.noreply.github.com>2018-01-09 23:52:59 -0800
committermujx <mujx@users.noreply.github.com>2018-01-10 09:52:59 +0200
commitddfce136ed4de5b80ae5961b6a11363624e0b244 (patch)
treeb3d54b98832f1043d36fe652099625e0579c058e /include/dialogs
parentMake group's sidebar visible through an option (diff)
downloadnheko-ddfce136ed4de5b80ae5961b6a11363624e0b244.tar.xz
Add support for pasting images into a room (#180)
fixes #132 
Diffstat (limited to 'include/dialogs')
-rw-r--r--include/dialogs/PreviewImageOverlay.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/dialogs/PreviewImageOverlay.h b/include/dialogs/PreviewImageOverlay.h
new file mode 100644

index 00000000..a1ab32ee --- /dev/null +++ b/include/dialogs/PreviewImageOverlay.h
@@ -0,0 +1,57 @@ +/* + * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include <QLabel> +#include <QLineEdit> +#include <QPixmap> +#include <QWidget> + +#include "FlatButton.h" + +class QMimeData; + +namespace dialogs { + +class PreviewImageOverlay : public QWidget +{ + Q_OBJECT +public: + PreviewImageOverlay(QWidget *parent = nullptr); + + void setImageAndCreate(const QByteArray data, const QString &type); + void setImageAndCreate(const QString &path); + +signals: + void confirmImageUpload(const QByteArray data, const QString &img_name); + +private: + void init(); + + QPixmap image_; + QByteArray imageData_; + QString imagePath_; + + QLabel titleLabel_; + QLabel imageLabel_; + QLineEdit imageName_; + + FlatButton upload_; + FlatButton cancel_; +}; +} // dialogs