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
50d136f8
Commit
50d136f8
authored
Sep 10, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SANKORE-1077
Desktop mode is broken SANKORE-633 Positioning of floating palettes inside layers .
parent
1a799632
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
58 additions
and
21 deletions
+58
-21
UBApplication.cpp
src/core/UBApplication.cpp
+5
-1
UBApplicationController.cpp
src/core/UBApplicationController.cpp
+6
-3
UBApplicationController.h
src/core/UBApplicationController.h
+2
-1
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+4
-2
UBDesktopAnnotationController.h
src/desktop/UBDesktopAnnotationController.h
+2
-2
UBDesktopPalette.cpp
src/desktop/UBDesktopPalette.cpp
+17
-3
UBDesktopPalette.h
src/desktop/UBDesktopPalette.h
+9
-3
UBGraphicsItemUndoCommand.cpp
src/domain/UBGraphicsItemUndoCommand.cpp
+4
-4
UBFloatingPalette.cpp
src/gui/UBFloatingPalette.cpp
+7
-2
UBFloatingPalette.h
src/gui/UBFloatingPalette.h
+2
-0
No files found.
src/core/UBApplication.cpp
View file @
50d136f8
...
...
@@ -316,7 +316,11 @@ int UBApplication::exec(const QString& pFileToImport)
UBDrawingController
::
drawingController
()
->
setStylusTool
((
int
)
UBStylusTool
::
Pen
);
applicationController
=
new
UBApplicationController
(
boardController
->
controlView
(),
boardController
->
displayView
(),
mainWindow
,
staticMemoryCleaner
);
applicationController
=
new
UBApplicationController
(
boardController
->
controlView
(),
boardController
->
displayView
(),
mainWindow
,
staticMemoryCleaner
,
boardController
->
paletteManager
()
->
rightPalette
());
connect
(
applicationController
,
SIGNAL
(
mainModeChanged
(
UBApplicationController
::
MainMode
)),
...
...
src/core/UBApplicationController.cpp
View file @
50d136f8
...
...
@@ -59,8 +59,11 @@
#include "core/memcheck.h"
UBApplicationController
::
UBApplicationController
(
UBBoardView
*
pControlView
,
UBBoardView
*
pDisplayView
,
UBMainWindow
*
pMainWindow
,
QObject
*
parent
)
UBApplicationController
::
UBApplicationController
(
UBBoardView
*
pControlView
,
UBBoardView
*
pDisplayView
,
UBMainWindow
*
pMainWindow
,
QObject
*
parent
,
UBRightPalette
*
rightPalette
)
:
QObject
(
parent
)
,
mMainWindow
(
pMainWindow
)
,
mControlView
(
pControlView
)
...
...
@@ -75,7 +78,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
{
mDisplayManager
=
new
UBDisplayManager
(
this
);
mUninoteController
=
new
UBDesktopAnnotationController
(
this
);
mUninoteController
=
new
UBDesktopAnnotationController
(
this
,
rightPalette
);
connect
(
mDisplayManager
,
SIGNAL
(
screenLayoutChanged
()),
this
,
SLOT
(
screenLayoutChanged
()));
connect
(
mDisplayManager
,
SIGNAL
(
screenLayoutChanged
()),
mUninoteController
,
SLOT
(
screenLayoutChanged
()));
...
...
src/core/UBApplicationController.h
View file @
50d136f8
...
...
@@ -31,6 +31,7 @@ class UBSoftwareUpdate;
class
QNetworkAccessManager
;
class
QNetworkReply
;
class
QHttp
;
class
UBRightPalette
;
class
UBApplicationController
:
public
QObject
...
...
@@ -39,7 +40,7 @@ class UBApplicationController : public QObject
public
:
UBApplicationController
(
UBBoardView
*
pControlView
,
UBBoardView
*
pDisplayView
,
UBMainWindow
*
pMainWindow
,
QObject
*
parent
=
0
);
UBApplicationController
(
UBBoardView
*
pControlView
,
UBBoardView
*
pDisplayView
,
UBMainWindow
*
pMainWindow
,
QObject
*
parent
,
UBRightPalette
*
rightPalette
);
virtual
~
UBApplicationController
();
int
initialHScroll
()
{
return
mInitialHScroll
;
}
...
...
src/desktop/UBDesktopAnnotationController.cpp
View file @
50d136f8
...
...
@@ -47,7 +47,7 @@
#include "core/memcheck.h"
UBDesktopAnnotationController
::
UBDesktopAnnotationController
(
QObject
*
parent
)
UBDesktopAnnotationController
::
UBDesktopAnnotationController
(
QObject
*
parent
,
UBRightPalette
*
rightPalette
)
:
QObject
(
parent
)
,
mTransparentDrawingView
(
0
)
,
mTransparentDrawingScene
(
0
)
...
...
@@ -86,7 +86,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView
->
setScene
(
mTransparentDrawingScene
);
mTransparentDrawingScene
->
setDrawingMode
(
true
);
mDesktopPalette
=
new
UBDesktopPalette
(
NULL
);
// FIX #633: The palette must be 'floating' in order to stay on top of the library palette
mDesktopPalette
=
new
UBDesktopPalette
(
mTransparentDrawingView
,
rightPalette
);
// This was not fix, parent reverted
// FIX #633: The palette must be 'floating' in order to stay on top of the library palette
if
(
UBPlatformUtils
::
hasVirtualKeyboard
())
{
...
...
src/desktop/UBDesktopAnnotationController.h
View file @
50d136f8
...
...
@@ -29,8 +29,8 @@ class UBDesktopPenPalette;
class
UBDesktopMarkerPalette
;
class
UBDesktopEraserPalette
;
class
UBActionPalette
;
//class UBKeyboardPalette;
class
UBMainWindow
;
class
UBRightPalette
;
#define PROPERTY_PALETTE_TIMER 1000
...
...
@@ -47,7 +47,7 @@ class UBDesktopAnnotationController : public QObject
Q_OBJECT
;
public
:
UBDesktopAnnotationController
(
QObject
*
parent
=
0
);
UBDesktopAnnotationController
(
QObject
*
parent
,
UBRightPalette
*
rightPalette
);
virtual
~
UBDesktopAnnotationController
();
void
showWindow
();
void
hideWindow
();
...
...
src/desktop/UBDesktopPalette.cpp
View file @
50d136f8
...
...
@@ -21,10 +21,11 @@
#include "core/memcheck.h"
UBDesktopPalette
::
UBDesktopPalette
(
QWidget
*
parent
)
UBDesktopPalette
::
UBDesktopPalette
(
QWidget
*
parent
,
UBRightPalette
*
_rightPalette
)
:
UBActionPalette
(
Qt
::
TopLeftCorner
,
parent
)
,
mShowHideAction
(
0
)
,
mDisplaySelectAction
(
0
)
,
rightPalette
(
_rightPalette
)
,
mShowHideAction
(
0
)
,
mDisplaySelectAction
(
0
)
{
QList
<
QAction
*>
actions
;
...
...
@@ -72,6 +73,8 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent)
connect
(
this
,
SIGNAL
(
maximizeStart
()),
this
,
SLOT
(
maximizeMe
()));
connect
(
this
,
SIGNAL
(
minimizeStart
(
eMinimizedLocation
)),
this
,
SLOT
(
minimizeMe
(
eMinimizedLocation
)));
setMinimizePermission
(
true
);
connect
(
rightPalette
,
SIGNAL
(
resized
()),
this
,
SLOT
(
parentResized
()));
}
...
...
@@ -217,3 +220,14 @@ QPoint UBDesktopPalette::buttonPos(QAction *action)
return
p
;
}
int
UBDesktopPalette
::
getParentWidth
(
QWidget
*
parent
)
{
return
parent
->
width
()
-
rightPalette
->
width
();
}
void
UBDesktopPalette
::
parentResized
()
{
moveInsideParent
(
pos
());
}
\ No newline at end of file
src/desktop/UBDesktopPalette.h
View file @
50d136f8
...
...
@@ -12,6 +12,7 @@
#include <QHideEvent>
#include "gui/UBActionPalette.h"
#include "gui/UBRightPalette.h"
/**
* The uninotes window. This window is controlled by UBUninotesWindowController.
...
...
@@ -21,7 +22,7 @@ class UBDesktopPalette : public UBActionPalette
Q_OBJECT
;
public
:
UBDesktopPalette
(
QWidget
*
parent
=
0
);
UBDesktopPalette
(
QWidget
*
parent
,
UBRightPalette
*
rightPalette
);
virtual
~
UBDesktopPalette
();
void
disappearForCapture
();
...
...
@@ -41,17 +42,19 @@ class UBDesktopPalette : public UBActionPalette
public
slots
:
void
showHideClick
(
bool
checked
);
void
updateShowHideState
(
bool
pShowEnabled
);
void
setShowHideButtonVisible
(
bool
visible
);
void
setDisplaySelectButtonVisible
(
bool
show
);
void
minimizeMe
(
eMinimizedLocation
location
);
void
minimizeMe
(
eMinimizedLocation
location
);
void
maximizeMe
();
void
parentResized
();
protected
:
void
showEvent
(
QShowEvent
*
event
);
void
hideEvent
(
QHideEvent
*
event
);
int
getParentWidth
(
QWidget
*
parent
);
private
:
QAction
*
mShowHideAction
;
QAction
*
mDisplaySelectAction
;
...
...
@@ -60,6 +63,9 @@ protected:
QAction
*
mActionCustomSelect
;
QAction
*
mActionTest
;
UBRightPalette
*
rightPalette
;
signals
:
void
stylusToolChanged
(
int
tool
);
...
...
src/domain/UBGraphicsItemUndoCommand.cpp
View file @
50d136f8
...
...
@@ -112,8 +112,8 @@ void UBGraphicsItemUndoCommand::undo()
}
QMapIterator
<
UBGraphicsGroupContainerItem
*
,
QUuid
>
curMapElement
(
mExcludedFromGroup
);
UBGraphicsGroupContainerItem
*
nextGroup
=
0
;
UBGraphicsGroupContainerItem
*
previousGroupItem
;
UBGraphicsGroupContainerItem
*
nextGroup
=
NULL
;
UBGraphicsGroupContainerItem
*
previousGroupItem
=
NULL
;
bool
groupChanged
=
false
;
while
(
curMapElement
.
hasNext
())
{
...
...
@@ -157,8 +157,8 @@ void UBGraphicsItemUndoCommand::redo()
}
QMapIterator
<
UBGraphicsGroupContainerItem
*
,
QUuid
>
curMapElement
(
mExcludedFromGroup
);
UBGraphicsGroupContainerItem
*
nextGroup
=
0
;
UBGraphicsGroupContainerItem
*
previousGroupItem
;
UBGraphicsGroupContainerItem
*
nextGroup
=
NULL
;
UBGraphicsGroupContainerItem
*
previousGroupItem
=
NULL
;
bool
groupChanged
=
false
;
while
(
curMapElement
.
hasNext
())
{
...
...
src/gui/UBFloatingPalette.cpp
View file @
50d136f8
...
...
@@ -129,6 +129,11 @@ void UBFloatingPalette::mouseReleaseEvent(QMouseEvent *event)
}
}
int
UBFloatingPalette
::
getParentWidth
(
QWidget
*
parent
)
{
return
parent
->
width
();
}
void
UBFloatingPalette
::
moveInsideParent
(
const
QPoint
&
position
)
{
QWidget
*
parent
=
parentWidget
();
...
...
@@ -136,7 +141,7 @@ void UBFloatingPalette::moveInsideParent(const QPoint &position)
if
(
parent
)
{
int
margin
=
UBSettings
::
boardMargin
-
border
();
qreal
newX
=
qMax
(
margin
,
qMin
(
parent
->
width
(
)
-
width
()
-
margin
,
position
.
x
()));
qreal
newX
=
qMax
(
margin
,
qMin
(
getParentWidth
(
parent
)
-
width
()
-
margin
,
position
.
x
()));
qreal
newY
=
qMax
(
margin
,
qMin
(
parent
->
height
()
-
height
()
-
margin
,
position
.
y
()));
if
(
!
mCustomPosition
&&
!
mIsMoving
)
...
...
@@ -147,7 +152,7 @@ void UBFloatingPalette::moveInsideParent(const QPoint &position)
}
else
{
newX
=
qMax
(
margin
,
parent
->
width
(
)
-
width
()
-
margin
);
newX
=
qMax
(
margin
,
getParentWidth
(
parent
)
-
width
()
-
margin
);
}
}
move
(
newX
,
newY
);
...
...
src/gui/UBFloatingPalette.h
View file @
50d136f8
...
...
@@ -63,6 +63,8 @@ class UBFloatingPalette : public QWidget
bool
mCustomPosition
;
bool
mIsMoving
;
virtual
int
getParentWidth
(
QWidget
*
parent
);
private
:
void
removeAllAssociatedPalette
();
void
minimizePalette
(
const
QPoint
&
pos
);
...
...
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