|
|
|
@ -302,12 +302,6 @@ void UBDockPalette::showTabWidget(int tabIndex) |
|
|
|
|
mpStackWidget->setCurrentIndex(tabIndex); |
|
|
|
|
mCurrentTab = tabIndex; |
|
|
|
|
|
|
|
|
|
// Expand it if collapsed
|
|
|
|
|
if(mLastWidth != -1) |
|
|
|
|
{ |
|
|
|
|
toggleCollapseExpand(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Update the current tab index
|
|
|
|
|
if(NULL != (dynamic_cast<UBDockPaletteWidget*>(mpStackWidget->widget(tabIndex)))){ |
|
|
|
|
mCrntTabWidget = dynamic_cast<UBDockPaletteWidget*>(mpStackWidget->widget(tabIndex))->name(); |
|
|
|
@ -320,18 +314,12 @@ void UBDockPalette::showTabWidget(int tabIndex) |
|
|
|
|
*/ |
|
|
|
|
void UBDockPalette::toggleCollapseExpand() |
|
|
|
|
{ |
|
|
|
|
if(mLastWidth == -1) |
|
|
|
|
{ |
|
|
|
|
// The palette must be collapsed
|
|
|
|
|
if(width() < mCollapseWidth) |
|
|
|
|
resize(mLastWidth,height()); |
|
|
|
|
else{ |
|
|
|
|
mLastWidth = width(); |
|
|
|
|
resize(0,height()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// The palette will be expanded
|
|
|
|
|
resize(mLastWidth, height()); |
|
|
|
|
mLastWidth = -1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -703,7 +691,7 @@ void UBTabDockPalette::mouseMoveEvent(QMouseEvent *event) |
|
|
|
|
p.setX(p.x() + dock->width()); |
|
|
|
|
if(p.x() < dock->collapseWidth() && p.x() >= dock->minimumWidth()) { |
|
|
|
|
dock->resize(0, dock->height()); |
|
|
|
|
dock->mLastWidth = dock->collapseWidth() + 1; |
|
|
|
|
//dock->mLastWidth = dock->collapseWidth() + 1;
|
|
|
|
|
dock->mResized = true; |
|
|
|
|
} else if (p.x() <= dock->maximumWidth() && p.x() >= dock->minimumWidth()) { |
|
|
|
|
dock->resize(p.x(), dock->height()); |
|
|
|
@ -715,7 +703,7 @@ void UBTabDockPalette::mouseMoveEvent(QMouseEvent *event) |
|
|
|
|
p.setX(p.x() - 2 * dock->border()); |
|
|
|
|
if((dock->x() + p.x() > dock->parentWidget()->width() - dock->collapseWidth()) && (dock->x() + p.x() < dock->parentWidget()->width())) { |
|
|
|
|
dock->resize(0, dock->height()); |
|
|
|
|
dock->mLastWidth = dock->collapseWidth() + 1; |
|
|
|
|
//dock->mLastWidth = dock->collapseWidth() + 1;
|
|
|
|
|
dock->mResized = true; |
|
|
|
|
} else if((dock->x() + p.x() >= dock->parentWidget()->width() - dock->maximumWidth()) && (dock->x() + p.x() <= dock->parentWidget()->width() - dock->minimumWidth())) { |
|
|
|
|
dock->resize(dock->parentWidget()->width() - (dock->x() + p.x()), dock->height()); |
|
|
|
|