diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bb716597..556d4023d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,8 @@ set(APP_VERSION "2.0.0-prealpha-2")
set(APP_AUTHOR "Martin Rotter")
set(APP_URL "http://rssguard.sf.net")
+option(USE_QT_5 "Use Qt 5 for building" OFF)
+
message(STATUS "[${APP_LOW_NAME}] Welcome to ${APP_NAME} compilation process.")
message(STATUS "[${APP_LOW_NAME}] Compilation process begins right now.")
diff --git a/src/gui/formsettings.cpp b/src/gui/formsettings.cpp
index 680dbcb21..b4009466d 100644
--- a/src/gui/formsettings.cpp
+++ b/src/gui/formsettings.cpp
@@ -452,6 +452,9 @@ void FormSettings::loadInterface() {
m_ui->m_checkNewTabDoubleClick->setChecked(settings->value(APP_CFG_GUI,
"tab_new_double_button",
true).toBool());
+ m_ui->m_hideTabBarIfOneTabVisible->setChecked(settings->value(APP_CFG_GUI,
+ "hide_tabbar_one_tab",
+ true).toBool());
}
void FormSettings::saveInterface() {
@@ -489,4 +492,6 @@ void FormSettings::saveInterface() {
m_ui->m_checkCloseTabsDoubleClick->isChecked());
settings->setValue(APP_CFG_GUI, "tab_new_double_button",
m_ui->m_checkNewTabDoubleClick->isChecked());
+ settings->setValue(APP_CFG_GUI, "hide_tabbar_one_tab",
+ m_ui->m_hideTabBarIfOneTabVisible->isChecked());
}
diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui
index 223c8a38f..29b2aca7d 100644
--- a/src/gui/formsettings.ui
+++ b/src/gui/formsettings.ui
@@ -69,8 +69,8 @@
0
0
- 585
- 368
+ 100
+ 30
@@ -115,7 +115,7 @@
QTabWidget::North
- 0
+ 2
@@ -189,6 +189,11 @@
false
+
+
+ 1
+
+
-
@@ -334,6 +339,13 @@
+ -
+
+
+ Hide tab bar if just one tab is visible
+
+
+
diff --git a/src/gui/tabwidget.cpp b/src/gui/tabwidget.cpp
index 5adc7d44e..ec471ba96 100644
--- a/src/gui/tabwidget.cpp
+++ b/src/gui/tabwidget.cpp
@@ -27,6 +27,19 @@ void TabWidget::setupCornerButton() {
setCornerWidget(m_cornerButton);
}
+void TabWidget::tabInserted(int index) {
+ QTabWidget::tabInserted(index);
+
+ // TODO: Opravit tento řádek, aby se korektně tabbar skrýval a objevoval atp.
+ tabBar()->setVisible(count() > 1 && Settings::getInstance()->value(APP_CFG_GUI,
+ "hide_tabbar_one_tab",
+ true).toBool());
+}
+
+void TabWidget::tabRemoved(int index) {
+ QTabWidget::tabRemoved(index);
+}
+
void TabWidget::createConnections() {
connect(m_cornerButton, SIGNAL(clicked()), this, SLOT(addEmptyBrowser()));
connect(tabBar(), SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
diff --git a/src/gui/tabwidget.h b/src/gui/tabwidget.h
index 9a7ef01fd..e246c2dfb 100644
--- a/src/gui/tabwidget.h
+++ b/src/gui/tabwidget.h
@@ -46,6 +46,9 @@ class TabWidget : public QTabWidget {
// Sets up properties of custom corner button.
void setupCornerButton();
+
+ void tabInserted(int index);
+ void tabRemoved(int index);
public slots:
void fixContentAfterIndexChange(int from);