simplified the moveTabs method

preferencesAboutTextFull
Clément Fauconnier 6 years ago
parent 231524d887
commit e21fe80331
  1. 36
      src/gui/UBDockPalette.cpp

@ -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()
{ {

Loading…
Cancel
Save