Commit e21fe803 authored by Clément Fauconnier's avatar Clément Fauconnier

simplified the moveTabs method

parent 231524d8
...@@ -500,31 +500,25 @@ void UBDockPalette::onAllDownloadsFinished() ...@@ -500,31 +500,25 @@ void UBDockPalette::onAllDownloadsFinished()
void UBDockPalette::moveTabs() void UBDockPalette::moveTabs()
{ {
// if (!mHTab) { int x = width();
if(eUBDockTabOrientation_Up == mTabsOrientation) { if (mOrientation == eUBDockOrientation_Right)
mHTab = border(); {
} else { if (parentWidget())
mHTab = height() - border() - mTabWidgets.size() * TABSIZE - (mTabWidgets.size() - 1) * tabSpacing(); x = parentWidget()->width() - width() - border() * 2;
} }
// }
QPoint origin(width(), mHTab + mTabPalette->mVerticalOffset);
switch (mOrientation) { int y = border();
case eUBDockOrientation_Left: if(eUBDockTabOrientation_Down == mTabsOrientation)
origin.setX(width()); {
break; if (mOrientation == eUBDockOrientation_Right)
case eUBDockOrientation_Right: y = parentWidget()->height() - border()- mTabWidgets.size() * TABSIZE;
if (parentWidget()) { else
origin.setX(parentWidget()->width() - width() - border() * 2); y = height() - border()- mTabWidgets.size() * TABSIZE;
origin.setY(parentWidget()->height() - border()- mTabWidgets.size() * TABSIZE);
}
break;
case eUBDockOrientation_Top: ;
case eUBDockOrientation_Bottom: ;
} }
mTabPalette->move(origin.x(), origin.y()); mHTab = y;
mTabPalette->move(x,y + mTabPalette->mVerticalOffset);
} }
void UBDockPalette::resizeTabs() void UBDockPalette::resizeTabs()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment