fixed issue for resizing on title page

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 218071207c
commit 5bb5444b61
  1. 21
      src/gui/UBTeacherGuideWidget.cpp
  2. 2
      src/gui/UBTeacherGuideWidget.h

@ -676,18 +676,16 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpPageNumberLabel->setText(tr("Title page")); mpPageNumberLabel->setText(tr("Title page"));
mpLayout->addWidget(mpPageNumberLabel); mpLayout->addWidget(mpPageNumberLabel);
mpScrollArea = new QScrollArea(); mpScrollArea = new QScrollArea();
mpContainerWidget = new QWidget(); mpContainerWidget = new QWidget();
mpContainerWidgetLayout = new QVBoxLayout(); mpContainerWidgetLayout = new QVBoxLayout();
mpLayout->addWidget(mpScrollArea); mpLayout->addWidget(mpScrollArea);
mpScrollArea->setWidget(mpContainerWidget); mpScrollArea->setWidget(mpContainerWidget);
mpScrollArea->setWidgetResizable(true); mpScrollArea->setWidgetResizable(true);
mpScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
mpContainerWidget->setLayout(mpContainerWidgetLayout); mpContainerWidget->setLayout(mpContainerWidgetLayout);
mpButtonTitleLayout = new QHBoxLayout(0); mpButtonTitleLayout = new QHBoxLayout(0);
mpModePushButton = new QPushButton(this); mpModePushButton = new QPushButton(this);
@ -774,6 +772,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpContainerWidgetLayout->addWidget(mpSchoolLevelItemLabel); mpContainerWidgetLayout->addWidget(mpSchoolLevelItemLabel);
mpSchoolLevelBox = new QComboBox(this); mpSchoolLevelBox = new QComboBox(this);
mpSchoolLevelBox->setMinimumHeight(22); mpSchoolLevelBox->setMinimumHeight(22);
mpSchoolLevelBox->setMinimumWidth(LOWER_RESIZE_WIDTH);
mpSchoolLevelBox->setObjectName("DockPaletteWidgetComboBox"); mpSchoolLevelBox->setObjectName("DockPaletteWidgetComboBox");
connect(mpSchoolLevelBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onSchoolLevelChanged(QString))); connect(mpSchoolLevelBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onSchoolLevelChanged(QString)));
mpContainerWidgetLayout->addWidget(mpSchoolLevelBox); mpContainerWidgetLayout->addWidget(mpSchoolLevelBox);
@ -787,6 +786,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpContainerWidgetLayout->addWidget(mpSchoolSubjectsItemLabel); mpContainerWidgetLayout->addWidget(mpSchoolSubjectsItemLabel);
mpSchoolSubjectsBox = new QComboBox(this); mpSchoolSubjectsBox = new QComboBox(this);
mpSchoolSubjectsBox->setMinimumHeight(22); mpSchoolSubjectsBox->setMinimumHeight(22);
mpSchoolSubjectsBox->setMinimumWidth(LOWER_RESIZE_WIDTH);
mpSchoolSubjectsBox->setObjectName("DockPaletteWidgetComboBox"); mpSchoolSubjectsBox->setObjectName("DockPaletteWidgetComboBox");
mpContainerWidgetLayout->addWidget(mpSchoolSubjectsBox); mpContainerWidgetLayout->addWidget(mpSchoolSubjectsBox);
mpSchoolSubjectsValueLabel = new QLabel(this); mpSchoolSubjectsValueLabel = new QLabel(this);
@ -799,6 +799,7 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpContainerWidgetLayout->addWidget(mpSchoolTypeItemLabel); mpContainerWidgetLayout->addWidget(mpSchoolTypeItemLabel);
mpSchoolTypeBox = new QComboBox(this); mpSchoolTypeBox = new QComboBox(this);
mpSchoolTypeBox->setMinimumHeight(22); mpSchoolTypeBox->setMinimumHeight(22);
mpSchoolTypeBox->setMinimumWidth(LOWER_RESIZE_WIDTH);
mpSchoolTypeBox->setObjectName("DockPaletteWidgetComboBox"); mpSchoolTypeBox->setObjectName("DockPaletteWidgetComboBox");
mpContainerWidgetLayout->addWidget(mpSchoolTypeBox); mpContainerWidgetLayout->addWidget(mpSchoolTypeBox);
mpSchoolTypeValueLabel = new QLabel(this); mpSchoolTypeValueLabel = new QLabel(this);
@ -816,12 +817,15 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpContainerWidgetLayout->addWidget(mpLicenceLabel); mpContainerWidgetLayout->addWidget(mpLicenceLabel);
mpLicenceBox = new QComboBox(this); mpLicenceBox = new QComboBox(this);
mpLicenceBox->setMinimumHeight(22); mpLicenceBox->setMinimumHeight(22);
mpLicenceBox->setMinimumWidth(LOWER_RESIZE_WIDTH);
mpLicenceBox->setObjectName("DockPaletteWidgetComboBox"); mpLicenceBox->setObjectName("DockPaletteWidgetComboBox");
mpContainerWidgetLayout->addWidget(mpLicenceBox); mpContainerWidgetLayout->addWidget(mpLicenceBox);
mpLicenceLayout = new QHBoxLayout(0); mpLicenceLayout = new QHBoxLayout(0);
mpLicenceIcon = new QLabel(this); mpLicenceIcon = new QLabel(this);
mpLicenceIcon->setMinimumWidth(LOWER_RESIZE_WIDTH/2);
mpLicenceLayout->addWidget(mpLicenceIcon); mpLicenceLayout->addWidget(mpLicenceIcon);
mpLicenceValueLabel = new QLabel(this); mpLicenceValueLabel = new QLabel(this);
mpLicenceValueLabel->setMinimumWidth(LOWER_RESIZE_WIDTH/2);
mpLicenceLayout->addWidget(mpLicenceValueLabel); mpLicenceLayout->addWidget(mpLicenceValueLabel);
mpContainerWidgetLayout->addLayout(mpLicenceLayout); mpContainerWidgetLayout->addLayout(mpLicenceLayout);
mpContainerWidgetLayout->addStretch(1); mpContainerWidgetLayout->addStretch(1);
@ -941,7 +945,8 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
mpSchoolSubjectsItemLabel->setEnabled(true); mpSchoolSubjectsItemLabel->setEnabled(true);
mpSchoolSubjectsBox->setEnabled(true); mpSchoolSubjectsBox->setEnabled(true);
mpSchoolSubjectsBox->addItems(subjects); mpSchoolSubjectsBox->addItems(subjects);
} else { }
else {
mpSchoolSubjectsItemLabel->setDisabled(true); mpSchoolSubjectsItemLabel->setDisabled(true);
mpSchoolSubjectsBox->setDisabled(true); mpSchoolSubjectsBox->setDisabled(true);
} }
@ -1144,10 +1149,12 @@ bool UBTeacherGuidePageZeroWidget::isModified()
return result; return result;
} }
void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev){ void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev)
{
emit resized(); emit resized();
/* mpScrollArea->resize(width(), height());
QWidget::resizeEvent(ev); mpContainerWidget->resize(width(), height());
*/ QWidget::resizeEvent(ev);
} }
/*************************************************************************** /***************************************************************************

@ -35,6 +35,8 @@ typedef enum
tUBTGZeroPageMode_PRESENTATION tUBTGZeroPageMode_PRESENTATION
}tUBTGZeroPageMode; }tUBTGZeroPageMode;
#define LOWER_RESIZE_WIDTH 50
/*************************************************************************** /***************************************************************************
* class UBTeacherGuideEditionWidget * * class UBTeacherGuideEditionWidget *
***************************************************************************/ ***************************************************************************/

Loading…
Cancel
Save