[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/kmdi/kmdi
From: Sandro Giessl <sandro () giessl ! com>
Date: 2004-10-31 15:46:59
Message-ID: 20041031154659.8214616C66 () office ! kde ! org
[Download RAW message or body]
CVS commit by giessl:
Fix a bug in kate's KMDI tabbar: when the tabbar is hidden, hide _both_ corner
widgets, not just the Qt::TopRight one.
M +30 -14 tabwidget.cpp 1.7
M +1 -0 tabwidget.h 1.7
--- kdelibs/kmdi/kmdi/tabwidget.cpp #1.6:1.7
@@ -225,11 +225,10 @@ void TabWidget::maybeShow()
tabBar()->show();
- if (cornerWidget())
- {
+ // show/hide corner widgets
if (count() == 0)
- cornerWidget()->hide();
+ setCornerWidgetVisibility(false);
else
- cornerWidget()->show();
- }
+ setCornerWidgetVisibility(true);
+
break;
@@ -238,11 +237,10 @@ void TabWidget::maybeShow()
else tabBar()->show();
- if (cornerWidget())
- {
+ // show/hide corner widgets
if (count() < 2)
- cornerWidget()->hide();
+ setCornerWidgetVisibility(false);
else
- cornerWidget()->show();
- }
+ setCornerWidgetVisibility(true);
+
break;
@@ -253,4 +251,22 @@ void TabWidget::maybeShow()
}
+void TabWidget::setCornerWidgetVisibility(bool visible) {
+ // there are two corner widgets: on TopLeft and on TopTight!
+
+ if (cornerWidget(Qt::TopLeft) ) {
+ if (visible)
+ cornerWidget(Qt::TopLeft)->show();
+ else
+ cornerWidget(Qt::TopLeft)->hide();
+ }
+
+ if (cornerWidget(Qt::TopRight) ) {
+ if (visible)
+ cornerWidget(Qt::TopRight)->show();
+ else
+ cornerWidget(Qt::TopRight)->hide();
+ }
+}
+
void TabWidget::setTabWidgetVisibility( KMDI::TabWidgetVisibility visibility )
{
--- kdelibs/kmdi/kmdi/tabwidget.h #1.6:1.7
@@ -97,4 +97,5 @@ class TabWidget : public KTabWidget
private:
void maybeShow();
+ void setCornerWidgetVisibility(bool visible);
private:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic