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
f5931f0f
Commit
f5931f0f
authored
Jan 04, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/adaptors
parent
cc66b585
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
38 deletions
+20
-38
UBWidgetList.cpp
src/customWidgets/UBWidgetList.cpp
+17
-1
UBWidgetList.h
src/customWidgets/UBWidgetList.h
+1
-0
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+2
-35
UBTeacherBarWidget.h
src/gui/UBTeacherBarWidget.h
+0
-2
No files found.
src/customWidgets/UBWidgetList.cpp
View file @
f5931f0f
...
...
@@ -11,6 +11,8 @@ UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation,
mOrientation
=
orientation
;
mpContainer
=
new
QWidget
(
this
);
mWidgets
.
clear
();
mpEmptyLabel
=
new
QLabel
(
this
);
mpEmptyLabel
->
setObjectName
(
"emptyString"
);
if
(
eWidgetListOrientation_Vertical
==
orientation
){
setVerticalScrollBarPolicy
(
Qt
::
ScrollBarAsNeeded
);
...
...
@@ -47,6 +49,7 @@ UBWidgetList::~UBWidgetList()
void
UBWidgetList
::
addWidget
(
QWidget
*
widget
)
{
if
(
NULL
!=
mpLayout
){
mpEmptyLabel
->
setVisible
(
false
);
updateSize
(
true
,
widget
);
mpLayout
->
addWidget
(
widget
);
mWidgets
<<
widget
;
...
...
@@ -60,6 +63,9 @@ void UBWidgetList::removeWidget(QWidget *widget)
mWidgets
.
remove
(
mWidgets
.
indexOf
(
widget
));
updateSize
(
false
,
widget
);
widget
->
setVisible
(
false
);
if
(
0
==
mpLayout
->
count
()){
mpEmptyLabel
->
setVisible
(
true
);
}
}
}
...
...
@@ -98,6 +104,10 @@ void UBWidgetList::updateSize(bool widgetAdded, QWidget *widget)
void
UBWidgetList
::
resizeEvent
(
QResizeEvent
*
ev
)
{
mpEmptyLabel
->
setGeometry
((
width
()
-
mpEmptyLabel
->
width
())
/
2
,
(
height
()
-
mpEmptyLabel
->
height
())
/
2
,
mpEmptyLabel
->
width
(),
mpEmptyLabel
->
height
());
if
(
ev
->
oldSize
().
width
()
>=
0
&&
ev
->
oldSize
().
height
()
>=
0
){
float
scale
;
if
(
eWidgetListOrientation_Vertical
==
mOrientation
){
...
...
@@ -129,5 +139,11 @@ int UBWidgetList::margin()
return
mMargin
;
}
void
UBWidgetList
::
setEmptyText
(
const
QString
&
text
)
{
if
(
NULL
!=
mpEmptyLabel
){
mpEmptyLabel
->
setText
(
text
);
}
}
// TODO : - add onHover 'delete' button
// - add empty label
src/customWidgets/UBWidgetList.h
View file @
f5931f0f
...
...
@@ -25,6 +25,7 @@ public:
void
addWidget
(
QWidget
*
widget
);
void
removeWidget
(
QWidget
*
widget
);
void
setMargin
(
int
margin
);
void
setEmptyText
(
const
QString
&
text
);
int
margin
();
protected
:
...
...
src/gui/UBTeacherBarWidget.cpp
View file @
f5931f0f
...
...
@@ -20,8 +20,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
,
mpDurationLabel
(
NULL
)
,
mpTitle
(
NULL
)
,
mpAction1
(
NULL
)
,
mpAction2
(
NULL
)
,
mpAction3
(
NULL
)
,
mpDropMediaZone
(
NULL
)
,
mpContainer
(
NULL
)
,
mpContainerLayout
(
NULL
)
...
...
@@ -53,11 +51,9 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
// Title
mpTitleLabel
=
new
QLabel
(
tr
(
"Title"
),
mpContainer
);
mpTitleLabel
->
setMinimumWidth
(
LABEL_MINWIDHT
);
mpTitleLabel
->
setAlignment
(
Qt
::
AlignRight
);
mpTitle
=
new
QLineEdit
(
mpContainer
);
mpTitle
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
connect
(
mpTitle
,
SIGNAL
(
textChanged
(
const
QString
&
)),
this
,
SLOT
(
onTitleTextChanged
(
const
QString
&
)));
connect
(
mpTitle
,
SIGNAL
(
textChanged
(
const
QString
&
)),
this
,
SLOT
(
onTitleTextChanged
(
const
QString
&
)));
mpTitleLayout
=
new
QHBoxLayout
();
mpTitleLayout
->
addWidget
(
mpTitleLabel
,
0
);
mpTitleLayout
->
addWidget
(
mpTitle
,
1
);
...
...
@@ -65,7 +61,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
// Duration
mpDurationLabel
=
new
QLabel
(
tr
(
"Duration"
),
mpContainer
);
mpDurationLabel
->
setMinimumWidth
(
LABEL_MINWIDHT
);
mpDurationLayout
=
new
QHBoxLayout
();
mpDurationLayout
->
addWidget
(
mpDurationLabel
,
1
);
mpDuration1
=
new
QCheckBox
(
this
);
...
...
@@ -85,12 +80,8 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
// Actions
mpAction1
=
new
UBTeacherStudentAction
(
1
,
mpContainer
);
mpAction2
=
new
UBTeacherStudentAction
(
2
,
mpContainer
);
mpAction3
=
new
UBTeacherStudentAction
(
3
,
mpContainer
);
mpLayout
->
addWidget
(
mpAction1
);
mpLayout
->
addWidget
(
mpAction2
);
mpLayout
->
addWidget
(
mpAction3
);
// Media
mpDropMediaZone
=
new
UBTeacherBarDropMediaZone
();
...
...
@@ -104,10 +95,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
connect
(
mpTitle
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onValueChanged
()));
connect
(
mpAction1
->
teacher
(),
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onValueChanged
()));
connect
(
mpAction1
->
student
(),
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onValueChanged
()));
connect
(
mpAction2
->
teacher
(),
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onValueChanged
()));
connect
(
mpAction2
->
student
(),
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onValueChanged
()));
connect
(
mpAction3
->
teacher
(),
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onValueChanged
()));
connect
(
mpAction3
->
student
(),
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onValueChanged
()));
}
UBTeacherBarWidget
::~
UBTeacherBarWidget
()
...
...
@@ -116,14 +103,6 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
delete
mpDropMediaZone
;
mpDropMediaZone
=
NULL
;
}
if
(
NULL
!=
mpAction3
){
delete
mpAction3
;
mpAction3
=
NULL
;
}
if
(
NULL
!=
mpAction2
){
delete
mpAction2
;
mpAction2
=
NULL
;
}
if
(
NULL
!=
mpAction1
){
delete
mpAction1
;
mpAction1
=
NULL
;
...
...
@@ -187,11 +166,7 @@ void UBTeacherBarWidget::onValueChanged()
{
if
(
mpTitle
->
text
()
==
""
&&
mpAction1
->
teacherText
()
==
""
&&
mpAction1
->
studentText
()
==
""
&&
mpAction2
->
teacherText
()
==
""
&&
mpAction2
->
studentText
()
==
""
&&
mpAction3
->
teacherText
()
==
""
&&
mpAction3
->
studentText
()
==
""
)
&&
mpAction1
->
studentText
()
==
""
)
{
mIconToLeft
=
QPixmap
(
":images/teacher_open_disabled.png"
);
mIconToRight
=
QPixmap
(
":images/teacher_close_disabled.png"
);
...
...
@@ -211,10 +186,6 @@ void UBTeacherBarWidget::saveContent()
infos
.
title
=
mpTitle
->
text
();
infos
.
action1Master
=
mpAction1
->
teacherText
();
infos
.
action1Student
=
mpAction1
->
studentText
();
infos
.
action2Master
=
mpAction2
->
teacherText
();
infos
.
action2Student
=
mpAction2
->
studentText
();
infos
.
action3Master
=
mpAction3
->
teacherText
();
infos
.
action3Student
=
mpAction3
->
studentText
();
UBPersistenceManager
::
persistenceManager
()
->
persistTeacherBar
(
UBApplication
::
boardController
->
activeDocument
(),
UBApplication
::
boardController
->
activeSceneIndex
(),
infos
);
}
...
...
@@ -224,10 +195,6 @@ void UBTeacherBarWidget::loadContent()
mpTitle
->
setText
(
nextInfos
.
title
);
mpAction1
->
setTeacherText
(
nextInfos
.
action1Master
);
mpAction1
->
setStudentText
(
nextInfos
.
action1Student
);
mpAction2
->
setTeacherText
(
nextInfos
.
action2Master
);
mpAction2
->
setStudentText
(
nextInfos
.
action2Student
);
mpAction3
->
setTeacherText
(
nextInfos
.
action3Master
);
mpAction3
->
setStudentText
(
nextInfos
.
action3Student
);
}
void
UBTeacherBarWidget
::
onTitleTextChanged
(
const
QString
&
text
)
...
...
src/gui/UBTeacherBarWidget.h
View file @
f5931f0f
...
...
@@ -92,8 +92,6 @@ private:
QLabel
*
mpDurationLabel
;
QLineEdit
*
mpTitle
;
UBTeacherStudentAction
*
mpAction1
;
UBTeacherStudentAction
*
mpAction2
;
UBTeacherStudentAction
*
mpAction3
;
UBTeacherBarDropMediaZone
*
mpDropMediaZone
;
QWidget
*
mpContainer
;
QVBoxLayout
*
mpContainerLayout
;
...
...
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