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