Updated some minor EOU (Ease Of Use) in the teacher bar

preferencesAboutTextFull
shibakaneki 13 years ago
parent 40be502737
commit c905eb3879
  1. 3
      resources/style.qss
  2. 1
      src/gui/UBTBDocumentEditWidget.cpp
  3. 2
      src/gui/UBTBDocumentPreviewWidget.cpp
  4. 42
      src/gui/UBTeacherBarPreviewWidget.cpp
  5. 7
      src/gui/UBTeacherBarPreviewWidget.h
  6. 6
      src/gui/UBTeacherBarWidget.cpp
  7. 1
      src/gui/UBTeacherBarWidget.h

@ -27,7 +27,8 @@ QWidget#UBMediaVideoContainer
border: 2px solid #999999;
}
QWidget#UBTeacherBarPreviewWidget
QWidget#UBTBPreviewWidget
{
background: #FFFFFF;
border-radius: 10px;

@ -192,7 +192,6 @@ void UBTBDocumentEditWidget::clearFields()
void UBTBDocumentEditWidget::onKeywordChanged(const QString &kw)
{
mpDataMgr->setKeywords(kw);
qDebug() << ">>> KEYWORD CHANGED: " << kw;
emit valueChanged();
}

@ -29,7 +29,7 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataM
mpContainer = new QWidget(this);
mpContainer->setLayout(&mContainerLayout);
mpContainer->setObjectName("UBTeacherBarPreviewWidget");
mpContainer->setObjectName("UBTBPreviewWidget");
// Session Title
mpSessionLabel = new QLabel(tr("Session"), mpContainer);

@ -144,6 +144,7 @@ UBTBPreviewContainer::~UBTBPreviewContainer()
// ------------------------------------------------------------------------------------
UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget *parent, const char *name):QWidget(parent)
, mpEditButton(NULL)
, mpDocumentButton(NULL)
, mpSessionTitle(NULL)
, mpTitle(NULL)
, mpTitleLabel(NULL)
@ -155,20 +156,27 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
setObjectName(name);
mpDataMgr = pDataMgr;
setLayout(&mLayout);
mLayout.setContentsMargins(0, 0, 0, 0);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
// Build the Preview widget
mpContainer = new QWidget(this);
mpContainer->setObjectName("UBTBPreviewWidget");
mpContainer->setLayout(&mContainerLayout);
mLayout.addWidget(mpContainer, 1);
// Session Title
mpTitleContainer = new QWidget(this);
mpTitleContainer = new QWidget(mpContainer);
mpTitleContainer->setLayout(&mTitleLayout);
mpSessionTitle = new QLabel(this);
mpSessionTitle = new QLabel(mpContainer);
mpSessionTitle->setText(tr("Session: "));
mpSessionTitle->setWordWrap(true);
mpSessionTitle->setAlignment(Qt::AlignRight);
mpSessionTitle->setObjectName("UBTBPreviewSessionTitle");
mLayout.addWidget(mpSessionTitle);
mContainerLayout.addWidget(mpSessionTitle);
// Title
mpTitleContainer->setLayout(&mTitleLayout);
@ -187,27 +195,32 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
mpPageNbrLabel->setObjectName("UBTBPreviewSessionTitle");
mTitleLayout.addWidget(mpPageNbrLabel);
mTitleLayout.addWidget(&mTitleSeparator);
mLayout.addWidget(mpTitleContainer);
mContainerLayout.addWidget(mpTitleContainer);
// Content
mpContentContainer = new UBTBPreviewContainer(this);
mLayout.addWidget(mpContentContainer, 1);
mpContentContainer = new UBTBPreviewContainer(mpContainer);
mContainerLayout.addWidget(mpContentContainer, 1);
// License
mLayout.addWidget(&mLicenseSeparator);
mpLicenseLabel = new UBTBLicenseWidget(this);
mLayout.addWidget(mpLicenseLabel);
mContainerLayout.addWidget(&mLicenseSeparator);
mpLicenseLabel = new UBTBLicenseWidget(mpContainer);
mContainerLayout.addWidget(mpLicenseLabel);
// Edit button
mpEditButton = new QPushButton(tr("Edit infos"), this);
// Document Button
mpDocumentButton = new QPushButton(tr("Document View"), this);
mpDocumentButton->setObjectName("DockPaletteWidgetButton");
// Edit Button
mpEditButton = new QPushButton(tr("Edit"), this);
mpEditButton->setObjectName("DockPaletteWidgetButton");
mEditLayout.addStretch(1);
mEditLayout.addWidget(mpDocumentButton, 0);
mEditLayout.addWidget(mpEditButton, 0);
mEditLayout.addStretch(1);
mLayout.addLayout(&mEditLayout, 0);
connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit()));
connect(mpDocumentButton, SIGNAL(clicked()), this, SLOT(onDocumentClicked()));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
}
@ -225,6 +238,11 @@ void UBTeacherBarPreviewWidget::onEdit()
emit showEditMode();
}
void UBTeacherBarPreviewWidget::onDocumentClicked()
{
emit showDocumentPreview();
}
void UBTeacherBarPreviewWidget::updateFields()
{
// Session Title

@ -62,6 +62,7 @@ public:
signals:
void showEditMode();
void showDocumentPreview();
protected:
void showEvent(QShowEvent* ev);
@ -69,6 +70,7 @@ protected:
private slots:
void onEdit();
void onActiveSceneChanged();
void onDocumentClicked();
private:
void generateActions();
@ -77,8 +79,12 @@ private:
void generateComments();
QVBoxLayout mLayout;
QVBoxLayout mContainerLayout;
QHBoxLayout mEditLayout;
QPushButton* mpEditButton;
QPushButton* mpDocumentButton;
QWidget* mpContainer;
// Titles
QVBoxLayout mTitleLayout;
@ -95,7 +101,6 @@ private:
// License
UBTBSeparator mLicenseSeparator;
// TODO : replace the QLabel of the license by a widget done for that!
UBTBLicenseWidget* mpLicenseLabel;

@ -57,6 +57,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
connect(UBApplication::boardController, SIGNAL(activeDocumentChanged()), this, SLOT(onActiveDocumentChanged()));
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode()));
connect(mpPreview, SIGNAL(showDocumentPreview()), this, SLOT(onShowDocumentPreview()));
connect(mpDocPreviewWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState)));
connect(mpDocEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState)));
connect(mpPageEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState)));
@ -150,6 +151,11 @@ void UBTeacherBarWidget::onShowEditMode()
onTBStateChanged(eTeacherBarState_PageEdit);
}
void UBTeacherBarWidget::onShowDocumentPreview()
{
onTBStateChanged(eTeacherBarState_DocumentPreview);
}
void UBTeacherBarWidget::onTBStateChanged(eTeacherBarState state)
{
switch(state){

@ -48,6 +48,7 @@ private slots:
void onShowEditMode();
void onTBStateChanged(eTeacherBarState state);
void onActiveDocumentChanged();
void onShowDocumentPreview();
private:
bool isEmpty();

Loading…
Cancel
Save