From fb2f09deede96b77d9f54ce04274934cac78de36 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Fri, 6 Jan 2012 12:49:58 +0100 Subject: [PATCH] updated stylesheet --- resources/style.qss | 21 +++++++++++++++++++++ src/gui/UBTeacherBarWidget.cpp | 20 +++++++++++++++++++- src/gui/UBTeacherBarWidget.h | 3 +++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/resources/style.qss b/resources/style.qss index 8681fb80..f631984c 100644 --- a/resources/style.qss +++ b/resources/style.qss @@ -12,6 +12,27 @@ QWidget#UBTeacherBarDropMediaZone border: 2px solid #999999; } +QWidget#UBTeacherBarPreviewWidget +{ + background: #FFFFFF; + border-radius: 10px; + border: 2px solid #999999; +} + +QLabel#UBTeacherBarPreviewTitle +{ + color: #555555; + font-size : 18px; + font-weight:bold; +} + +QLabel#UBTeacherBarPreviewSubtitle +{ + color: #555555; + font-size : 14px; + font-weight:bold; +} + QWidget#UBLibWebView { background: #EEEEEE; diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index 52985f84..112a256b 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -364,7 +364,7 @@ void UBTeacherBarWidget::loadContent() }else{ mpPreview->setDuration(eDuration_ThreeQuarter); } - + mpPreview->setComments(mpComments->document()->toPlainText()); } } @@ -692,6 +692,7 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char , mpActionsLabel(NULL) , mpMediaLabel(NULL) , mpCommentsLabel(NULL) + , mpComments(NULL) { setObjectName(name); @@ -713,12 +714,14 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char // Actions mpActionsLabel = new QLabel(tr("Actions"), this); + mpActionsLabel->setObjectName("UBTeacherBarPreviewSubtitle"); mActionLabelLayout.addWidget(mpActionsLabel, 0); mActionLabelLayout.addStretch(1); mLayout.addLayout(&mActionLabelLayout); // Media mpMediaLabel = new QLabel(tr("Medias"), this); + mpMediaLabel->setObjectName("UBTeacherBarPreviewSubtitle"); mMediaLabelLayout.addWidget(mpMediaLabel, 0); mMediaLabelLayout.addStretch(1); mLayout.addLayout(&mMediaLabelLayout); @@ -729,9 +732,13 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char // Comments mpCommentsLabel = new QLabel(tr("Comments"), this); + mpCommentsLabel->setObjectName("UBTeacherBarPreviewSubtitle"); mCommentsLabelLayout.addWidget(mpCommentsLabel, 0); mCommentsLabelLayout.addStretch(1); mLayout.addLayout(&mCommentsLabelLayout); + mpComments = new QLabel(this); + mpComments->setWordWrap(true); + mLayout.addWidget(mpComments); // Edit button mpEditButton = new QPushButton(tr("Edit infos"), this); @@ -747,6 +754,10 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char UBTeacherBarPreviewWidget::~UBTeacherBarPreviewWidget() { + if(NULL != mpComments){ + delete mpComments; + mpComments = NULL; + } if(NULL != mpTitle){ delete mpTitle; mpTitle = NULL; @@ -806,6 +817,13 @@ void UBTeacherBarPreviewWidget::setDuration(eDuration duration) } } +void UBTeacherBarPreviewWidget::setComments(const QString &comments) +{ + if(NULL != mpComments){ + mpComments->setText(comments); + } +} + // ------------------------------------------------------------------------------------ UBTeacherBarPreviewMedia::UBTeacherBarPreviewMedia(QWidget* parent, const char* name) : QWidget(parent) { diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index 5ee8f336..8937bf24 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -114,6 +114,7 @@ public: UBTeacherBarPreviewMedia* mediaViewer() {return &mMediaViewer;} void setTitle(const QString& title); void setDuration(eDuration duration); + void setComments(const QString& comments); signals: void showEditMode(); @@ -129,12 +130,14 @@ private: QHBoxLayout mMediaLabelLayout; QHBoxLayout mCommentsLabelLayout; UBTeacherBarPreviewMedia mMediaViewer; + QPushButton* mpEditButton; QLabel* mpTitle; QLabel* mpDuration; QLabel* mpActionsLabel; QLabel* mpMediaLabel; QLabel* mpCommentsLabel; + QLabel* mpComments; }; class UBTeacherBarWidget : public UBDockPaletteWidget