diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index 6f361ea0..3005b8b1 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -4,8 +4,11 @@ TEMPLATE = app THIRD_PARTY_PATH=../Sankore-ThirdParty CONFIG += debug_and_release \ - no_include_pwd \ - link_prl + no_include_pwd + +linux-g++-64 { + CONFIG += link_prl +} VERSION_MAJ = 1 VERSION_MIN = 40 diff --git a/src/board/UBBoardController.h b/src/board/UBBoardController.h index 2b17670b..7d722152 100644 --- a/src/board/UBBoardController.h +++ b/src/board/UBBoardController.h @@ -140,6 +140,7 @@ class UBBoardController : public QObject void setBoxing(QRect displayRect); void setToolbarTexts(); static QUrl expandWidgetToTempDir(const QByteArray& pZipedData, const QString& pExtension = QString("wgt")); +// static QRect freeRectInGlobalPos() const {return ;} void setPageSize(QSize newSize); UBBoardPaletteManager *paletteManager() { diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 35e8e1a5..db756be1 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -1027,3 +1027,27 @@ void UBBoardPaletteManager::stopDownloads() mRightPalette->removeTab(mpDownloadWidget->name()); } } + +QRect UBBoardPaletteManager::GetFreeRectGlobalCoords() const +{ + QPoint topLeft, bottomRight; + if (mLeftPalette) { + int x = mLeftPalette->getTabPaletteRect().topRight().x(); + int y = 0; + if (x || y) { + topLeft.setX(x); + topLeft.setY(y); + topLeft = mContainer->mapToGlobal(topLeft); + } + } + if (mRightPalette) { + int x = mRightPalette->getTabPaletteRect().topLeft().x(); + int y = mRightPalette->height(); + if (x || y) { + bottomRight.setX(x); + bottomRight.setY(y); + bottomRight = mContainer->mapToGlobal(bottomRight); + } + } + return QRect(topLeft, bottomRight); +} diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index 4cba1d4a..0dc4c2f9 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.h @@ -65,6 +65,7 @@ class UBBoardPaletteManager : public QObject void changeMode(eUBDockPaletteWidgetMode newMode, bool isInit = false); void startDownloads(); void stopDownloads(); + QRect GetFreeRectGlobalCoords() const; signals: void connectToDocController(); diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 12c0eb67..bd4b48b9 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -695,16 +695,20 @@ void UBLibraryController::addVideosToCurrentPage(const QList& videos) void UBLibraryController::addAudiosToCurrentPage(const QList& sounds) { - QPointF topLeftPos = visibleSceneRect().topLeft(); + QPointF centerPos = visibleSceneRect().center(); - QPointF pos = topLeftPos; + QPointF pos = centerPos; + + //move it a little higher for convenience + centerPos.setX(pos.x() - 200); + centerPos.setY(pos.y() - 100); foreach(const QUrl url, sounds) { mLastItemOffsetIndex++; mLastItemOffsetIndex = qMin(mLastItemOffsetIndex, 5); - pos = QPointF(topLeftPos.x() + 50 * mLastItemOffsetIndex, - topLeftPos.y() + 50 * mLastItemOffsetIndex); + pos = QPointF(centerPos.x() + 50 * mLastItemOffsetIndex, + centerPos.y() + 50 * mLastItemOffsetIndex); UBApplication::boardController->addAudio(url, false, pos); } }