From e80da806022d8aaa32f77f3c7f0333cc1c80829b Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 17 Apr 2018 21:46:48 +0200 Subject: Add image preview to file choosers Co-authored-by: Thibaut Girka --- main/src/ui/conversation_titlebar/file_entry.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main/src/ui/conversation_titlebar') 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(); -- cgit v1.2.3-54-g00ecf