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
a249bcd3
Commit
a249bcd3
authored
Sep 11, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into anatoly_dev
parents
44d443f8
93e8d950
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
32 deletions
+81
-32
UBBoardController.cpp
src/board/UBBoardController.cpp
+14
-0
UBApplicationController.cpp
src/core/UBApplicationController.cpp
+4
-1
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+4
-0
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+4
-0
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+49
-30
UBTeacherGuideWidgetsTools.h
src/gui/UBTeacherGuideWidgetsTools.h
+6
-1
No files found.
src/board/UBBoardController.cpp
View file @
a249bcd3
...
...
@@ -950,6 +950,10 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
qDebug
()
<<
"something has been dropped on the board! Url is: "
<<
url
.
toString
();
QString
sUrl
=
url
.
toString
();
QGraphicsItem
*
oldBackgroundObject
=
NULL
;
if
(
isBackground
)
oldBackgroundObject
=
mActiveScene
->
backgroundObject
();
if
(
sUrl
.
startsWith
(
"uniboardTool://"
))
{
downloadFinished
(
true
,
url
,
"application/vnd.mnemis-uniboard-tool"
,
QByteArray
(),
pPos
,
pSize
,
isBackground
);
...
...
@@ -990,6 +994,16 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
UBDownloadManager
::
downloadManager
()
->
addFileToDownload
(
desc
);
}
if
(
isBackground
&&
oldBackgroundObject
!=
mActiveScene
->
backgroundObject
())
{
if
(
mActiveScene
->
isURStackIsEnabled
())
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
mActiveScene
,
oldBackgroundObject
,
mActiveScene
->
backgroundObject
());
UBApplication
::
undoStack
->
push
(
uc
);
}
}
}
...
...
src/core/UBApplicationController.cpp
View file @
a249bcd3
...
...
@@ -598,7 +598,7 @@ void UBApplicationController::checkUpdateRequest()
void
UBApplicationController
::
hideDesktop
()
{
mDisplayManager
->
adjustScreens
(
-
1
);
if
(
UBStylusTool
::
Eraser
!=
UBDrawingController
::
drawingController
()
->
stylusTool
()){
UBDrawingController
::
drawingController
()
->
setDrawingMode
(
eDrawingMode_Vector
);
...
...
@@ -626,6 +626,9 @@ void UBApplicationController::hideDesktop()
}
mIsShowingDesktop
=
false
;
mDisplayManager
->
adjustScreens
(
-
1
);
emit
desktopMode
(
false
);
}
...
...
src/domain/UBGraphicsScene.cpp
View file @
a249bcd3
...
...
@@ -477,6 +477,7 @@ bool UBGraphicsScene::inputDeviceMove(const QPointF& scenePos, const qreal& pres
if
(
currentTool
==
UBStylusTool
::
Line
||
dc
->
mActiveRuler
)
{
if
(
UBDrawingController
::
drawingController
()
->
stylusTool
()
!=
UBStylusTool
::
Marker
)
if
(
NULL
!=
mpLastPolygon
&&
NULL
!=
mCurrentStroke
&&
mAddedItems
.
size
()
>
0
){
UBCoreGraphicsScene
::
removeItemFromDeletion
(
mpLastPolygon
);
mAddedItems
.
remove
(
mpLastPolygon
);
...
...
@@ -742,6 +743,9 @@ void UBGraphicsScene::drawLineTo(const QPointF &pEndPoint, const qreal &pWidth,
// Here we add the item to the scene
addItem
(
polygonItem
);
if
(
!
mCurrentStroke
)
mCurrentStroke
=
new
UBGraphicsStroke
();
if
(
mCurrentStroke
)
{
polygonItem
->
setStroke
(
mCurrentStroke
);
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
a249bcd3
...
...
@@ -1025,14 +1025,18 @@ void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode)
QString
inputStyleSheet
(
"QTextEdit { background: white; border-radius: 10px; border: 2px;}"
);
mpModePushButton
->
hide
();
mpSessionTitle
->
setReadOnly
(
false
);
mpSessionTitle
->
managePlaceholder
(
true
);
mpSessionTitle
->
setStyleSheet
(
inputStyleSheet
);
QFont
titleFont
(
QApplication
::
font
().
family
(),
11
,
-
1
);
mpSessionTitle
->
document
()
->
setDefaultFont
(
titleFont
);
mpAuthors
->
setReadOnly
(
false
);
mpAuthors
->
managePlaceholder
(
false
);
mpAuthors
->
setStyleSheet
(
inputStyleSheet
);
mpObjectives
->
setReadOnly
(
false
);
mpObjectives
->
managePlaceholder
(
false
);
mpObjectives
->
setStyleSheet
(
inputStyleSheet
);
mpKeywords
->
setReadOnly
(
false
);
mpKeywords
->
managePlaceholder
(
false
);
mpKeywords
->
setStyleSheet
(
inputStyleSheet
);
mpSchoolLevelValueLabel
->
hide
();
mpSchoolLevelBox
->
show
();
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
a249bcd3
...
...
@@ -24,6 +24,9 @@
#include <QApplication>
#include <QDomElement>
#include <QWebFrame>
#include <QTextDocument>
#include <QTextBlock>
#include <QTextCursor>
#include "UBTeacherGuideWidgetsTools.h"
...
...
@@ -148,30 +151,10 @@ void UBTGAdaptableText::setPlaceHolderText(QString text)
setPlainText
(
mPlaceHolderText
);
}
void
UBTGAdaptableText
::
keyPressEvent
(
QKeyEvent
*
e
)
{
if
(
isReadOnly
()){
// this is important if you set a placeholder. In this case even if the text field is readonly the
// keypressed event came here. So if you don't ignore it you'll have a flick on the text zone
e
->
ignore
();
return
;
}
if
(
toPlainText
()
==
mPlaceHolderText
){
setPlainText
(
""
);
}
setTextColor
(
QColor
(
Qt
::
black
));
QTextEdit
::
keyPressEvent
(
e
);
}
void
UBTGAdaptableText
::
keyReleaseEvent
(
QKeyEvent
*
e
)
{
QTextEdit
::
keyReleaseEvent
(
e
);
if
(
toPlainText
().
isEmpty
()){
setTextColor
(
QColor
(
Qt
::
lightGray
));
setPlainText
(
mPlaceHolderText
);
}
if
(
mMaximumLength
&&
toPlainText
().
length
()
>
mMaximumLength
){
setPlainText
(
toPlainText
().
left
(
mMaximumLength
));
QTextCursor
tc
(
document
());
...
...
@@ -183,8 +166,10 @@ void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e)
void
UBTGAdaptableText
::
showEvent
(
QShowEvent
*
e
)
{
Q_UNUSED
(
e
);
if
(
!
mIsUpdatingSize
&&
mHasPlaceHolder
&&
toPlainText
().
isEmpty
())
setPlainText
(
mPlaceHolderText
);
if
(
!
mIsUpdatingSize
&&
mHasPlaceHolder
&&
toPlainText
().
isEmpty
()
&&
!
isReadOnly
()){
setTextColor
(
QColor
(
Qt
::
lightGray
));
setPlainText
(
mPlaceHolderText
);
}
else
// If the teacherguide is collapsed, don't updated the size. Or set the size as the expanded size
onTextChanged
();
...
...
@@ -201,19 +186,18 @@ QString UBTGAdaptableText::text()
void
UBTGAdaptableText
::
onTextChanged
()
{
//qDebug() << ">> onTextChanged CALLED!";
qreal
documentSize
=
document
()
->
size
().
height
();
//qDebug() << ">> documentSize: " << documentSize << ", height: " << height();
if
(
height
()
==
documentSize
+
mBottomMargin
){
return
;
}
mIsUpdatingSize
=
true
;
if
(
documentSize
<
mMinimumHeight
)
setFixedHeight
(
mMinimumHeight
);
else
setFixedHeight
(
documentSize
+
mBottomMargin
);
if
(
documentSize
<
mMinimumHeight
){
setFixedHeight
(
mMinimumHeight
);
}
else
{
setFixedHeight
(
documentSize
+
mBottomMargin
);
}
updateGeometry
();
//to trig a resize on the tree widget item
...
...
@@ -224,8 +208,6 @@ void UBTGAdaptableText::onTextChanged()
setFocus
();
}
mIsUpdatingSize
=
false
;
}
void
UBTGAdaptableText
::
setInitialText
(
const
QString
&
text
)
...
...
@@ -248,6 +230,43 @@ void UBTGAdaptableText::bottomMargin(int newValue)
onTextChanged
();
}
void
UBTGAdaptableText
::
focusInEvent
(
QFocusEvent
*
e
){
if
(
isReadOnly
()){
e
->
ignore
();
}
managePlaceholder
(
true
);
QTextEdit
::
focusInEvent
(
e
);
}
void
UBTGAdaptableText
::
focusOutEvent
(
QFocusEvent
*
e
){
managePlaceholder
(
false
);
QTextEdit
::
focusOutEvent
(
e
);
}
void
UBTGAdaptableText
::
managePlaceholder
(
bool
focus
){
if
(
focus
){
if
(
toPlainText
()
==
mPlaceHolderText
){
setTextColor
(
QColor
(
Qt
::
black
));
setPlainText
(
""
);
}
setCursorToTheEnd
();
}
else
{
if
(
toPlainText
().
isEmpty
()){
setTextColor
(
QColor
(
Qt
::
lightGray
));
setPlainText
(
mPlaceHolderText
);
}
}
}
void
UBTGAdaptableText
::
setCursorToTheEnd
(){
QTextDocument
*
doc
=
document
();
if
(
NULL
!=
doc
){
QTextBlock
block
=
doc
->
lastBlock
();
QTextCursor
cursor
(
doc
);
cursor
.
setPosition
(
block
.
position
()
+
block
.
length
()
-
1
);
setTextCursor
(
cursor
);
}
}
/***************************************************************************
* class UBTGDraggableWeb *
...
...
src/gui/UBTeacherGuideWidgetsTools.h
View file @
a249bcd3
...
...
@@ -26,6 +26,8 @@
#include <QMimeData>
#include <QStackedWidget>
#include <QWebView>
#include <QFocusEvent>
#include <QMouseEvent>
#include "customWidgets/UBMediaWidget.h"
...
...
@@ -98,16 +100,19 @@ public:
QString
text
();
void
setInitialText
(
const
QString
&
text
);
void
setMaximumLength
(
int
length
);
void
managePlaceholder
(
bool
focus
);
public
slots
:
void
onTextChanged
();
protected
:
void
keyPressEvent
(
QKeyEvent
*
e
);
void
keyReleaseEvent
(
QKeyEvent
*
e
);
void
showEvent
(
QShowEvent
*
e
);
void
focusInEvent
(
QFocusEvent
*
e
);
void
focusOutEvent
(
QFocusEvent
*
e
);
private
:
void
setCursorToTheEnd
();
int
mBottomMargin
;
QTreeWidgetItem
*
mpTreeWidgetItem
;
int
mMinimumHeight
;
...
...
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