diff --git a/src/customWidgets/UBWidgetList.cpp b/src/customWidgets/UBWidgetList.cpp index cc2ee125..c0d98f9d 100644 --- a/src/customWidgets/UBWidgetList.cpp +++ b/src/customWidgets/UBWidgetList.cpp @@ -91,12 +91,14 @@ int UBWidgetList::scaleWidgets(QSize pSize) newWidgetWidth = mWidgetInfo[eachWidget].width()/scaleFactor; result += newWidgetWidth; } - qDebug() << __PRETTY_FUNCTION__ << "widget " << &eachWidget; +#ifndef Q_WS_WIN + qDebug() << __PRETTY_FUNCTION__ << "widget " << &eachWidget; qDebug() << __PRETTY_FUNCTION__ << "count " << count++; qDebug() << __PRETTY_FUNCTION__ << "widget orignal size " << mWidgetInfo[eachWidget]; qDebug() << __PRETTY_FUNCTION__ << "containes size " << pSize; qDebug() << __PRETTY_FUNCTION__ << "scale factor " << scaleFactor; qDebug() << __PRETTY_FUNCTION__ << "new height " << result; +#endif } return result; } diff --git a/src/gui/UBMediaPlayer.cpp b/src/gui/UBMediaPlayer.cpp index b7c13c78..d158fb53 100644 --- a/src/gui/UBMediaPlayer.cpp +++ b/src/gui/UBMediaPlayer.cpp @@ -123,9 +123,9 @@ UBMediaPlayer::UBMediaPlayer() : #ifdef Q_OS_MAC // layout->setSpacing(4); buttonPanelLayout->setSpacing(0); - info->setMinimumHeight(100); - info->setFont(QFont("verdana", 15)); - openButton->setFocusPolicy(Qt::NoFocus); +// info->setMinimumHeight(100); +// info->setFont(QFont("verdana", 15)); +// openButton->setFocusPolicy(Qt::NoFocus); #endif QWidget *buttonPanelWidget = new QWidget(this); buttonPanelWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index 188f1f0f..03b1644a 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -386,7 +386,12 @@ void UBTeacherBarWidget::loadContent() if(!mUrlList.empty()){ QStringList links; foreach(UBUrlWidget* url, mUrlList){ - links << url->url(); + QStringList list = url->url().split(";"); + QString formedlink = "" + list.at(1) + ""; + links << formedlink; } mpPreview->setLinks(links); } @@ -674,17 +679,37 @@ UBUrlWidget::UBUrlWidget(QWidget *parent, const char *name):QWidget(parent) setAttribute(Qt::WA_StyledBackground, true); setStyleSheet(UBApplication::globalStyleSheet()); - mpLayout = new QHBoxLayout(this); + mpLayout = new QVBoxLayout(this); setLayout(mpLayout); + + mpLabelLayout = new QHBoxLayout(this); mpUrlLabel = new QLabel(tr("Url"), this); - mpLayout->addWidget(mpUrlLabel, 0); + mpLabelLayout->addWidget(mpUrlLabel, 0); mpUrl = new QLineEdit(this); mpUrl->setObjectName("DockPaletteWidgetLineEdit"); - mpLayout->addWidget(mpUrl, 1); + mpLabelLayout->addWidget(mpUrl, 1); + + mpTitleLayout = new QHBoxLayout(this); + mpTitleLabel = new QLabel(tr("Title"),this); + mpTitleLayout->addWidget(mpTitleLabel,0); + mpTitle = new QLineEdit(this); + mpTitle->setObjectName("DockPaletteWidgetLineEdit"); + mpTitleLayout->addWidget(mpTitle,1); + + mpLayout->addLayout(mpTitleLayout); + mpLayout->addLayout(mpLabelLayout); } UBUrlWidget::~UBUrlWidget() { + if(NULL != mpTitle){ + delete mpTitle; + mpTitle = NULL; + } + if(NULL != mpTitleLabel){ + delete mpTitleLabel; + mpTitleLabel = NULL; + } if(NULL != mpUrlLabel){ delete mpUrlLabel; mpUrlLabel = NULL; @@ -693,6 +718,14 @@ UBUrlWidget::~UBUrlWidget() delete mpUrl; mpUrl = NULL; } + if(NULL != mpTitleLayout){ + delete mpTitleLayout; + mpTitleLayout = NULL; + } + if(NULL != mpLabelLayout){ + delete mpLabelLayout; + mpLabelLayout = NULL; + } if(NULL != mpLayout){ delete mpLayout; mpLayout = NULL; @@ -704,7 +737,7 @@ QString UBUrlWidget::url() QString str; if(NULL != mpUrl){ - str = mpUrl->text(); + str = mpUrl->text() + ";" + mpTitle->text(); } return str; @@ -712,8 +745,10 @@ QString UBUrlWidget::url() void UBUrlWidget::setUrl(const QString &url) { + QStringList list = url.split(";"); if(NULL != mpUrl){ - mpUrl->setText(url); + mpUrl->setText(list.at(0)); + mpTitle->setText(list.at(1)); } } diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index 3e53f97d..3916d528 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -107,9 +107,14 @@ public: void setUrl(const QString& url); private: - QHBoxLayout* mpLayout; + QVBoxLayout* mpLayout; + QHBoxLayout* mpLabelLayout; + QHBoxLayout* mpTitleLayout; QLabel* mpUrlLabel; QLineEdit* mpUrl; + + QLabel* mpTitleLabel; + QLineEdit* mpTitle; }; class UBActionPreview : public QWidget