Put the stylus palette horizontal and centered down the screen.

preferencesAboutTextFull
shibakaneki 14 years ago
parent e2fab2e09c
commit 0055bf395b
  1. 1
      src/board/UBBoardController.cpp
  2. 5
      src/board/UBBoardPaletteManager.cpp
  3. 1
      src/board/UBBoardPaletteManager.h
  4. 2
      src/core/UBSettings.cpp
  5. 4
      src/gui/UBFloatingPalette.h
  6. 22
      src/gui/UBStylusPalette.cpp
  7. 2
      src/gui/UBStylusPalette.h

@ -118,6 +118,7 @@ void UBBoardController::init()
UBDocumentProxy* doc = UBPersistenceManager::persistenceManager()->createDocument(); UBDocumentProxy* doc = UBPersistenceManager::persistenceManager()->createDocument();
setActiveDocumentScene(doc); setActiveDocumentScene(doc);
undoRedoStateChange(true); undoRedoStateChange(true);
} }

@ -92,6 +92,10 @@ UBBoardPaletteManager::~UBBoardPaletteManager()
} }
} }
void UBBoardPaletteManager::initPalettesPosAtStartup()
{
mStylusPalette->initPosition();
}
void UBBoardPaletteManager::setupLayout() void UBBoardPaletteManager::setupLayout()
{ {
@ -342,6 +346,7 @@ void UBBoardPaletteManager::containerResized()
mStylusPalette->move(userLeft, userTop); mStylusPalette->move(userLeft, userTop);
mStylusPalette->adjustSizeAndPosition(); mStylusPalette->adjustSizeAndPosition();
mStylusPalette->initPosition();
mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() mZoomPalette->move(userLeft + userWidth - mZoomPalette->width()
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); , userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height());

@ -37,6 +37,7 @@ class UBBoardPaletteManager : public QObject
void setupLayout(); void setupLayout();
UBNavigatorPalette* navigatorPalette(){return mNavigPalette;} UBNavigatorPalette* navigatorPalette(){return mNavigPalette;}
void showVirtualKeyboard(bool show = true); void showVirtualKeyboard(bool show = true);
void initPalettesPosAtStartup();
public slots: public slots:

@ -167,7 +167,7 @@ void UBSettings::init()
appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true); appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true);
appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true); appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", true);
appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true); appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true);
appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", true); appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false);
navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 300); navigPaletteWidth = new UBSetting(this, "Board", "NavigPaletteWidth", 300);
libPaletteWidth = new UBSetting(this, "Board", "LibPaletteWidth", 300); libPaletteWidth = new UBSetting(this, "Board", "LibPaletteWidth", 300);

@ -57,16 +57,16 @@ class UBFloatingPalette : public QWidget
bool mbGrip; bool mbGrip;
static const int sLayoutContentMargin = 12; static const int sLayoutContentMargin = 12;
static const int sLayoutSpacing = 15; static const int sLayoutSpacing = 15;
void moveInsideParent(const QPoint &position);
bool mCustomPosition;
private: private:
void moveInsideParent(const QPoint &position);
void removeAllAssociatedPalette(); void removeAllAssociatedPalette();
void minimizePalette(const QPoint& pos); void minimizePalette(const QPoint& pos);
QList<UBFloatingPalette*> mAssociatedPalette; QList<UBFloatingPalette*> mAssociatedPalette;
QPoint mDragPosition; QPoint mDragPosition;
bool mIsMoving; bool mIsMoving;
bool mCustomPosition;
bool mCanBeMinimized; bool mCanBeMinimized;
eMinimizedLocation mMinimizedLocation; eMinimizedLocation mMinimizedLocation;
Qt::Corner mDefaultPosition; Qt::Corner mDefaultPosition;

@ -57,6 +57,8 @@ UBStylusPalette::UBStylusPalette(QWidget *parent, Qt::Orientation orient)
adjustSizeAndPosition(); adjustSizeAndPosition();
initPosition();
foreach(const UBActionPaletteButton* button, mButtons) foreach(const UBActionPaletteButton* button, mButtons)
{ {
connect(button, SIGNAL(doubleClicked()), this, SLOT(stylusToolDoubleClicked())); connect(button, SIGNAL(doubleClicked()), this, SLOT(stylusToolDoubleClicked()));
@ -64,6 +66,26 @@ UBStylusPalette::UBStylusPalette(QWidget *parent, Qt::Orientation orient)
} }
void UBStylusPalette::initPosition()
{
if(!UBSettings::settings()->appToolBarOrientationVertical->get().toBool())
{
QWidget* pParentW = parentWidget();
if(NULL != pParentW)
{
mCustomPosition = true;
QPoint pos;
int parentWidth = pParentW->width();
int parentHeight = pParentW->height();
int posX = (parentWidth / 2) - (width() / 2);
int posY = parentHeight - border() - height();
pos.setX(posX);
pos.setY(posY);
moveInsideParent(pos);
}
}
}
UBStylusPalette::~UBStylusPalette() UBStylusPalette::~UBStylusPalette()
{ {

@ -15,6 +15,8 @@ class UBStylusPalette : public UBActionPalette
UBStylusPalette(QWidget *parent = 0, Qt::Orientation orient = Qt::Vertical); UBStylusPalette(QWidget *parent = 0, Qt::Orientation orient = Qt::Vertical);
virtual ~UBStylusPalette(); virtual ~UBStylusPalette();
void initPosition();
private slots: private slots:
void stylusToolDoubleClicked(); void stylusToolDoubleClicked();

Loading…
Cancel
Save