From 89e16fdecdcbce12890a995eff450541f3aa9ecc Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Thu, 5 Jan 2012 08:47:07 +0100 Subject: [PATCH] Added some minor changes on the GUI --- src/gui/UBTeacherBarWidget.cpp | 26 ++++++++++++++++++++++++-- src/gui/UBTeacherBarWidget.h | 2 ++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index c9e33340..dfc0d712 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -36,10 +36,13 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock , mpActionLabel(NULL) , mpActions(NULL) , mpActionButton(NULL) + , mpActionLayout(NULL) , mpCommentLabel(NULL) , mpComments(NULL) , mpLinkLabel(NULL) , mpLinks(NULL) + , mpLinkButton(NULL) + , mpLinkLayout(NULL) { setObjectName(name); mName = "TeacherBarWidget"; @@ -76,6 +79,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock mpDurationLayout = new QHBoxLayout(); mpDuration1 = new QCheckBox(this); mpDuration1->setIcon(QIcon(":images/duration1.png")); + mpDuration1->setChecked(true); mpDurationLayout->addWidget(mpDuration1, 0); mpDuration2 = new QCheckBox(this); mpDuration2->setIcon(QIcon(":images/duration2.png")); @@ -98,7 +102,10 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock mpActionButton = new QPushButton(this); mpActionButton->setObjectName("DockPaletteWidgetButton"); mpActionButton->setText(tr("Add action")); - mpLayout->addWidget(mpActionButton, 0); + mpActionLayout = new QHBoxLayout(); + mpActionLayout->addWidget(mpActionButton, 0); + mpActionLayout->addStretch(1); + mpLayout->addLayout(mpActionLayout, 0); // Media mpMediaLabel = new QLabel(tr("Media"), this); @@ -113,7 +120,10 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock mpLayout->addWidget(mpLinks, 1); mpLinkButton = new QPushButton(tr("Add link"), this); mpLinkButton->setObjectName("DockPaletteWidgetButton"); - mpLayout->addWidget(mpLinkButton); + mpLinkLayout = new QHBoxLayout(); + mpLinkLayout->addWidget(mpLinkButton, 0); + mpLinkLayout->addStretch(1); + mpLayout->addLayout(mpLinkLayout, 0); // Comments mpCommentLabel = new QLabel(tr("Comments"), this); @@ -149,6 +159,14 @@ UBTeacherBarWidget::~UBTeacherBarWidget() delete mpLinkLabel; mpLinkLabel = NULL; } + if(NULL != mpLinkButton){ + delete mpLinkButton; + mpLinkButton = NULL; + } + if(NULL != mpLinkLayout){ + delete mpLinkLayout; + mpLinkLayout = NULL; + } if(NULL != mpDropMediaZone){ delete mpDropMediaZone; mpDropMediaZone = NULL; @@ -161,6 +179,10 @@ UBTeacherBarWidget::~UBTeacherBarWidget() delete mpActionButton; mpActionButton = NULL; } + if(NULL != mpActionLayout){ + delete mpActionLayout; + mpActionLayout = NULL; + } if(NULL != mpAction1){ delete mpAction1; mpAction1 = NULL; diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index 7ba1eeb9..a9d939d0 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -102,9 +102,11 @@ private: QLabel* mpActionLabel; UBWidgetList* mpActions; QPushButton* mpActionButton; + QHBoxLayout* mpActionLayout; QLabel* mpLinkLabel; UBWidgetList* mpLinks; QPushButton* mpLinkButton; + QHBoxLayout* mpLinkLayout; QLabel* mpCommentLabel; QTextEdit* mpComments; };