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
dd185e9b
Commit
dd185e9b
authored
Dec 17, 2013
by
-f
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:OpenEducationFoundation/OpenBoard into develop
parents
7246b6b7
e111b59d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
UBApplication.cpp
src/core/UBApplication.cpp
+0
-7
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+5
-6
UBGraphicsTextItem.h
src/domain/UBGraphicsTextItem.h
+3
-1
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+13
-7
No files found.
src/core/UBApplication.cpp
View file @
dd185e9b
...
@@ -129,13 +129,6 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
...
@@ -129,13 +129,6 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
version
=
version
.
left
(
version
.
length
()
-
1
);
version
=
version
.
left
(
version
.
length
()
-
1
);
setApplicationVersion
(
version
);
setApplicationVersion
(
version
);
#if defined(Q_WS_MAC) && !defined(QT_NO_DEBUG)
CFStringRef
shortVersion
=
(
CFStringRef
)
CFBundleGetValueForInfoDictionaryKey
(
CFBundleGetMainBundle
(),
CFSTR
(
"CFBundleShortVersionString"
));
const
char
*
version
=
CFStringGetCStringPtr
(
shortVersion
,
kCFStringEncodingMacRoman
);
Q_ASSERT
(
version
);
setApplicationVersion
(
version
);
#endif
QStringList
args
=
arguments
();
QStringList
args
=
arguments
();
mIsVerbose
=
args
.
contains
(
"-v"
)
mIsVerbose
=
args
.
contains
(
"-v"
)
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
dd185e9b
...
@@ -39,7 +39,6 @@
...
@@ -39,7 +39,6 @@
#include "core/UBSettings.h"
#include "core/UBSettings.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
QColor
UBGraphicsTextItem
::
lastUsedTextColor
;
QColor
UBGraphicsTextItem
::
lastUsedTextColor
;
UBGraphicsTextItem
::
UBGraphicsTextItem
(
QGraphicsItem
*
parent
)
:
UBGraphicsTextItem
::
UBGraphicsTextItem
(
QGraphicsItem
*
parent
)
:
...
@@ -47,7 +46,9 @@ UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) :
...
@@ -47,7 +46,9 @@ UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) :
,
UBGraphicsItem
()
,
UBGraphicsItem
()
,
mMultiClickState
(
0
)
,
mMultiClickState
(
0
)
,
mLastMousePressTime
(
QTime
::
currentTime
())
,
mLastMousePressTime
(
QTime
::
currentTime
())
,
mTypeTextHereLabel
(
tr
(
"<Type Text Here>"
))
{
{
mEmptyTextWidth
=
QFontMetrics
(
font
()).
width
(
mTypeTextHereLabel
);
setDelegate
(
new
UBGraphicsTextItemDelegate
(
this
,
0
));
setDelegate
(
new
UBGraphicsTextItemDelegate
(
this
,
0
));
// TODO claudio remove this because in contrast with the fact the frame should be created on demand.
// TODO claudio remove this because in contrast with the fact the frame should be created on demand.
...
@@ -56,8 +57,6 @@ UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) :
...
@@ -56,8 +57,6 @@ UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) :
Delegate
()
->
setUBFlag
(
GF_FLIPPABLE_ALL_AXIS
,
false
);
Delegate
()
->
setUBFlag
(
GF_FLIPPABLE_ALL_AXIS
,
false
);
Delegate
()
->
setUBFlag
(
GF_REVOLVABLE
,
true
);
Delegate
()
->
setUBFlag
(
GF_REVOLVABLE
,
true
);
mTypeTextHereLabel
=
tr
(
"<Type Text Here>"
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
UBItemLayerType
::
Object
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
UBItemLayerType
::
Object
);
setData
(
UBGraphicsItemData
::
itemLayerType
,
QVariant
(
itemLayerType
::
ObjectItem
));
//Necessary to set if we want z value to be assigned correctly
setData
(
UBGraphicsItemData
::
itemLayerType
,
QVariant
(
itemLayerType
::
ObjectItem
));
//Necessary to set if we want z value to be assigned correctly
...
@@ -247,8 +246,9 @@ void UBGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
...
@@ -247,8 +246,9 @@ void UBGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
if
(
widget
==
UBApplication
::
boardController
->
controlView
()
->
viewport
()
&&
if
(
widget
==
UBApplication
::
boardController
->
controlView
()
->
viewport
()
&&
!
isSelected
()
&&
toPlainText
().
isEmpty
())
!
isSelected
()
&&
toPlainText
().
isEmpty
())
{
{
QFontMetrics
fm
(
font
());
// QFontMetrics fm(font());
setTextWidth
(
fm
.
width
(
mTypeTextHereLabel
));
// setTextWidth(fm.width(mTypeTextHereLabel));
painter
->
setFont
(
font
());
painter
->
setFont
(
font
());
painter
->
setPen
(
UBSettings
::
paletteColor
);
painter
->
setPen
(
UBSettings
::
paletteColor
);
painter
->
drawText
(
boundingRect
(),
Qt
::
AlignCenter
,
mTypeTextHereLabel
);
painter
->
drawText
(
boundingRect
(),
Qt
::
AlignCenter
,
mTypeTextHereLabel
);
...
@@ -307,7 +307,6 @@ QPainterPath UBGraphicsTextItem::shape() const
...
@@ -307,7 +307,6 @@ QPainterPath UBGraphicsTextItem::shape() const
void
UBGraphicsTextItem
::
setTextWidth
(
qreal
width
)
void
UBGraphicsTextItem
::
setTextWidth
(
qreal
width
)
{
{
QFontMetrics
fm
(
font
());
qreal
strictMin
=
155
;
// the size of the font customization panel
qreal
strictMin
=
155
;
// the size of the font customization panel
qreal
newWidth
=
qMax
(
strictMin
,
width
);
qreal
newWidth
=
qMax
(
strictMin
,
width
);
...
...
src/domain/UBGraphicsTextItem.h
View file @
dd185e9b
...
@@ -98,6 +98,9 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
...
@@ -98,6 +98,9 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
void
setSelected
(
bool
selected
);
void
setSelected
(
bool
selected
);
QString
mTypeTextHereLabel
;
int
mEmptyTextWidth
;
signals
:
signals
:
void
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
);
void
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
);
...
@@ -121,7 +124,6 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
...
@@ -121,7 +124,6 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
int
mMultiClickState
;
int
mMultiClickState
;
QTime
mLastMousePressTime
;
QTime
mLastMousePressTime
;
QString
mTypeTextHereLabel
;
QColor
mColorOnDarkBackground
;
QColor
mColorOnDarkBackground
;
QColor
mColorOnLightBackground
;
QColor
mColorOnLightBackground
;
...
...
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
dd185e9b
...
@@ -652,16 +652,16 @@ void UBGraphicsTextItemDelegate::updateAlighButtonState()
...
@@ -652,16 +652,16 @@ void UBGraphicsTextItemDelegate::updateAlighButtonState()
}
}
asAlBtn
->
setMixedButtonVisible
(
false
);
asAlBtn
->
setMixedButtonVisible
(
false
);
switch
(
static_cast
<
int
>
(
delegated
()
->
textCursor
().
blockFormat
().
alignment
()))
{
case
Qt
:
:
AlignCenter
:
Qt
::
Alignment
cf
=
delegated
()
->
textCursor
().
blockFormat
().
alignment
();
qDebug
()
<<
"getting alignment"
<<
cf
;
if
(
cf
&
Qt
::
AlignCenter
)
{
asAlBtn
->
setKind
(
AlignTextButton
::
k_center
);
asAlBtn
->
setKind
(
AlignTextButton
::
k_center
);
break
;
}
else
if
(
cf
&
Qt
::
AlignRight
)
{
case
Qt
:
:
AlignRight
:
asAlBtn
->
setKind
(
AlignTextButton
::
k_right
);
asAlBtn
->
setKind
(
AlignTextButton
::
k_right
);
break
;
}
else
{
default
:
asAlBtn
->
setKind
(
AlignTextButton
::
k_left
);
asAlBtn
->
setKind
(
AlignTextButton
::
k_left
);
break
;
}
}
}
}
...
@@ -726,5 +726,11 @@ QVariant UBGraphicsTextItemDelegate::itemChange(QGraphicsItem::GraphicsItemChang
...
@@ -726,5 +726,11 @@ QVariant UBGraphicsTextItemDelegate::itemChange(QGraphicsItem::GraphicsItemChang
}
}
}
}
}
}
if
(
value
.
toBool
()
==
false
&&
delegated
()
->
document
()
->
toPlainText
().
isEmpty
())
{
int
wdth
=
QFontMetrics
(
delegated
()
->
font
()).
width
(
delegated
()
->
mTypeTextHereLabel
);
delegated
()
->
setTextWidth
(
qMax
(
wdth
,
(
int
)(
delegated
()
->
textWidth
())));
}
return
UBGraphicsItemDelegate
::
itemChange
(
change
,
value
);
return
UBGraphicsItemDelegate
::
itemChange
(
change
,
value
);
}
}
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