fixed issue 622

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 346b693c58
commit b42afc9e6d
  1. 12
      src/core/UBSettings.cpp
  2. 12
      src/core/UBSettings.h
  3. 1
      src/gui/UBDockPalette.cpp
  4. 2
      src/gui/UBDockPalette.h
  5. 47
      src/gui/UBLeftPalette.cpp
  6. 2
      src/gui/UBLeftPalette.h
  7. 47
      src/gui/UBRightPalette.cpp
  8. 2
      src/gui/UBRightPalette.h

@ -204,10 +204,14 @@ void UBSettings::init()
appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true);
appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true);
appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false);
rightLibPaletteWidth = new UBSetting(this, "Board", "RightLibPaletteWidth", 270);
rightLibPaletteIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteIsCollapsed",false);
leftLibPaletteWidth = new UBSetting(this, "Board", "LeftLibPaletteWidth",270);
leftLibPaletteIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteIsCollapsed",false);
rightLibPaletteBoardModeWidth = new UBSetting(this, "Board", "RightLibPaletteBoardModeWidth", 270);
rightLibPaletteBoardModeIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteBoardModeIsCollapsed",false);
rightLibPaletteDesktopModeWidth = new UBSetting(this, "Board", "RightLibPaletteDesktopModeWidth", 270);
rightLibPaletteDesktopModeIsCollapsed = new UBSetting(this,"Board", "RightLibPaletteDesktopModeIsCollapsed",false);
leftLibPaletteBoardModeWidth = new UBSetting(this, "Board", "LeftLibPaletteBoardModeWidth",270);
leftLibPaletteBoardModeIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteBoardModeIsCollapsed",false);
leftLibPaletteDesktopModeWidth = new UBSetting(this, "Board", "LeftLibPaletteDesktopModeWidth",270);
leftLibPaletteDesktopModeIsCollapsed = new UBSetting(this,"Board","LeftLibPaletteDesktopModeIsCollapsed",false);
appIsInSoftwareUpdateProcess = new UBSetting(this, "App", "IsInSoftwareUpdateProcess", false);
appLastSessionDocumentUUID = new UBSetting(this, "App", "LastSessionDocumentUUID", "");

@ -314,10 +314,14 @@ class UBSettings : public QObject
UBSetting* gipThumbnailWidth;
UBSetting* soundThumbnailWidth;
UBSetting* rightLibPaletteWidth;
UBSetting* rightLibPaletteIsCollapsed;
UBSetting* leftLibPaletteWidth;
UBSetting* leftLibPaletteIsCollapsed;
UBSetting* rightLibPaletteBoardModeWidth;
UBSetting* rightLibPaletteBoardModeIsCollapsed;
UBSetting* rightLibPaletteDesktopModeWidth;
UBSetting* rightLibPaletteDesktopModeIsCollapsed;
UBSetting* leftLibPaletteBoardModeWidth;
UBSetting* leftLibPaletteBoardModeIsCollapsed;
UBSetting* leftLibPaletteDesktopModeWidth;
UBSetting* leftLibPaletteDesktopModeIsCollapsed;
UBSetting* communityUser;
UBSetting* communityPsw;

@ -531,6 +531,7 @@ void UBDockPalette::setVisible(bool visible)
bool UBDockPalette::switchMode(eUBDockPaletteWidgetMode mode)
{
mCurrentMode = mode;
bool hasVisibleElements = false;
//-------------------------------//
// get full palette widgets list, parse it, show all widgets for BOARD mode, and hide all other

@ -115,6 +115,8 @@ public:
bool switchMode(eUBDockPaletteWidgetMode mode);
eUBDockPaletteWidgetMode mCurrentMode;
QVector<UBDockPaletteWidget*> GetWidgetsList() { return mRegisteredWidgets; }
public:

@ -25,11 +25,19 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):
{
setObjectName(name);
setOrientation(eUBDockOrientation_Left);
mLastWidth = UBSettings::settings()->leftLibPaletteWidth->get().toInt();
mCollapseWidth = 150;
if(UBSettings::settings()->leftLibPaletteIsCollapsed->get().toBool())
bool isCollapsed = false;
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool();
}
else{
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool();
}
if(isCollapsed)
resize(0,parentWidget()->height());
else
resize(mLastWidth, parentWidget()->height());
@ -58,8 +66,35 @@ void UBLeftPalette::updateMaxWidth()
void UBLeftPalette::resizeEvent(QResizeEvent *event)
{
int newWidth = width();
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteIsCollapsed->set(newWidth == 0);
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->leftLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
UBDockPalette::resizeEvent(event);
}
bool UBLeftPalette::switchMode(eUBDockPaletteWidgetMode mode)
{
int newModeWidth;
if(mode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->leftLibPaletteBoardModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->leftLibPaletteBoardModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
else{
mLastWidth = UBSettings::settings()->leftLibPaletteDesktopModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->leftLibPaletteDesktopModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
resize(newModeWidth,height());
return UBDockPalette::switchMode(mode);
}

@ -23,6 +23,8 @@ public:
UBLeftPalette(QWidget* parent=0, const char* name="UBLeftPalette");
~UBLeftPalette();
bool switchMode(eUBDockPaletteWidgetMode mode);
protected:
void updateMaxWidth();
void resizeEvent(QResizeEvent *event);

@ -28,9 +28,16 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):
setObjectName(name);
setOrientation(eUBDockOrientation_Right);
mCollapseWidth = 150;
mLastWidth = UBSettings::settings()->rightLibPaletteWidth->get().toInt();
if(UBSettings::settings()->rightLibPaletteIsCollapsed->get().toBool())
bool isCollapsed = false;
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool();
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool();
}
if(isCollapsed)
resize(0,parentWidget()->height());
else
resize(mLastWidth, parentWidget()->height());
@ -62,10 +69,17 @@ void UBRightPalette::mouseMoveEvent(QMouseEvent *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);
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
UBDockPalette::resizeEvent(event);
emit resized();
}
@ -78,3 +92,22 @@ void UBRightPalette::updateMaxWidth()
setMaximumHeight(parentWidget()->height());
setMinimumHeight(parentWidget()->height());
}
bool UBRightPalette::switchMode(eUBDockPaletteWidgetMode mode)
{
int newModeWidth;
if(mode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
resize(newModeWidth,height());
return UBDockPalette::switchMode(mode);
}

@ -23,6 +23,7 @@ class UBRightPalette : public UBDockPalette
public:
UBRightPalette(QWidget* parent=0, const char* name="UBRightPalette");
~UBRightPalette();
bool switchMode(eUBDockPaletteWidgetMode mode);
signals:
void resized();
@ -31,6 +32,7 @@ protected:
void updateMaxWidth();
void mouseMoveEvent(QMouseEvent *event);
void resizeEvent(QResizeEvent *event);
};
#endif // UBRIGHTPALETTE_H

Loading…
Cancel
Save