From 7f62d2e602563bcd77b4ae2015d36f18ac366ca3 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 20 Oct 2012 11:31:45 +0200 Subject: [PATCH] Option to hide Reload/Stop buttons in navigation bar closes #615 --- src/lib/app/qupzilla.cpp | 17 ++++++++------- src/lib/navigation/navigationbar.h | 1 + src/lib/preferences/preferences.cpp | 2 ++ src/lib/preferences/preferences.ui | 32 +++++++++++++++++------------ 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 7fff1cae1..b58a3195e 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -57,6 +57,7 @@ #include "webinspectordockwidget.h" #include "bookmarksimportdialog.h" #include "globalfunctions.h" +#include "reloadstopbutton.h" #include "enhancedmenu.h" #include "settings.h" #include "webtab.h" @@ -568,13 +569,14 @@ void QupZilla::loadSettings() //Browser Window settings settings.beginGroup("Browser-View-Settings"); bool showStatusBar = settings.value("showStatusBar", true).toBool(); - bool showHomeIcon = settings.value("showHomeButton", true).toBool(); + bool showReloadButton = settings.value("showReloadButton", true).toBool(); + bool showHomeButton = settings.value("showHomeButton", true).toBool(); + bool showBackForwardButtons = settings.value("showBackForwardButtons", true).toBool(); + bool showAddTabButton = settings.value("showAddTabButton", false).toBool(); bool showWebSearchBar = settings.value("showWebSearchBar", true).toBool(); - bool showBackForwardIcons = settings.value("showBackForwardButtons", true).toBool(); bool showBookmarksToolbar = settings.value("showBookmarksToolbar", true).toBool(); bool showNavigationToolbar = settings.value("showNavigationToolbar", true).toBool(); bool showMenuBar = settings.value("showMenubar", true).toBool(); - bool showAddTab = settings.value("showAddTabButton", false).toBool(); bool makeTransparent = settings.value("useTransparentBackground", false).toBool(); m_sideBarWidth = settings.value("SideBarWidth", 250).toInt(); m_webViewWidth = settings.value("WebViewWidth", 2000).toInt(); @@ -592,11 +594,12 @@ void QupZilla::loadSettings() #ifndef Q_OS_MAC m_navigationBar->buttonSuperMenu()->setVisible(!showMenuBar); #endif - m_navigationBar->buttonHome()->setVisible(showHomeIcon); - m_navigationBar->buttonBack()->setVisible(showBackForwardIcons); - m_navigationBar->buttonNext()->setVisible(showBackForwardIcons); + m_navigationBar->buttonReloadStop()->setVisible(showReloadButton); + m_navigationBar->buttonHome()->setVisible(showHomeButton); + m_navigationBar->buttonBack()->setVisible(showBackForwardButtons); + m_navigationBar->buttonNext()->setVisible(showBackForwardButtons); m_navigationBar->searchLine()->setVisible(showWebSearchBar); - m_navigationBar->buttonAddTab()->setVisible(showAddTab); + m_navigationBar->buttonAddTab()->setVisible(showAddTabButton); m_sideBarManager->showSideBar(activeSideBar, false); diff --git a/src/lib/navigation/navigationbar.h b/src/lib/navigation/navigationbar.h index 0c5ef7a57..ab558c5da 100644 --- a/src/lib/navigation/navigationbar.h +++ b/src/lib/navigation/navigationbar.h @@ -49,6 +49,7 @@ public: inline ToolButton* buttonAddTab() { return m_buttonAddTab; } inline ToolButton* buttonSuperMenu() { return m_supMenu; } inline ToolButton* buttonExitFullscreen() { return m_exitFullscreen; } + inline ReloadStopButton* buttonReloadStop() { return m_reloadStop; } inline WebSearchBar* searchLine() { return m_searchLine; } inline QSplitter* splitter() { return m_navigationSplitter; } diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index c77c4d977..70fd400d0 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -167,6 +167,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent) ui->showHome->setChecked(settings.value("showHomeButton", true).toBool()); ui->showBackForward->setChecked(settings.value("showBackForwardButtons", true).toBool()); ui->showAddTabButton->setChecked(settings.value("showAddTabButton", false).toBool()); + ui->showReloadStopButtons->setChecked(settings.value("showReloadButton", true).toBool()); ui->showWebSearchBar->setChecked(settings.value("showWebSearchBar", true).toBool()); ui->useTransparentBg->setChecked(settings.value("useTransparentBackground", false).toBool()); int currentSettingsPage = settings.value("settingsDialogPage", 0).toInt(0); @@ -791,6 +792,7 @@ void Preferences::saveSettings() settings.setValue("showWebSearchBar", ui->showWebSearchBar->isChecked()); settings.setValue("useTransparentBackground", ui->useTransparentBg->isChecked()); settings.setValue("showAddTabButton", ui->showAddTabButton->isChecked()); + settings.setValue("showReloadButton", ui->showReloadStopButtons->isChecked()); settings.endGroup(); //TABS diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 21da75d0f..aef718ec0 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -547,28 +547,21 @@ - + Show Back / Forward buttons - - - - Show Add Tab button - - - - + <b>Background<b/> - + Qt::Vertical @@ -581,20 +574,34 @@ - + Use transparent background - + Show web search bar + + + + Show Add Tab button + + + + + + + Show Reload / Stop buttons + + + @@ -2461,7 +2468,6 @@ showStatusbar useTransparentBg showNavigationToolbar - showAddTabButton pagesInCache showHome showBookmarksToolbar