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()
void UBDockPalette::moveTabs()
{
// if (!mHTab) {
if(eUBDockTabOrientation_Up == mTabsOrientation) {
mHTab = border();
} else {
mHTab = height() - border() - mTabWidgets.size() * TABSIZE - (mTabWidgets.size() - 1) * tabSpacing();
int x = width();
if (mOrientation == eUBDockOrientation_Right)
{
if (parentWidget())
x = parentWidget()->width() - width() - border() * 2;
}
// }
QPoint origin(width(), mHTab + mTabPalette->mVerticalOffset);
switch (mOrientation) {
case eUBDockOrientation_Left:
origin.setX(width());
break;
case eUBDockOrientation_Right:
if (parentWidget()) {
origin.setX(parentWidget()->width() - width() - border() * 2);
origin.setY(parentWidget()->height() - border()- mTabWidgets.size() * TABSIZE);
}
break;
case eUBDockOrientation_Top: ;
case eUBDockOrientation_Bottom: ;
int y = border();
if(eUBDockTabOrientation_Down == mTabsOrientation)
{
if (mOrientation == eUBDockOrientation_Right)
y = parentWidget()->height() - border()- mTabWidgets.size() * TABSIZE;
else
y = height() - border()- mTabWidgets.size() * TABSIZE;
}
mTabPalette->move(origin.x(), origin.y());
mHTab = y;
mTabPalette->move(x,y + mTabPalette->mVerticalOffset);
}
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