From ac53fc94d5ea6e676c967ce871741ae580ccc1e9 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 6 Sep 2011 14:38:46 +0200 Subject: [PATCH 1/2] Fixed an issue related to the automatic resize of the left dock palette --- src/desktop/UBCustomCaptureWindow.cpp | 5 ++++- src/gui/UBLeftPalette.cpp | 24 ++++++++++++++++++++++-- src/gui/UBLeftPalette.h | 4 ++++ src/gui/UBPageNavigationWidget.cpp | 15 --------------- src/gui/UBPageNavigationWidget.h | 1 - src/gui/UBRightPalette.cpp | 1 - 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index 01af0461..8a21cdbc 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -62,7 +62,10 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap) showFullScreen(); setWindowOpacity(1.0); - return exec(); + qDebug() << ">>>>>>>>>>>>>< BEFORE"; + int retVal = exec(); + qDebug() << "------------------ AFTER"; + return retVal; } diff --git a/src/gui/UBLeftPalette.cpp b/src/gui/UBLeftPalette.cpp index 299e8494..2172eb2b 100644 --- a/src/gui/UBLeftPalette.cpp +++ b/src/gui/UBLeftPalette.cpp @@ -20,11 +20,16 @@ UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):UBDockPalette(pa setObjectName(name); setOrientation(eUBDockOrientation_Left); mLastWidth = 300; - setMaximumWidth(300); - resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), height()); + mCollapseWidth = 180; +/* + resize(UBSettings::settings()->libPaletteWidth->get().toInt(), parentWidget()->height()); + mpLayout->setContentsMargins(2*border() + customMargin(), customMargin(), customMargin(), customMargin()); +*/ + resize(UBSettings::settings()->navigPaletteWidth->get().toInt(), parentWidget()->height()); mpLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin()); + // Add the widgets here mpPageNavigator = new UBPageNavigationWidget(this); addTabWidget(mpPageNavigator); } @@ -38,6 +43,21 @@ UBLeftPalette::~UBLeftPalette() } } +void UBLeftPalette::updateMaxWidth() +{ + setMaximumWidth(300); +} + +void UBLeftPalette::resizeEvent(QResizeEvent *event) +{ + UBDockPalette::resizeEvent(event); + if(NULL != mpPageNavigator) + { + mpPageNavigator->setMinimumHeight(height() - 2*border()); + } + UBSettings::settings()->navigPaletteWidth->set(width()); +} + UBPageNavigationWidget* UBLeftPalette::pageNavigator() { return mpPageNavigator; diff --git a/src/gui/UBLeftPalette.h b/src/gui/UBLeftPalette.h index 61e0e1ce..a2f549ec 100644 --- a/src/gui/UBLeftPalette.h +++ b/src/gui/UBLeftPalette.h @@ -26,6 +26,10 @@ public: UBPageNavigationWidget* pageNavigator(); +protected: + void updateMaxWidth(); + void resizeEvent(QResizeEvent *event); + private: UBPageNavigationWidget* mpPageNavigator; diff --git a/src/gui/UBPageNavigationWidget.cpp b/src/gui/UBPageNavigationWidget.cpp index 6f598fd0..6d7896af 100644 --- a/src/gui/UBPageNavigationWidget.cpp +++ b/src/gui/UBPageNavigationWidget.cpp @@ -141,21 +141,6 @@ void UBPageNavigationWidget::refresh() mNavigator->setDocument(UBApplication::boardController->activeDocument()); } -/** - * \brief Handle the resize event - * @param event as the resize event - */ -void UBPageNavigationWidget::resizeEvent(QResizeEvent *event) -{ - emit resizeRequest(event); - //UBDockPalette::resizeEvent(event); - if(NULL != mNavigator) - { - mNavigator->setMinimumHeight(height() - 2*border()); - } - UBSettings::settings()->navigPaletteWidth->set(width()); -} - /** * \brief Notify a timer event * @param event as the timer event diff --git a/src/gui/UBPageNavigationWidget.h b/src/gui/UBPageNavigationWidget.h index 8f1ca723..ce4993bb 100644 --- a/src/gui/UBPageNavigationWidget.h +++ b/src/gui/UBPageNavigationWidget.h @@ -43,7 +43,6 @@ public slots: void setPageNumber(int current, int total); protected: - virtual void resizeEvent(QResizeEvent *event); virtual void timerEvent(QTimerEvent *event); private: diff --git a/src/gui/UBRightPalette.cpp b/src/gui/UBRightPalette.cpp index ee673ac8..b07a5ed8 100644 --- a/src/gui/UBRightPalette.cpp +++ b/src/gui/UBRightPalette.cpp @@ -23,7 +23,6 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):UBDockPalette( { setObjectName(name); setOrientation(eUBDockOrientation_Right); - setOrientation(eUBDockOrientation_Right); mCollapseWidth = 180; mLastWidth = 300; resize(UBSettings::settings()->libPaletteWidth->get().toInt(), parentWidget()->height()); From 3c3e8246cfc93fa1631a6ef869df8703a8db4d05 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Tue, 6 Sep 2011 14:57:15 +0200 Subject: [PATCH 2/2] Removed debug strings --- src/desktop/UBCustomCaptureWindow.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index 8a21cdbc..01af0461 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -62,10 +62,7 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap) showFullScreen(); setWindowOpacity(1.0); - qDebug() << ">>>>>>>>>>>>>< BEFORE"; - int retVal = exec(); - qDebug() << "------------------ AFTER"; - return retVal; + return exec(); }