Fixed progress bar weirdness.

This commit is contained in:
Martin Rotter 2015-08-01 10:55:03 +02:00
parent e02bd3c8e6
commit 5cab25bbda
3 changed files with 12 additions and 6 deletions

View file

@ -23,6 +23,7 @@
</ul> </ul>
Fixed: Fixed:
<ul> <ul>
<li>Size of downloaded website artifacts is now not hidden by progress bar.</li>
<li>Auto-updating of feeds fixed, error was due to master mutex double locking. (issue #117)</li> <li>Auto-updating of feeds fixed, error was due to master mutex double locking. (issue #117)</li>
<li>Fixed some memory leaks which might appear when adding/editing categories/feeds.</li> <li>Fixed some memory leaks which might appear when adding/editing categories/feeds.</li>
<ul> <ul>

View file

@ -131,6 +131,9 @@ void WebBrowser::initializeLayout() {
m_toolBar->addAction(act_discover); m_toolBar->addAction(act_discover);
m_toolBar->addWidget(m_txtLocation); m_toolBar->addWidget(m_txtLocation);
m_loadingWidget = new QWidget(this);
m_loadingWidget->setFixedHeight(15);
// Initialize dynamic progress bar which will be displayed // Initialize dynamic progress bar which will be displayed
// at the bottom of web browser. // at the bottom of web browser.
m_lblProgress = new QLabel(this); m_lblProgress = new QLabel(this);
@ -143,22 +146,23 @@ void WebBrowser::initializeLayout() {
m_loadingLayout = new QHBoxLayout(); m_loadingLayout = new QHBoxLayout();
m_loadingLayout->setMargin(0); m_loadingLayout->setMargin(0);
m_loadingLayout->addWidget(m_lblProgress, 0, Qt::AlignLeft | Qt::AlignVCenter); m_loadingLayout->addWidget(m_lblProgress, 0, Qt::AlignVCenter);
m_loadingProgress->setLayout(m_loadingLayout); m_loadingLayout->addWidget(m_loadingProgress, 1, Qt::AlignVCenter);
m_loadingWidget->setLayout(m_loadingLayout);
// Setup layout. // Setup layout.
m_layout->addWidget(m_toolBar); m_layout->addWidget(m_toolBar);
m_layout->addWidget(m_webView); m_layout->addWidget(m_webView);
m_layout->addWidget(m_loadingProgress); m_layout->addWidget(m_loadingWidget);
m_layout->setMargin(0); m_layout->setMargin(0);
m_layout->setSpacing(0); m_layout->setSpacing(0);
m_loadingProgress->hide(); m_loadingWidget->hide();
} }
void WebBrowser::onLoadingStarted() { void WebBrowser::onLoadingStarted() {
m_loadingProgress->setValue(0); m_loadingProgress->setValue(0);
m_loadingProgress->show(); m_loadingWidget->show();
} }
void WebBrowser::onLoadingProgress(int progress) { void WebBrowser::onLoadingProgress(int progress) {
@ -176,7 +180,7 @@ void WebBrowser::onLoadingFinished(bool success) {
m_btnDiscoverFeeds->clearFeedAddresses(); m_btnDiscoverFeeds->clearFeedAddresses();
} }
m_loadingProgress->hide(); m_loadingWidget->hide();
} }
void WebBrowser::createConnections() { void WebBrowser::createConnections() {

View file

@ -157,6 +157,7 @@ class WebBrowser : public TabContent {
LocationLineEdit *m_txtLocation; LocationLineEdit *m_txtLocation;
QWidget *m_zoomButtons; QWidget *m_zoomButtons;
QToolButton *m_btnResetZoom; QToolButton *m_btnResetZoom;
QWidget *m_loadingWidget;
QHBoxLayout *m_loadingLayout; QHBoxLayout *m_loadingLayout;
QProgressBar *m_loadingProgress; QProgressBar *m_loadingProgress;
QLabel *m_lblProgress; QLabel *m_lblProgress;