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
64215876
Commit
64215876
authored
Mar 23, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed grips of palette issue. The position of the grip palette follow the menu bar position
parent
fde0d49d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
60 deletions
+23
-60
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+0
-36
UBBoardPaletteManager.h
src/board/UBBoardPaletteManager.h
+0
-1
UBDockPalette.cpp
src/gui/UBDockPalette.cpp
+12
-9
UBDockPalette.h
src/gui/UBDockPalette.h
+6
-9
UBLeftPalette.cpp
src/gui/UBLeftPalette.cpp
+5
-5
No files found.
src/board/UBBoardPaletteManager.cpp
View file @
64215876
...
...
@@ -908,18 +908,6 @@ void UBBoardPaletteManager::changeStylusPaletteOrientation(QVariant var)
mStylusPalette
->
setVisible
(
bVisible
);
// always show stylus palette at startup
}
/*
UBRightPalette* UBBoardPaletteManager::createDesktopRightPalette(QWidget* parent)
{
mpDesktopLibWidget = new UBLibWidget();
mDesktopRightPalette = new UBRightPalette(parent);
mDesktopRightPalette->registerWidget(mpDesktopLibWidget);
mDesktopRightPalette->addTabWidget(mpDesktopLibWidget);
mDesktopRightPalette->connectSignals();
return mDesktopRightPalette;
}
*/
void
UBBoardPaletteManager
::
connectToDocumentController
()
{
...
...
@@ -951,27 +939,3 @@ void UBBoardPaletteManager::stopDownloads()
mRightPalette
->
removeTab
(
mpDownloadWidget
);
}
}
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
);
}
src/board/UBBoardPaletteManager.h
View file @
64215876
...
...
@@ -63,7 +63,6 @@ class UBBoardPaletteManager : public QObject
void
changeMode
(
eUBDockPaletteWidgetMode
newMode
,
bool
isInit
=
false
);
void
startDownloads
();
void
stopDownloads
();
QRect
GetFreeRectGlobalCoords
()
const
;
signals
:
void
connectToDocController
();
...
...
src/gui/UBDockPalette.cpp
View file @
64215876
...
...
@@ -42,7 +42,7 @@ UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, co
,
mpLayout
(
NULL
)
,
mCurrentTab
(
0
)
,
mPaletteType
(
paletteType
)
,
mTabPalette
(
new
UBTabDockPalete
(
this
,
parent
))
,
mTabPalette
(
new
UBTabDockPalet
t
e
(
this
,
parent
))
{
setObjectName
(
name
);
...
...
@@ -346,6 +346,8 @@ void UBDockPalette::setTabsOrientation(eUBDockTabOrientation orientation)
/**
* \brief Update the tab position regarding the toolbar position (up or down)
*/
#include "board/UBBoardController.h"
#include "domain/UBGraphicsScene.h"
void
UBDockPalette
::
onToolbarPosUpdated
()
{
// Get the position of the tab
...
...
@@ -357,6 +359,7 @@ void UBDockPalette::onToolbarPosUpdated()
{
setTabsOrientation
(
eUBDockTabOrientation_Down
);
}
moveTabs
();
update
();
}
...
...
@@ -491,13 +494,13 @@ void UBDockPalette::onAllDownloadsFinished()
void
UBDockPalette
::
moveTabs
()
{
if
(
!
mHTab
)
{
//
if (!mHTab) {
if
(
eUBDockTabOrientation_Up
==
mTabsOrientation
)
{
mHTab
=
border
();
}
else
{
mHTab
=
height
()
-
border
()
-
mTabWidgets
.
size
()
*
TABSIZE
-
(
mTabWidgets
.
size
()
-
1
)
*
tabSpacing
();
}
}
//
}
QPoint
origin
(
width
(),
mHTab
+
mTabPalette
->
mVerticalOffset
);
...
...
@@ -572,7 +575,7 @@ bool UBDockPalette::switchMode(eUBDockPaletteWidgetMode mode)
}
UBTabDockPalet
e
::
UBTabDockPale
te
(
UBDockPalette
*
dockPalette
,
QWidget
*
parent
)
:
UBTabDockPalet
te
::
UBTabDockPalet
te
(
UBDockPalette
*
dockPalette
,
QWidget
*
parent
)
:
QWidget
(
parent
)
,
dock
(
dockPalette
)
,
mVerticalOffset
(
0
)
...
...
@@ -584,7 +587,7 @@ UBTabDockPalete::UBTabDockPalete(UBDockPalette *dockPalette, QWidget *parent) :
setAttribute
(
Qt
::
WA_TranslucentBackground
);
}
void
UBTabDockPalete
::
paintEvent
(
QPaintEvent
*
)
void
UBTabDockPalet
t
e
::
paintEvent
(
QPaintEvent
*
)
{
int
nTabs
=
dock
->
mTabWidgets
.
size
();
if
(
nTabs
<=
0
)
{
...
...
@@ -654,11 +657,11 @@ void UBTabDockPalete::paintEvent(QPaintEvent *)
painter
.
restore
();
}
}
UBTabDockPalet
e
::~
UBTabDockPale
te
()
UBTabDockPalet
te
::~
UBTabDockPalet
te
()
{
}
void
UBTabDockPalete
::
mousePressEvent
(
QMouseEvent
*
event
)
void
UBTabDockPalet
t
e
::
mousePressEvent
(
QMouseEvent
*
event
)
{
dock
->
mClickTime
=
QTime
::
currentTime
();
// The goal here is to verify if the user can resize the widget.
...
...
@@ -684,7 +687,7 @@ void UBTabDockPalete::mousePressEvent(QMouseEvent *event)
break
;
}
}
void
UBTabDockPalete
::
mouseMoveEvent
(
QMouseEvent
*
event
)
void
UBTabDockPalet
t
e
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
QPoint
p
=
event
->
pos
();
...
...
@@ -735,7 +738,7 @@ void UBTabDockPalete::mouseMoveEvent(QMouseEvent *event)
}
}
}
void
UBTabDockPalete
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
void
UBTabDockPalet
t
e
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
Q_UNUSED
(
event
);
if
(
!
dock
->
mResized
&&
dock
->
mClickTime
.
elapsed
()
<
CLICKTIME
)
{
...
...
src/gui/UBDockPalette.h
View file @
64215876
...
...
@@ -32,7 +32,7 @@
#include "UBDockPaletteWidget.h"
#define TABSIZE 50 //Height of the tab of the palette
#define CLICKTIME 1000000 //Clicktime to expand or collapse paltte
#define CLICKTIME 1000000 //Clicktime to expand or collapse pal
e
tte
/**
* \brief The dock positions
...
...
@@ -53,15 +53,15 @@ typedef enum
class
UBDockPalette
;
class
UBTabDockPalete
:
public
QWidget
class
UBTabDockPalet
t
e
:
public
QWidget
{
Q_OBJECT
friend
class
UBDockPalette
;
public
:
UBTabDockPalete
(
UBDockPalette
*
dockPalette
,
QWidget
*
parent
=
0
);
~
UBTabDockPalete
();
UBTabDockPalet
t
e
(
UBDockPalette
*
dockPalette
,
QWidget
*
parent
=
0
);
~
UBTabDockPalet
t
e
();
protected
:
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
...
...
@@ -87,7 +87,7 @@ typedef enum
class
UBDockPalette
:
public
QWidget
{
Q_OBJECT
friend
class
UBTabDockPalete
;
friend
class
UBTabDockPalet
t
e
;
public
:
UBDockPalette
(
eUBDockPaletteType
paletteType
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBDockPalette"
);
...
...
@@ -102,9 +102,6 @@ public:
virtual
void
assignParent
(
QWidget
*
widget
);
virtual
void
setVisible
(
bool
visible
);
// virtual void mouseMoveEvent(QMouseEvent *event);
// virtual void mousePressEvent(QMouseEvent *event);
// virtual void mouseReleaseEvent(QMouseEvent *event);
virtual
void
paintEvent
(
QPaintEvent
*
event
);
virtual
void
enterEvent
(
QEvent
*
);
virtual
void
leaveEvent
(
QEvent
*
);
...
...
@@ -192,7 +189,7 @@ private:
private
:
eUBDockPaletteType
mPaletteType
;
UBTabDockPalete
*
mTabPalette
;
UBTabDockPalet
t
e
*
mTabPalette
;
};
#endif // UBDOCKPALETTE_H
src/gui/UBLeftPalette.cpp
View file @
64215876
...
...
@@ -23,13 +23,13 @@
UBLeftPalette
::
UBLeftPalette
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPalette
(
eUBDockPaletteType_LEFT
,
parent
)
{
setObjectName
(
name
);
setOrientation
(
eUBDockOrientation_Left
);
setObjectName
(
name
);
setOrientation
(
eUBDockOrientation_Left
);
mLastWidth
=
UBSettings
::
settings
()
->
leftLibPaletteWidth
->
get
().
toInt
();
mCollapseWidth
=
150
;
mLastWidth
=
UBSettings
::
settings
()
->
leftLibPaletteWidth
->
get
().
toInt
();
mCollapseWidth
=
150
;
resize
(
mLastWidth
,
parentWidget
()
->
height
());
resize
(
mLastWidth
,
parentWidget
()
->
height
());
}
/**
...
...
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