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
c53320d6
Commit
c53320d6
authored
Nov 28, 2013
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Circle and rectangular magnifier
parent
116f6f7d
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
210 additions
and
61 deletions
+210
-61
OpenBoard.qrc
resources/OpenBoard.qrc
+2
-0
circle.svg
resources/images/circle.svg
+11
-0
roundeRrectangle.svg
resources/images/roundeRrectangle.svg
+10
-0
UBSettings.cpp
src/core/UBSettings.cpp
+1
-0
UBSettings.h
src/core/UBSettings.h
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+9
-0
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+1
-0
UBMagnifer.cpp
src/gui/UBMagnifer.cpp
+153
-60
UBMagnifer.h
src/gui/UBMagnifer.h
+22
-1
No files found.
resources/OpenBoard.qrc
View file @
c53320d6
...
...
@@ -344,5 +344,7 @@
<file>images/download_open.png</file>
<file>images/tab_mask.png</file>
<file>images/duplicateDisabled.svg</file>
<file>images/roundeRrectangle.svg</file>
<file>images/circle.svg</file>
</qresource>
</RCC>
resources/images/circle.svg
0 → 100644
View file @
c53320d6
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"26px"
height=
"26px"
viewBox=
"0 0 26 26"
style=
"enable-background:new 0 0 26 26;"
xml:space=
"preserve"
>
<circle
style=
"fill:#CCCCCC;"
cx=
"13"
cy=
"13"
r=
"13"
/>
<circle
style=
"fill:#999999;"
cx=
"13"
cy=
"13"
r=
"11"
/>
<circle
style=
"fill:#FFFFFF;"
cx=
"13"
cy=
"13"
r=
"7"
/>
</svg>
resources/images/roundeRrectangle.svg
0 → 100644
View file @
c53320d6
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"26px"
height=
"26px"
viewBox=
"0 0 26 26"
style=
"enable-background:new 0 0 26 26;"
xml:space=
"preserve"
>
<circle
style=
"fill:#CCCCCC;"
cx=
"13"
cy=
"13"
r=
"13"
/>
<circle
style=
"fill:#999999;"
cx=
"13"
cy=
"13"
r=
"11"
/>
<rect
rx=
"2"
ry=
"2"
x=
"4"
y=
"9"
style=
"fill:#FFFFFF;"
width=
"18"
height=
"8"
/>
</svg>
src/core/UBSettings.cpp
View file @
c53320d6
...
...
@@ -351,6 +351,7 @@ void UBSettings::init()
appOnlineUserName
=
new
UBSetting
(
this
,
"App"
,
"OnlineUserName"
,
""
);
boardShowToolsPalette
=
new
UBSetting
(
this
,
"Board"
,
"ShowToolsPalette"
,
"false"
);
magnifierDrawingMode
=
new
UBSetting
(
this
,
"Board"
,
"MagnifierDrawingMode"
,
"0"
);
svgViewBoxMargin
=
new
UBSetting
(
this
,
"SVG"
,
"ViewBoxMargin"
,
"50"
);
...
...
src/core/UBSettings.h
View file @
c53320d6
...
...
@@ -372,6 +372,7 @@ class UBSettings : public QObject
UBSetting
*
libIconSize
;
UBSetting
*
magnifierDrawingMode
;
public
slots
:
void
setPenWidthIndex
(
int
index
);
...
...
src/domain/UBGraphicsScene.cpp
View file @
c53320d6
...
...
@@ -1947,6 +1947,7 @@ void UBGraphicsScene::addMagnifier(UBMagnifierParams params)
connect
(
magniferControlViewWidget
,
SIGNAL
(
magnifierClose_Signal
()),
this
,
SLOT
(
closeMagnifier
()));
connect
(
magniferControlViewWidget
,
SIGNAL
(
magnifierZoomIn_Signal
()),
this
,
SLOT
(
zoomInMagnifier
()));
connect
(
magniferControlViewWidget
,
SIGNAL
(
magnifierZoomOut_Signal
()),
this
,
SLOT
(
zoomOutMagnifier
()));
connect
(
magniferControlViewWidget
,
SIGNAL
(
magnifierDrawingModeChange_Signal
(
int
)),
this
,
SLOT
(
changeMagnifierMode
(
int
)));
connect
(
magniferControlViewWidget
,
SIGNAL
(
magnifierResized_Signal
(
qreal
)),
this
,
SLOT
(
resizedMagnifier
(
qreal
)));
setModified
(
true
);
...
...
@@ -2013,6 +2014,14 @@ void UBGraphicsScene::zoomOutMagnifier()
}
}
void
UBGraphicsScene
::
changeMagnifierMode
(
int
mode
)
{
if
(
magniferControlViewWidget
)
magniferControlViewWidget
->
setDrawingMode
(
mode
);
if
(
magniferDisplayViewWidget
)
magniferDisplayViewWidget
->
setDrawingMode
(
mode
);
}
void
UBGraphicsScene
::
resizedMagnifier
(
qreal
newPercent
)
{
if
(
newPercent
>
18
&&
newPercent
<
50
)
...
...
src/domain/UBGraphicsScene.h
View file @
c53320d6
...
...
@@ -346,6 +346,7 @@ public slots:
void
closeMagnifier
();
void
zoomInMagnifier
();
void
zoomOutMagnifier
();
void
changeMagnifierMode
(
int
mode
);
void
resizedMagnifier
(
qreal
newPercent
);
protected
:
...
...
src/gui/UBMagnifer.cpp
View file @
c53320d6
This diff is collapsed.
Click to expand it.
src/gui/UBMagnifer.h
View file @
c53320d6
...
...
@@ -42,16 +42,26 @@ public :
class
UBMagnifier
:
public
QWidget
{
Q_OBJECT
public
:
enum
DrawingMode
{
circular
=
0
,
rectangular
,
modesCount
// should me last.
};
public
:
UBMagnifier
(
QWidget
*
parent
=
0
,
bool
isInteractive
=
false
);
~
UBMagnifier
();
void
setSize
(
qreal
percentFromScene
);
void
createMask
();
void
setZoom
(
qreal
zoom
);
void
setGrabView
(
QWidget
*
view
);
void
setMoveView
(
QWidget
*
view
)
{
mView
=
view
;}
void
setDrawingMode
(
int
mode
);
void
grabPoint
();
void
grabPoint
(
const
QPoint
&
point
);
...
...
@@ -65,10 +75,13 @@ signals:
void
magnifierZoomIn_Signal
();
void
magnifierZoomOut_Signal
();
void
magnifierResized_Signal
(
qreal
newPercentSize
);
void
magnifierDrawingModeChange_Signal
(
int
mode
);
public
slots
:
void
slot_refresh
();
private
:
void
calculateButtonsPositions
();
protected
:
void
paintEvent
(
QPaintEvent
*
);
...
...
@@ -81,17 +94,25 @@ protected:
bool
mShouldMoveWidget
;
bool
mShouldResizeWidget
;
int
m_iButtonInterval
;
QPixmap
*
sClosePixmap
;
QRect
sClosePixmapButtonRect
;
QPixmap
*
sIncreasePixmap
;
QRect
sIncreasePixmapButtonRect
;
QPixmap
*
sDecreasePixmap
;
QRect
sDecreasePixmapButtonRect
;
QPixmap
*
sChangeModePixmap
;
QRect
sChangeModePixmapButtonRect
;
QPixmap
*
mResizeItem
;
QRect
mResizeItemButtonRect
;
bool
isCusrsorAlreadyStored
;
QCursor
mOldCursor
;
QCursor
mResizeCursor
;
private
:
DrawingMode
mDrawingMode
;
QTimer
mRefreshTimer
;
bool
m_isInteractive
;
...
...
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