From 41a34f74ed1cf16428533724c5eb6f381d813850 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 16 Apr 2017 20:50:30 +0200 Subject: Make FileBrowser a Dialog. --- plugingui/filebrowser.cc | 13 +++++-------- plugingui/filebrowser.h | 9 +++++---- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'plugingui') diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc index 6ac9d3e..50e34c3 100644 --- a/plugingui/filebrowser.cc +++ b/plugingui/filebrowser.cc @@ -46,10 +46,11 @@ #include #endif -namespace GUI { +namespace GUI +{ -FileBrowser::FileBrowser(Widget *parent) - : Widget(parent) +FileBrowser::FileBrowser(Widget* parent) + : Dialog(parent, true) , dir(Directory::cwd()) , lbl_path(this) , lineedit(this) @@ -78,10 +79,6 @@ FileBrowser::FileBrowser(Widget *parent) changeDir(); } -FileBrowser::~FileBrowser() -{ -} - void FileBrowser::setPath(const std::string& path) { INFO(filebrowser, "Setting path to '%s'\n", path.c_str()); @@ -102,7 +99,7 @@ void FileBrowser::setPath(const std::string& path) void FileBrowser::resize(std::size_t width, std::size_t height) { - Widget::resize(width, height); + Dialog::resize(width, height); int offset = 0; int brd = 5; // border diff --git a/plugingui/filebrowser.h b/plugingui/filebrowser.h index bc7170a..7b31864 100644 --- a/plugingui/filebrowser.h +++ b/plugingui/filebrowser.h @@ -29,7 +29,7 @@ #include #include -#include "widget.h" +#include "dialog.h" #include "button.h" #include "listbox.h" #include "lineedit.h" @@ -40,10 +40,11 @@ namespace GUI { -class FileBrowser : public Widget { +class FileBrowser + : public Dialog +{ public: - FileBrowser(Widget *parent); - virtual ~FileBrowser(); + FileBrowser(Widget* parent); void setPath(const std::string& path); -- cgit v1.2.3