Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
6c8c9843
Commit
6c8c9843
authored
Mar 21, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
left and right dock palette remember their own width
parent
f5287497
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
208 deletions
+17
-208
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+0
-10
UBSettings.cpp
src/core/UBSettings.cpp
+2
-1
UBSettings.h
src/core/UBSettings.h
+2
-1
UBDockPalette.cpp
src/gui/UBDockPalette.cpp
+2
-184
UBLeftPalette.cpp
src/gui/UBLeftPalette.cpp
+6
-7
UBLibraryWidget.cpp
src/gui/UBLibraryWidget.cpp
+0
-1
UBRightPalette.cpp
src/gui/UBRightPalette.cpp
+5
-4
No files found.
src/board/UBBoardPaletteManager.cpp
View file @
6c8c9843
...
...
@@ -229,9 +229,6 @@ void UBBoardPaletteManager::setupPalettes()
mKeyboardPalette
=
new
UBKeyboardPalette
(
0
);
#ifndef Q_WS_WIN
connect
(
mKeyboardPalette
,
SIGNAL
(
closed
()),
mKeyboardPalette
,
SLOT
(
onDeactivated
()));
#endif
#ifndef Q_WS_MAC
// mKeyboardPalette->setParent(mContainer);
#endif
}
...
...
@@ -764,13 +761,6 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
emit
signal_changeMode
(
newMode
);
}
/*
void UBBoardPaletteManager::slot_changeMode(eUBDockPaletteWidgetMode newMode)
{
emit signal_changeMode(newMode);
}
*/
void
UBBoardPaletteManager
::
addItem
(
const
QPixmap
&
pPixmap
,
const
QPointF
&
pos
,
qreal
scaleFactor
,
const
QUrl
&
sourceUrl
)
{
mItemUrl
=
sourceUrl
;
...
...
src/core/UBSettings.cpp
View file @
6c8c9843
...
...
@@ -205,7 +205,8 @@ void UBSettings::init()
appEnableSoftwareUpdates
=
new
UBSetting
(
this
,
"App"
,
"EnableSoftwareUpdates"
,
true
);
appToolBarOrientationVertical
=
new
UBSetting
(
this
,
"App"
,
"ToolBarOrientationVertical"
,
false
);
navigPaletteWidth
=
new
UBSetting
(
this
,
"Board"
,
"NavigPaletteWidth"
,
270
);
libPaletteWidth
=
new
UBSetting
(
this
,
"Board"
,
"LibPaletteWidth"
,
270
);
rightLibPaletteWidth
=
new
UBSetting
(
this
,
"Board"
,
"RightLibPaletteWidth"
,
270
);
leftLibPaletteWidth
=
new
UBSetting
(
this
,
"Board"
,
"LeftLibPaletteWidth"
,
270
);
appIsInSoftwareUpdateProcess
=
new
UBSetting
(
this
,
"App"
,
"IsInSoftwareUpdateProcess"
,
false
);
appLastSessionDocumentUUID
=
new
UBSetting
(
this
,
"App"
,
"LastSessionDocumentUUID"
,
""
);
...
...
src/core/UBSettings.h
View file @
6c8c9843
...
...
@@ -315,7 +315,8 @@ class UBSettings : public QObject
UBSetting
*
soundThumbnailWidth
;
UBSetting
*
navigPaletteWidth
;
UBSetting
*
libPaletteWidth
;
UBSetting
*
rightLibPaletteWidth
;
UBSetting
*
leftLibPaletteWidth
;
UBSetting
*
communityUser
;
UBSetting
*
communityPsw
;
...
...
src/gui/UBDockPalette.cpp
View file @
6c8c9843
...
...
@@ -56,7 +56,7 @@ UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, co
mTabWidgets
.
clear
();
// We let 2 pixels in order to keep a small border for the resizing
setMinimumWidth
(
/*2*border() + 2*/
0
);
setMinimumWidth
(
0
);
if
(
parent
)
{
...
...
@@ -131,138 +131,6 @@ void UBDockPalette::setOrientation(eUBDockOrientation orientation)
}
}
/**
* \brief Handle the mouse move event
* @param as the mouse event
*/
//void UBDockPalette::mouseMoveEvent(QMouseEvent *event)
//{
// QPoint p = event->pos();
// if(mCanResize && ((mMousePressPos - p).manhattanLength() > QApplication::startDragDistance()))
// {
// switch(mOrientation)
// {
// case eUBDockOrientation_Left:
// if(p.x() < collapseWidth() && p.x() >= minimumWidth())
// {
// resize(border(), height());
// mLastWidth = collapseWidth() + 1;
// mResized = true;
// }
// else if(p.x() <= maximumWidth() && p.x() >= minimumWidth())
// {
// resize(p.x(), height());
// mResized = true;
// }
// break;
// case eUBDockOrientation_Right:
// if((this->x() + p.x() > parentWidget()->width() - collapseWidth()) && (this->x() + p.x() < parentWidget()->width()))
// {
// resize(border(), height());
// mLastWidth = collapseWidth() + 1;
// mResized = true;
// }
// else if((this->x() + p.x() >= parentWidget()->width() - maximumWidth()) && (this->x() + p.x() <= parentWidget()->width() - this->minimumWidth()))
// {
// resize(parentWidget()->width() - (this->x() + p.x()), height());
// mResized = true;
// }
// break;
// case eUBDockOrientation_Top:
// case eUBDockOrientation_Bottom:
// if(p.y() <= maximumHeight())
// {
// resize(width(), p.y());
// mResized = true;
// }
// break;
// default:
// break;
// }
// }
//}
/**
* \brief Handle the mouse press event
* @param as the mouse event
*/
//void UBDockPalette::mousePressEvent(QMouseEvent *event)
//{
// mClickTime = QTime::currentTime();
// // The goal here is to verify if the user can resize the widget.
// // It is only possible to resize it if the border is selected
// QPoint p = event->pos();
// mMousePressPos = p;
// mResized = false;
// switch(mOrientation)
// {
// case eUBDockOrientation_Left:
// if((p.x() >= width() - 2 * border()) && (p.x() <= width()))
// {
// mCanResize = true;
// }
// break;
// case eUBDockOrientation_Right:
// if((p.x() >= 0) && (p.x() <= 2 * border()))
// {
// mCanResize = true;
// }
// break;
// case eUBDockOrientation_Top:
// // Not supported yet
// break;
// case eUBDockOrientation_Bottom:
// // Not supported yet
// break;
// default:
// break;
// }
//}
/**
* \brief Handle the mouse release event
* @param event as the mouse event
*/
//void UBDockPalette::mouseReleaseEvent(QMouseEvent *event)
//{
// Q_UNUSED(event);
// if(!mResized && mClickTime.elapsed() < CLICKTIME)
// {
// int nbTabs = mTabWidgets.size();
// int clickedTab = 0;
// // If the clicked position is in the tab, perform the related action
// if(eUBDockOrientation_Left == mOrientation)
// {
// if(mMousePressPos.x() >= width() - 2*border() &&
// mMousePressPos.y() >= mHTab &&
// mMousePressPos.x() <= width() &&
// mMousePressPos.y() <= mHTab + nbTabs*TABSIZE + (nbTabs -1)*tabSpacing())
// {
// clickedTab = (mMousePressPos.y() - mHTab)/(TABSIZE+tabSpacing());
// tabClicked(clickedTab);
// }
// }
// else if(eUBDockOrientation_Right == mOrientation)
// {
// if(mMousePressPos.x() >= 0 &&
// mMousePressPos.x() <= 2*border() &&
// mMousePressPos.y() >= mHTab &&
// mMousePressPos.y() <= mHTab + nbTabs*TABSIZE + (nbTabs -1)*tabSpacing())
// {
// clickedTab = (mMousePressPos.y() - mHTab)/(TABSIZE+tabSpacing());
// tabClicked(clickedTab);
// }
// }
// }
// mCanResize = false;
//}
/**
* \brief Handle the resize event
* @param event as the resize event
...
...
@@ -356,52 +224,6 @@ void UBDockPalette::paintEvent(QPaintEvent *event)
mHTab
=
height
()
-
border
()
-
nbTabs
*
TABSIZE
-
(
nbTabs
-
1
)
*
tabSpacing
();
}
painter
.
drawPath
(
path
);
// for(int i = 0; i < mTabWidgets.size(); i++)
// {
// UBDockPaletteWidget* pCrntWidget = mTabWidgets.at(i);
// if(NULL != pCrntWidget)
// {
// if(mOrientation == eUBDockOrientation_Left)
// {
// path.addRoundedRect(width()-4*border(), mHTab + i*TABSIZE + i*tabSpacing(), 4*border(), TABSIZE, radius(), radius());
// painter.drawPath(path);
// QPixmap iconPixmap;
// if(mCollapseWidth >= width())
// {
// // Get the collapsed icon
// iconPixmap = pCrntWidget->iconToRight();
// }
// else
// {
// // Get the expanded icon
// iconPixmap = pCrntWidget->iconToLeft();
// }
// painter.drawPixmap(width() - 2*border() + 1, mHTab + i*TABSIZE + i*tabSpacing() + 1 , 2*border() - 4, TABSIZE - 2, iconPixmap);
// }
// else if(mOrientation == eUBDockOrientation_Right)
// {
// path.addRoundedRect(0.0, mHTab + i*TABSIZE + i*tabSpacing(), 4*border(), TABSIZE, radius(), radius());
// painter.drawPath(path);
// QPixmap iconPixmap;
// if(mCollapseWidth >= width())
// {
// // Get the collapsed icon
// iconPixmap = pCrntWidget->iconToLeft();
// }
// else
// {
// // Get the expanded icon
// iconPixmap = pCrntWidget->iconToRight();
// }
// painter.drawPixmap(2, mHTab + i*TABSIZE + i*tabSpacing() + 1, 2*border() - 4, TABSIZE - 2, iconPixmap);
// }
// else
// {
// painter.drawRoundedRect(border(), border(), width() - 2 * border(), height() - 2 * border(), radius(), radius());
// }
// }
// }
}
}
...
...
@@ -758,12 +580,11 @@ UBTabDockPalete::UBTabDockPalete(UBDockPalette *dockPalette, QWidget *parent) :
{
int
numTabs
=
dock
->
mTabWidgets
.
size
();
resize
(
2
*
dock
->
border
(),
(
numTabs
*
TABSIZE
)
+
qMax
(
numTabs
-
1
,
0
)
*
dock
->
tabSpacing
());
// move(dock->width(), 20);
setAttribute
(
Qt
::
WA_TranslucentBackground
);
}
void
UBTabDockPalete
::
paintEvent
(
QPaintEvent
*
/
*
event
*/
)
void
UBTabDockPalete
::
paintEvent
(
QPaintEvent
*
)
{
int
nTabs
=
dock
->
mTabWidgets
.
size
();
if
(
nTabs
<=
0
)
{
...
...
@@ -945,6 +766,3 @@ void UBTabDockPalete::mouseReleaseEvent(QMouseEvent *event)
dock
->
mCanResize
=
false
;
}
src/gui/UBLeftPalette.cpp
View file @
6c8c9843
...
...
@@ -23,14 +23,13 @@
UBLeftPalette
::
UBLeftPalette
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPalette
(
eUBDockPaletteType_LEFT
,
parent
)
{
setObjectName
(
name
);
setOrientation
(
eUBDockOrientation_Left
);
mLastWidth
=
270
;
mCollapseWidth
=
150
;
setObjectName
(
name
);
setOrientation
(
eUBDockOrientation_Left
);
resize
(
UBSettings
::
settings
()
->
navigPaletteWidth
->
get
().
toInt
(),
parentWidget
()
->
height
()
);
// mpLayout->setContentsMargins(customMargin(), customMargin(), 2*border() + customMargin(), customMargin())
;
mLastWidth
=
UBSettings
::
settings
()
->
leftLibPaletteWidth
->
get
().
toInt
(
);
mCollapseWidth
=
150
;
resize
(
mLastWidth
,
parentWidget
()
->
height
());
}
/**
...
...
@@ -55,6 +54,6 @@ void UBLeftPalette::updateMaxWidth()
*/
void
UBLeftPalette
::
resizeEvent
(
QResizeEvent
*
event
)
{
UBSettings
::
settings
()
->
leftLibPaletteWidth
->
set
(
width
());
UBDockPalette
::
resizeEvent
(
event
);
// UBSettings::settings()->navigPaletteWidth->set(width());
}
src/gui/UBLibraryWidget.cpp
View file @
6c8c9843
...
...
@@ -91,7 +91,6 @@ void UBLibraryWidget::init()
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
onSelectionChanged
()));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
addDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
)),
this
,
SLOT
(
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
)));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
displayMetadata
(
QMap
<
QString
,
QString
>
)),
this
,
SLOT
(
onDisplayMetadata
(
QMap
<
QString
,
QString
>
)));
connect
(
mLibraryController
,
SIGNAL
(
updateItemsList
()),
this
,
SLOT
(
onRefreshCurrentFolder
()));
}
...
...
src/gui/UBRightPalette.cpp
View file @
6c8c9843
...
...
@@ -27,10 +27,11 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):
{
setObjectName
(
name
);
setOrientation
(
eUBDockOrientation_Right
);
mLastWidth
=
UBSettings
::
settings
()
->
rightLibPaletteWidth
->
get
().
toInt
();
mCollapseWidth
=
150
;
mLastWidth
=
270
;
resize
(
UBSettings
::
settings
()
->
libPaletteWidth
->
get
().
toInt
(),
parentWidget
()
->
height
());
// mpLayout->setContentsMargins(2*border() + customMargin(), customMargin(), customMargin(), customMargin());
resize
(
mLastWidth
,
parentWidget
()
->
height
());
}
/**
...
...
@@ -59,7 +60,7 @@ void UBRightPalette::mouseMoveEvent(QMouseEvent *event)
void
UBRightPalette
::
resizeEvent
(
QResizeEvent
*
event
)
{
UBDockPalette
::
resizeEvent
(
event
);
UBSettings
::
settings
()
->
l
ibPaletteWidth
->
set
(
width
());
UBSettings
::
settings
()
->
rightL
ibPaletteWidth
->
set
(
width
());
emit
resized
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment