[qet] [1472] Fixed the widgets alignments in the cell edition widget.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1472
Author:   xavier
Date:     2012-01-22 13:08:52 +0100 (Sun, 22 Jan 2012)
Log Message:
-----------
Fixed the widgets alignments in the cell edition widget.

Modified Paths:
--------------
    branches/0.3/sources/titleblock/templatecellwidget.cpp
    branches/0.3/sources/titleblock/templatecellwidget.h

Modified: branches/0.3/sources/titleblock/templatecellwidget.cpp
===================================================================
--- branches/0.3/sources/titleblock/templatecellwidget.cpp	2012-01-22 10:40:37 UTC (rev 1471)
+++ branches/0.3/sources/titleblock/templatecellwidget.cpp	2012-01-22 12:08:52 UTC (rev 1472)
@@ -44,19 +44,27 @@
 	Initialize layout and widgets.
 */
 void TitleBlockTemplateCellWidget::initWidgets() {
+	// type combo box: always displayed
 	cell_type_label_ = new QLabel(tr("Type de cellule :"));
 	cell_type_input_ = new QComboBox();
 	cell_type_input_ -> addItem(tr("Vide"),  TitleBlockCell::EmptyCell);
 	cell_type_input_ -> addItem(tr("Texte"), TitleBlockCell::TextCell);
 	cell_type_input_ -> addItem(tr("Logo"),  TitleBlockCell::LogoCell);
 	
+	// name input: displayed for text and logo cells
+	name_label_ = new QLabel(tr("Nom :"));
+	name_input_ = new QLineEdit();
+	
+	// widgets specific to empty cells
+	empty_label_ = new QLabel(tr("Attention : les bordures des cellules vides n'apparaissent pas lors du rendu final sur le sch\351ma."));
+	
+	// widgets specific to logo cells
 	logo_label_ = new QLabel(tr("Logo"));
 	logo_input_ = new QComboBox();
 	logo_input_ -> addItem(tr("Aucun logo"));
 	add_logo_input_ = new QPushButton(tr("G\351rer les logos"));
 	
-	name_label_ = new QLabel(tr("Nom :"));
-	name_input_ = new QLineEdit();
+	// widgets specific to text cells
 	label_checkbox_ = new QCheckBox(tr("Afficher un label :"));
 	label_input_ = new QLineEdit();
 	label_input_ -> setReadOnly(true);
@@ -95,12 +103,14 @@
 	value_edition -> addWidget(value_input_);
 	value_edition -> addWidget(value_edit_);
 	
-	/// TODO fix widget alignment when switching cell type
+	cell_editor_type_and_name_layout_ = new QHBoxLayout();
+	cell_editor_type_and_name_layout_ -> addWidget(cell_type_label_);
+	cell_editor_type_and_name_layout_ -> addWidget(cell_type_input_);
+	cell_editor_type_and_name_layout_ -> addWidget(name_label_);
+	cell_editor_type_and_name_layout_ -> addWidget(name_input_);
+	cell_editor_type_and_name_layout_ -> addStretch(5);
+	
 	cell_editor_text_layout_ = new QGridLayout();
-	cell_editor_text_layout_ -> addWidget(cell_type_label_,    0, 0);
-	cell_editor_text_layout_ -> addWidget(cell_type_input_,    0, 1);
-	cell_editor_text_layout_ -> addWidget(name_label_,         0, 2);
-	cell_editor_text_layout_ -> addWidget(name_input_,         0, 3);
 	cell_editor_text_layout_ -> addWidget(label_checkbox_,     2, 0);
 	cell_editor_text_layout_ -> addLayout(label_edition,       2, 1);
 	cell_editor_text_layout_ -> addWidget(value_label_,        3, 0);
@@ -116,8 +126,10 @@
 	cell_editor_text_layout_ -> addWidget(logo_label_,         5, 0);
 	cell_editor_text_layout_ -> addWidget(logo_input_,         5, 1);
 	cell_editor_text_layout_ -> addWidget(add_logo_input_,     5, 2);
+	cell_editor_text_layout_ -> addWidget(empty_label_,        6, 0);
 	cell_editor_text_layout_ -> setColumnStretch(4, 4000);
 	cell_editor_layout_ = new QVBoxLayout();
+	cell_editor_layout_ -> addLayout(cell_editor_type_and_name_layout_);
 	cell_editor_layout_ -> addLayout(cell_editor_text_layout_);
 	cell_editor_layout_ -> addStretch();
 	setLayout(cell_editor_layout_);
@@ -152,6 +164,8 @@
 	name_label_        -> setVisible(cell_type);
 	name_input_        -> setVisible(cell_type);
 	
+	empty_label_       -> setVisible(cell_type == TitleBlockCell::EmptyCell);
+	
 	logo_label_        -> setVisible(cell_type == TitleBlockCell::LogoCell);
 	logo_input_        -> setVisible(cell_type == TitleBlockCell::LogoCell);
 	add_logo_input_    -> setVisible(cell_type == TitleBlockCell::LogoCell);

Modified: branches/0.3/sources/titleblock/templatecellwidget.h
===================================================================
--- branches/0.3/sources/titleblock/templatecellwidget.h	2012-01-22 10:40:37 UTC (rev 1471)
+++ branches/0.3/sources/titleblock/templatecellwidget.h	2012-01-22 12:08:52 UTC (rev 1472)
@@ -45,6 +45,8 @@
 	QLabel    *cell_type_label_;
 	QComboBox *cell_type_input_;
 	
+	QLabel *empty_label_;
+	
 	QLabel      *logo_label_;
 	QComboBox   *logo_input_;
 	QPushButton *add_logo_input_;
@@ -68,6 +70,7 @@
 	QSpinBox      *font_size_input_;
 	QCheckBox     *font_adjust_input_;
 	QVBoxLayout   *cell_editor_layout_;
+	QHBoxLayout   *cell_editor_type_and_name_layout_;
 	QGridLayout   *cell_editor_text_layout_;
 	QHBoxLayout   *cell_editor_image_layout_;
 	


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/