summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-19 20:53:01 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-19 20:53:01 +0300
commit038270a1d6519237a13a8699582660ed0db04b6d (patch)
tree98f27cf43065fa99bfa6328de38b23140c67eb24
parent008c5d7674f5f5ba8d0d993956628752116a1daa (diff)
downloadmanaverse-038270a1d6519237a13a8699582660ed0db04b6d.tar.gz
manaverse-038270a1d6519237a13a8699582660ed0db04b6d.tar.bz2
manaverse-038270a1d6519237a13a8699582660ed0db04b6d.tar.xz
manaverse-038270a1d6519237a13a8699582660ed0db04b6d.zip
Use staticbrowserbox in updaterwindow.
-rw-r--r--src/gui/windows/updaterwindow.cpp8
-rw-r--r--src/gui/windows/updaterwindow.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 10d9c9890..86045c62d 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -35,7 +35,6 @@
#include "fs/virtfs/fs.h"
-#include "gui/widgets/browserbox.h"
#include "gui/widgets/button.h"
#include "gui/widgets/containerplacer.h"
#include "gui/widgets/itemlinkhandler.h"
@@ -43,6 +42,7 @@
#include "gui/widgets/layout.h"
#include "gui/widgets/progressbar.h"
#include "gui/widgets/scrollarea.h"
+#include "gui/widgets/staticbrowserbox.h"
#include "net/download.h"
#include "net/updatetypeoperators.h"
@@ -195,7 +195,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost,
mProgressBar(new ProgressBar(this, 0.0, 310, 0,
ProgressColorId::PROG_UPDATE,
"updateprogressbar.xml", "updateprogressbar_fill.xml")),
- mBrowserBox(new BrowserBox(this, BrowserBoxMode::AUTO_SIZE, Opaque_true,
+ mBrowserBox(new StaticBrowserBox(this, Opaque_true,
"browserbox.xml")),
mScrollArea(new ScrollArea(this, mBrowserBox,
Opaque_true, "update_background.xml")),
@@ -422,6 +422,7 @@ void UpdaterWindow::loadNews()
mMemoryBuffer = nullptr;
mDownloadedBytes = 0;
+ mBrowserBox->updateHeight();
mScrollArea->setVerticalScrollAmount(0);
}
@@ -491,6 +492,7 @@ void UpdaterWindow::loadPatch()
mMemoryBuffer = nullptr;
mDownloadedBytes = 0;
+ mBrowserBox->updateHeight();
mScrollArea->setVerticalScrollAmount(0);
}
@@ -862,6 +864,7 @@ void UpdaterWindow::logic()
mBrowserBox->addRow(_("##1 you try again later."));
if (mDownload != nullptr)
mBrowserBox->addRow(mDownload->getError());
+ mBrowserBox->updateHeight();
mScrollArea->setVerticalScrollAmount(
mScrollArea->getVerticalMaxScroll());
mDownloadStatus = UpdateDownloadStatus::UPDATE_COMPLETE;
@@ -1092,6 +1095,7 @@ void UpdaterWindow::loadFile(std::string file)
for (size_t i = 0, sz = lines.size(); i < sz; ++i)
mBrowserBox->addRow(lines[i]);
+ mBrowserBox->updateHeight();
}
void UpdaterWindow::loadMods(const std::string &dir,
diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h
index 56d72b197..f4d2a80f6 100644
--- a/src/gui/windows/updaterwindow.h
+++ b/src/gui/windows/updaterwindow.h
@@ -39,12 +39,12 @@
#include "listeners/actionlistener.h"
#include "listeners/keylistener.h"
-class BrowserBox;
class Button;
class ItemLinkHandler;
class Label;
class ProgressBar;
class ScrollArea;
+class StaticBrowserBox;
namespace Net
{
@@ -211,7 +211,7 @@ class UpdaterWindow final : public Window,
Button *mCancelButton A_NONNULLPOINTER;
Button *mPlayButton A_NONNULLPOINTER;
ProgressBar *mProgressBar A_NONNULLPOINTER;
- BrowserBox *mBrowserBox A_NONNULLPOINTER;
+ StaticBrowserBox *mBrowserBox A_NONNULLPOINTER;
ScrollArea *mScrollArea A_NONNULLPOINTER;
/** Status of the current download. */