Commit d822dc73 authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Merge branch 'Sankore-1.40' of github.com:Sankore/Sankore-3.1 into Sankore-1.40

parents 0180df1b 51467d47
...@@ -206,7 +206,9 @@ void UBSettings::init() ...@@ -206,7 +206,9 @@ void UBSettings::init()
appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false); appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false);
navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 270); navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 270);
rightLibPaletteWidth = new UBSetting(this, "Board", "RightLibPaletteWidth", 270); rightLibPaletteWidth = new UBSetting(this, "Board", "RightLibPaletteWidth", 270);
rightLibPaletteIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteIsCollapsed",false);
leftLibPaletteWidth = new UBSetting(this, "Board", "LeftLibPaletteWidth",270); leftLibPaletteWidth = new UBSetting(this, "Board", "LeftLibPaletteWidth",270);
leftLibPaletteIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteIsCollapsed",false);
appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false); appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false);
appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", ""); appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", "");
......
...@@ -316,7 +316,9 @@ class UBSettings : public QObject ...@@ -316,7 +316,9 @@ class UBSettings : public QObject
UBSetting* navigPaletteWidth; UBSetting* navigPaletteWidth;
UBSetting* rightLibPaletteWidth; UBSetting* rightLibPaletteWidth;
UBSetting* rightLibPaletteIsCollapsed;
UBSetting* leftLibPaletteWidth; UBSetting* leftLibPaletteWidth;
UBSetting* leftLibPaletteIsCollapsed;
UBSetting* communityUser; UBSetting* communityUser;
UBSetting* communityPsw; UBSetting* communityPsw;
......
This diff is collapsed.
...@@ -29,7 +29,10 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name): ...@@ -29,7 +29,10 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):
mLastWidth = UBSettings::settings()->leftLibPaletteWidth->get().toInt(); mLastWidth = UBSettings::settings()->leftLibPaletteWidth->get().toInt();
mCollapseWidth = 150; mCollapseWidth = 150;
resize(mLastWidth, parentWidget()->height()); if(UBSettings::settings()->leftLibPaletteIsCollapsed->get().toBool())
resize(0,parentWidget()->height());
else
resize(mLastWidth, parentWidget()->height());
} }
/** /**
...@@ -54,6 +57,9 @@ void UBLeftPalette::updateMaxWidth() ...@@ -54,6 +57,9 @@ void UBLeftPalette::updateMaxWidth()
*/ */
void UBLeftPalette::resizeEvent(QResizeEvent *event) void UBLeftPalette::resizeEvent(QResizeEvent *event)
{ {
UBSettings::settings()->leftLibPaletteWidth->set(width()); int newWidth = width();
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteIsCollapsed->set(newWidth == 0);
UBDockPalette::resizeEvent(event); UBDockPalette::resizeEvent(event);
} }
...@@ -33,8 +33,6 @@ UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name): ...@@ -33,8 +33,6 @@ UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name):
{ {
setOrientation(eUBDockOrientation_Left); setOrientation(eUBDockOrientation_Left);
setMaximumWidth(300); setMaximumWidth(300);
//mCollapsedIcon = QPixmap(":images/pages_open.png");
//mIcon = QPixmap(":images/pages_close.png");
resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), height()); resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), height());
mLastWidth = 300; mLastWidth = 300;
......
...@@ -27,11 +27,13 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name): ...@@ -27,11 +27,13 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):
{ {
setObjectName(name); setObjectName(name);
setOrientation(eUBDockOrientation_Right); setOrientation(eUBDockOrientation_Right);
mLastWidth = UBSettings::settings()->rightLibPaletteWidth->get().toInt();
mCollapseWidth = 150; mCollapseWidth = 150;
resize(mLastWidth, parentWidget()->height()); mLastWidth = UBSettings::settings()->rightLibPaletteWidth->get().toInt();
if(UBSettings::settings()->rightLibPaletteIsCollapsed->get().toBool())
resize(0,parentWidget()->height());
else
resize(mLastWidth, parentWidget()->height());
} }
/** /**
...@@ -59,8 +61,11 @@ void UBRightPalette::mouseMoveEvent(QMouseEvent *event) ...@@ -59,8 +61,11 @@ void UBRightPalette::mouseMoveEvent(QMouseEvent *event)
*/ */
void UBRightPalette::resizeEvent(QResizeEvent *event) void UBRightPalette::resizeEvent(QResizeEvent *event)
{ {
int newWidth = width();
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteIsCollapsed->set(newWidth == 0);
UBDockPalette::resizeEvent(event); UBDockPalette::resizeEvent(event);
UBSettings::settings()->rightLibPaletteWidth->set(width());
emit resized(); emit resized();
} }
......
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