1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-06 09:37:35 +00:00

GFilePicker: Add a preview pane on the right-hand side for image previews.

Currently the preview pane is always open, but maybe it should be something
you can configure, or something that happens automagically.
This commit is contained in:
Andreas Kling 2019-05-26 22:33:54 +02:00
parent 5ba2dba392
commit 3654c33c56
2 changed files with 85 additions and 22 deletions

View file

@ -3,19 +3,26 @@
#include <LibGUI/GTableView.h>
class GDirectoryModel;
class GLabel;
class GFilePicker final : public GDialog {
public:
GFilePicker(const String& path = "/", CObject* parent = nullptr);
virtual ~GFilePicker() override;
// TODO: Should this return a FileSystemPath instead?
FileSystemPath selected_file() const { return m_selected_file; }
virtual const char* class_name() const override { return "GFilePicker"; }
private:
void set_preview(const FileSystemPath&);
void clear_preview();
GTableView* m_view { nullptr };
Retained<GDirectoryModel> m_model;
FileSystemPath m_selected_file;
GLabel* m_preview_image_label { nullptr };
GLabel* m_preview_name_label { nullptr };
GLabel* m_preview_geometry_label { nullptr };
};