|
|
@ -38,18 +38,18 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name): |
|
|
|
|
|
|
|
|
|
|
|
bool isCollapsed = false; |
|
|
|
bool isCollapsed = false; |
|
|
|
if(mCurrentMode == eUBDockPaletteWidget_BOARD){ |
|
|
|
if(mCurrentMode == eUBDockPaletteWidget_BOARD){ |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt(); |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt(); |
|
|
|
isCollapsed = UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool(); |
|
|
|
isCollapsed = UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool(); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt(); |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt(); |
|
|
|
isCollapsed = UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool(); |
|
|
|
isCollapsed = UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(isCollapsed) |
|
|
|
if(isCollapsed) |
|
|
|
resize(0,parentWidget()->height()); |
|
|
|
resize(0,parentWidget()->height()); |
|
|
|
else |
|
|
|
else |
|
|
|
resize(mLastWidth, parentWidget()->height()); |
|
|
|
resize(mLastWidth, parentWidget()->height()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -63,9 +63,11 @@ UBLeftPalette::~UBLeftPalette() |
|
|
|
|
|
|
|
|
|
|
|
void UBLeftPalette::onDocumentSet(UBDocumentProxy* documentProxy) |
|
|
|
void UBLeftPalette::onDocumentSet(UBDocumentProxy* documentProxy) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//This is necessary to force the teacher guide to be showed in priority each time a document is set
|
|
|
|
// //This is necessary to force the teacher guide to be showed in priority each time a document is set
|
|
|
|
if(documentProxy && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()) |
|
|
|
// if(documentProxy && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
|
|
|
|
mLastOpenedTabForMode.insert(eUBDockPaletteWidget_BOARD, 1); |
|
|
|
|
|
|
|
|
|
|
|
// the tab zero is forced
|
|
|
|
|
|
|
|
mLastOpenedTabForMode.insert(eUBDockPaletteWidget_BOARD, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -82,36 +84,36 @@ void UBLeftPalette::updateMaxWidth() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void UBLeftPalette::resizeEvent(QResizeEvent *event) |
|
|
|
void UBLeftPalette::resizeEvent(QResizeEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int newWidth = width(); |
|
|
|
int newWidth = width(); |
|
|
|
if(mCurrentMode == eUBDockPaletteWidget_BOARD){ |
|
|
|
if(mCurrentMode == eUBDockPaletteWidget_BOARD){ |
|
|
|
if(newWidth > mCollapseWidth) |
|
|
|
if(newWidth > mCollapseWidth) |
|
|
|
UBSettings::settings()->leftLibPaletteBoardModeWidth->set(newWidth); |
|
|
|
UBSettings::settings()->leftLibPaletteBoardModeWidth->set(newWidth); |
|
|
|
UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->set(newWidth == 0); |
|
|
|
UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->set(newWidth == 0); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
if(newWidth > mCollapseWidth) |
|
|
|
if(newWidth > mCollapseWidth) |
|
|
|
UBSettings::settings()->leftLibPaletteDesktopModeWidth->set(newWidth); |
|
|
|
UBSettings::settings()->leftLibPaletteDesktopModeWidth->set(newWidth); |
|
|
|
UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->set(newWidth == 0); |
|
|
|
UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->set(newWidth == 0); |
|
|
|
} |
|
|
|
} |
|
|
|
UBDockPalette::resizeEvent(event); |
|
|
|
UBDockPalette::resizeEvent(event); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool UBLeftPalette::switchMode(eUBDockPaletteWidgetMode mode) |
|
|
|
bool UBLeftPalette::switchMode(eUBDockPaletteWidgetMode mode) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int newModeWidth; |
|
|
|
int newModeWidth; |
|
|
|
if(mode == eUBDockPaletteWidget_BOARD){ |
|
|
|
if(mode == eUBDockPaletteWidget_BOARD){ |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt(); |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt(); |
|
|
|
newModeWidth = mLastWidth; |
|
|
|
newModeWidth = mLastWidth; |
|
|
|
if(UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool()) |
|
|
|
if(UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool()) |
|
|
|
newModeWidth = 0; |
|
|
|
newModeWidth = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt(); |
|
|
|
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt(); |
|
|
|
newModeWidth = mLastWidth; |
|
|
|
newModeWidth = mLastWidth; |
|
|
|
if(UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool()) |
|
|
|
if(UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool()) |
|
|
|
newModeWidth = 0; |
|
|
|
newModeWidth = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
resize(newModeWidth,height()); |
|
|
|
resize(newModeWidth,height()); |
|
|
|
return UBDockPalette::switchMode(mode); |
|
|
|
return UBDockPalette::switchMode(mode); |
|
|
|
} |
|
|
|
} |
|
|
|