diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-15 12:46:59 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-15 16:14:20 (GMT) |
commit | b89a87ca0d14d882250688260b21fb1567273b34 (patch) | |
tree | 6356303a5344c45ed75e28a77656adb38bd67d92 /src/gui/styles | |
parent | 1e123c84179f5be291e47178f81a37cbede8717e (diff) | |
download | Qt-b89a87ca0d14d882250688260b21fb1567273b34.zip Qt-b89a87ca0d14d882250688260b21fb1567273b34.tar.gz Qt-b89a87ca0d14d882250688260b21fb1567273b34.tar.bz2 |
Fixed painting issues with draggable tabs
This fixes a few of the remaining glitches tabbar animations have:
* We no longer grab tabs but paint them through QStyle. This makes tabs
work and animate correctly when they are outside the visible region.
* Buttons now correctly follow tabs when dropped
* Gtkstyle recieved some polish to make it look more native.
Task-number: 247694, 251166
Reviewed-by: nrc
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 519fed7..541415f 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -2760,10 +2760,13 @@ void QGtkStyle::drawControl(ControlElement element, if (tab->state & State_Selected) state = GTK_STATE_NORMAL; - bool first = tab->position == QStyleOptionTab::Beginning || tab->position == QStyleOptionTab::OnlyOneTab; - bool last = tab->position == QStyleOptionTab::End || tab->position == QStyleOptionTab::OnlyOneTab; bool selected = (tab->state & State_Selected); - if (option->direction == Qt::RightToLeft) { + bool first = false, last = false; + if (widget) { + // This is most accurate and avoids resizing tabs while moving + first = tab->rect.left() == widget->rect().left(); + last = tab->rect.right() == widget->rect().right(); + } else if (option->direction == Qt::RightToLeft) { bool tmp = first; first = last; last = tmp; |