diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-15 12:46:59 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-15 13:09:31 (GMT) |
commit | ea5991e330282a5b18301d653ccb5a7d960a7db5 (patch) | |
tree | 567992ef6e72fad1f9ba0f252fbb4e09e50a067c /src/gui/styles | |
parent | ba6ad129f2dc9d7dd5cbd511c3fe515908f5f6a8 (diff) | |
download | Qt-ea5991e330282a5b18301d653ccb5a7d960a7db5.zip Qt-ea5991e330282a5b18301d653ccb5a7d960a7db5.tar.gz Qt-ea5991e330282a5b18301d653ccb5a7d960a7db5.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; |