aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_titlebar
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-04-17 21:46:48 +0200
committerfiaxh <git@mx.ax.lt>2018-04-19 15:41:47 +0200
commite80da806022d8aaa32f77f3c7f0333cc1c80829b (patch)
tree2f388b4773daa1654d4edc642c3af89eb3eaa083 /main/src/ui/conversation_titlebar
parent6f27c3e58fb8bcb16cae862b95fdd8cdd5073b0b (diff)
downloaddino-e80da806022d8aaa32f77f3c7f0333cc1c80829b.tar.gz
dino-e80da806022d8aaa32f77f3c7f0333cc1c80829b.zip
Add image preview to file choosers
Co-authored-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'main/src/ui/conversation_titlebar')
-rw-r--r--main/src/ui/conversation_titlebar/file_entry.vala8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/ui/conversation_titlebar/file_entry.vala b/main/src/ui/conversation_titlebar/file_entry.vala
index 0f0eb6d6..fb6ac3a0 100644
--- a/main/src/ui/conversation_titlebar/file_entry.vala
+++ b/main/src/ui/conversation_titlebar/file_entry.vala
@@ -24,6 +24,9 @@ public class FileEntry : Plugins.ConversationTitlebarEntry, Object {
public class FileWidget : Button, Plugins.ConversationTitlebarWidget {
+ private const int PREVIEW_SIZE = 180;
+ private const int PREVIEW_PADDING = 3;
+
private Conversation? conversation;
private StreamInteractor stream_interactor;
@@ -35,9 +38,8 @@ public class FileWidget : Button, Plugins.ConversationTitlebarWidget {
}
public void on_clicked() {
- FileChooserNative chooser = new FileChooserNative (
- "Select file", get_toplevel() as Window, FileChooserAction.OPEN,
- "Select", "Cancel");
+ PreviewFileChooserNative chooser = new PreviewFileChooserNative("Select file", get_toplevel() as Window, FileChooserAction.OPEN, "Select", "Cancel");
+
// long max_file_size = stream_interactor.get_module(Manager.IDENTITY).get_max_file_size(conversation.account);
// if (max_file_size != -1) {
// FileFilter filter = new FileFilter();