fixed size of `BrowserDialog` (may be refactored)

This commit is contained in:
thrust26 2018-08-29 15:05:36 +02:00
parent 79fd588f8a
commit 7dd433a116
3 changed files with 8 additions and 3 deletions

View File

@ -23,6 +23,7 @@
#include "LauncherDialog.hxx"
#include "PopUpWidget.hxx"
#include "Settings.hxx"
#include "FrameBuffer.hxx"
#include "ConfigPathDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -292,11 +293,12 @@ void ConfigPathDialog::createBrowser(const string& title)
{
uInt32 w = 0, h = 0;
getResizableBounds(w, h);
const GUI::Rect& r = instance().frameBuffer().imageRect();
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
myBrowser = make_unique<BrowserDialog>(this, myFont, r.width()*0.95, r.height()*0.95, title);
else
myBrowser->setTitle(title);
}

View File

@ -22,6 +22,7 @@
#include "Font.hxx"
#include "LauncherDialog.hxx"
#include "Settings.hxx"
#include "FrameBuffer.hxx"
#include "SnapshotDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -181,11 +182,12 @@ void SnapshotDialog::createBrowser(const string& title)
{
uInt32 w = 0, h = 0;
getResizableBounds(w, h);
const GUI::Rect& r = instance().frameBuffer().imageRect();
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
myBrowser = make_unique<BrowserDialog>(this, myFont, r.width()*0.95, r.height()*0.95, title);
else
myBrowser->setTitle(title);
}

View File

@ -397,11 +397,12 @@ void UIDialog::createBrowser(const string& title)
{
uInt32 w = 0, h = 0;
getResizableBounds(w, h);
const GUI::Rect& r = instance().frameBuffer().imageRect();
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
myBrowser = make_unique<BrowserDialog>(this, myFont, r.width()*0.95, r.height()*0.95, title);
else
myBrowser->setTitle(title);
}