mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
27 lines
504 B
C++
27 lines
504 B
C++
|
#include "maintabwidget.hh"
|
||
|
|
||
|
MainTabWidget::MainTabWidget( QWidget * parent) : QTabWidget( parent ) {
|
||
|
hideSingleTab = false;
|
||
|
}
|
||
|
|
||
|
void MainTabWidget::setHideSingleTab(bool hide)
|
||
|
{
|
||
|
hideSingleTab = hide;
|
||
|
updateTabBarVisibility();
|
||
|
}
|
||
|
|
||
|
void MainTabWidget::tabInserted(int index)
|
||
|
{
|
||
|
updateTabBarVisibility();
|
||
|
}
|
||
|
|
||
|
void MainTabWidget::tabRemoved(int index)
|
||
|
{
|
||
|
updateTabBarVisibility();
|
||
|
}
|
||
|
|
||
|
void MainTabWidget::updateTabBarVisibility()
|
||
|
{
|
||
|
tabBar()->setVisible( !hideSingleTab || tabBar()->count() > 1 );
|
||
|
}
|