20 #include "katetabwidget.h"
21 #include "katetabwidget.moc"
27 KateTabWidget::KateTabWidget(TQWidget* parent,
const char* name)
28 : KTabWidget(parent,name)
29 , m_visibility (ShowWhenMoreThanOneTab)
33 setHoverCloseButton(
true);
35 connect(
this, TQ_SIGNAL(closeRequest(TQWidget*)),
this, TQ_SLOT(closeTab(TQWidget*)));
38 KateTabWidget::~KateTabWidget()
42 void KateTabWidget::closeTab(TQWidget* w)
47 void KateTabWidget::addTab ( TQWidget * child,
const TQString & label )
49 KTabWidget::addTab(child,label);
54 void KateTabWidget::addTab ( TQWidget * child,
const TQIconSet & iconset,
const TQString & label )
56 KTabWidget::addTab(child,iconset,label);
61 void KateTabWidget::addTab ( TQWidget * child, TQTab * tab )
63 KTabWidget::addTab(child,tab);
68 void KateTabWidget::insertTab ( TQWidget * child,
const TQString & label,
int index)
70 KTabWidget::insertTab(child,label,index);
76 void KateTabWidget::insertTab ( TQWidget * child,
const TQIconSet & iconset,
const TQString & label,
int index )
78 KTabWidget::insertTab(child,iconset,label,index);
84 void KateTabWidget::insertTab ( TQWidget * child, TQTab * tab,
int index)
86 KTabWidget::insertTab(child,tab,index);
92 void KateTabWidget::removePage ( TQWidget * w )
94 KTabWidget::removePage(w);
98 void KateTabWidget::maybeShow()
100 switch (m_visibility)
107 setCornerWidgetVisibility(
false);
109 setCornerWidgetVisibility(
true);
113 case ShowWhenMoreThanOneTab:
114 if (count()<2) tabBar()->hide();
115 else tabBar()->show();
119 setCornerWidgetVisibility(
false);
121 setCornerWidgetVisibility(
true);
131 void KateTabWidget::setCornerWidgetVisibility(
bool visible)
135 if (cornerWidget(TQt::TopLeft) ) {
137 cornerWidget(TQt::TopLeft)->show();
139 cornerWidget(TQt::TopLeft)->hide();
142 if (cornerWidget(TQt::TopRight) ) {
144 cornerWidget(TQt::TopRight)->show();
146 cornerWidget(TQt::TopRight)->hide();
150 void KateTabWidget::setTabWidgetVisibility( TabWidgetVisibility visibility )
152 m_visibility = visibility;
156 KateTabWidget::TabWidgetVisibility KateTabWidget::tabWidgetVisibility( )
const