fixed issue of multiple lines on the teacher bar on the presentation mode

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 232730e3a6
commit c4a694e73f
  1. 12
      src/gui/UBTeacherGuideWidget.cpp
  2. 1
      src/gui/UBTeacherGuideWidgetsTools.cpp

@ -386,10 +386,14 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
else if(element->type == "action"){ else if(element->type == "action"){
QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem); QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem);
newWidgetItem->setText(0,element->attributes.value("task")); newWidgetItem->setText(0,element->attributes.value("task"));
QColor color = element->attributes.value("owner").toInt() == 0 ? QColor(Qt::red):QColor(Qt::green); QString colorString = element->attributes.value("owner").toInt() == 0 ? "red":"green";
newWidgetItem->setData(0,Qt::ForegroundRole,QBrush(color)); UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem,0);
newWidgetItem->setData(0,tUBTGTreeWidgetItemRole_HasAnAction,tUBTGActionAssociateOnClickItem_NONE); textWidget->bottomMargin(15);
newWidgetItem->setData(0,Qt::FontRole, QVariant(QFont(QApplication::font().family(),11))); textWidget->setStyleSheet("QWidget {background: #EEEEEE; border:none; color:" + colorString + ";}");
textWidget->showText(element->attributes.value("task"));
textWidget->document()->setDefaultFont(QFont(QApplication::font().family(),11));
mpTreeWidget->setItemWidget(newWidgetItem,0,textWidget);
mpRootWidgetItem->addChild(newWidgetItem); mpRootWidgetItem->addChild(newWidgetItem);
} }
else if(element->type == "media"){ else if(element->type == "media"){

@ -327,6 +327,7 @@ void UBTGMediaWidget::createWorkWidget(QString& path)
mpLayout->addWidget(mpMediaWidget); mpLayout->addWidget(mpMediaWidget);
} }
else if (mpWebView){ else if (mpWebView){
mpWebView->setMaximumHeight(mpTreeWidgetItem->treeWidget()->size().width());
mpWebView->setParent(mpWorkWidget); mpWebView->setParent(mpWorkWidget);
mpLayout->addWidget(mpWebView); mpLayout->addWidget(mpWebView);
} }

Loading…
Cancel
Save