This commit is contained in:
Martin Rotter 2013-11-09 08:48:13 +01:00
parent 075aaf34d8
commit 8274369575
5 changed files with 38 additions and 3 deletions

View file

@ -9,6 +9,8 @@ set(APP_VERSION "2.0.0-prealpha-2")
set(APP_AUTHOR "Martin Rotter") set(APP_AUTHOR "Martin Rotter")
set(APP_URL "http://rssguard.sf.net") 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}] Welcome to ${APP_NAME} compilation process.")
message(STATUS "[${APP_LOW_NAME}] Compilation process begins right now.") message(STATUS "[${APP_LOW_NAME}] Compilation process begins right now.")

View file

@ -452,6 +452,9 @@ void FormSettings::loadInterface() {
m_ui->m_checkNewTabDoubleClick->setChecked(settings->value(APP_CFG_GUI, m_ui->m_checkNewTabDoubleClick->setChecked(settings->value(APP_CFG_GUI,
"tab_new_double_button", "tab_new_double_button",
true).toBool()); true).toBool());
m_ui->m_hideTabBarIfOneTabVisible->setChecked(settings->value(APP_CFG_GUI,
"hide_tabbar_one_tab",
true).toBool());
} }
void FormSettings::saveInterface() { void FormSettings::saveInterface() {
@ -489,4 +492,6 @@ void FormSettings::saveInterface() {
m_ui->m_checkCloseTabsDoubleClick->isChecked()); m_ui->m_checkCloseTabsDoubleClick->isChecked());
settings->setValue(APP_CFG_GUI, "tab_new_double_button", settings->setValue(APP_CFG_GUI, "tab_new_double_button",
m_ui->m_checkNewTabDoubleClick->isChecked()); m_ui->m_checkNewTabDoubleClick->isChecked());
settings->setValue(APP_CFG_GUI, "hide_tabbar_one_tab",
m_ui->m_hideTabBarIfOneTabVisible->isChecked());
} }

View file

@ -69,8 +69,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>585</width> <width>100</width>
<height>368</height> <height>30</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
@ -115,7 +115,7 @@
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="m_tabIconSkin"> <widget class="QWidget" name="m_tabIconSkin">
<attribute name="title"> <attribute name="title">
@ -189,6 +189,11 @@
<property name="expandsOnDoubleClick"> <property name="expandsOnDoubleClick">
<bool>false</bool> <bool>false</bool>
</property> </property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
@ -334,6 +339,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="m_hideTabBarIfOneTabVisible">
<property name="text">
<string>Hide tab bar if just one tab is visible</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View file

@ -27,6 +27,19 @@ void TabWidget::setupCornerButton() {
setCornerWidget(m_cornerButton); 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() { void TabWidget::createConnections() {
connect(m_cornerButton, SIGNAL(clicked()), this, SLOT(addEmptyBrowser())); connect(m_cornerButton, SIGNAL(clicked()), this, SLOT(addEmptyBrowser()));
connect(tabBar(), SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); connect(tabBar(), SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));

View file

@ -47,6 +47,9 @@ class TabWidget : public QTabWidget {
// Sets up properties of custom corner button. // Sets up properties of custom corner button.
void setupCornerButton(); void setupCornerButton();
void tabInserted(int index);
void tabRemoved(int index);
public slots: public slots:
void fixContentAfterIndexChange(int from); void fixContentAfterIndexChange(int from);
void fixContentsAfterMove(int from, int to); void fixContentsAfterMove(int from, int to);