[qet] qet/qet: [5175] Improve the button to choose the standard font used for text fields ( those which are added on folio)

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


Revision: 5175
Author:   nuri
Date:     2017-12-12 07:52:44 +0100 (Tue, 12 Dec 2017)
Log Message:
-----------
Improve the button to choose the standard font used for text fields (those which are added on folio)

Modified Paths:
--------------
    trunk/sources/configpages.cpp
    trunk/sources/configpages.h

Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp	2017-12-12 05:11:07 UTC (rev 5174)
+++ trunk/sources/configpages.cpp	2017-12-12 06:52:44 UTC (rev 5175)
@@ -29,6 +29,7 @@
 #include "qetapp.h"
 #include <QFontDialog>
 #include <QFont>
+#include <QSizePolicy>
 
 /**
  * @brief NewDiagramPage::NewDiagramPage
@@ -253,9 +254,14 @@
 	terminal_exportlist_ = new QCheckBox(tr("Exporter les bornes dans la nomenclature"), projects_view_mode_);
 	m_zoom_out_beyond_folio = new QCheckBox(tr("Autoriser le dézoom au delà du folio"), this);
 	
-	QPushButton *fontButton = new QPushButton(tr("Choix de la police de texte utilisée pour les textes independants")); 
+    QString fontInfos = settings.value("diagramitemfont").toString() + " " +
+                        settings.value("diagramitemsize").toString() + " (" +
+                        settings.value("diagramitemweight").toString() + ", " +
+                        settings.value("diagramitemfont").toString() + ")";
+    font_label = new QLabel(tr("Police des champs de texte"));
+    fontButton = new QPushButton(fontInfos);
+    fontButton->setMinimumHeight(28);
 
-
 	elements_management_ = new QGroupBox(tr("Gestion des éléments"), this);
 	highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les éléments fraîchement intégrés", "configuration option"));
 	default_element_infos_label_ = new QLabel(
@@ -291,7 +297,8 @@
 	appearance_ -> setLayout(appearance_layout);
 	
 	QVBoxLayout *projects_view_mode_layout = new QVBoxLayout;
-	projects_view_mode_layout -> addWidget(windowed_mode_);
+    QHBoxLayout *font_view_layout = new QHBoxLayout;
+    projects_view_mode_layout -> addWidget(windowed_mode_);
 	projects_view_mode_layout -> addWidget(tabbed_mode_);
 	projects_view_mode_layout -> addWidget(m_zoom_out_beyond_folio);
 	projects_view_mode_layout -> addWidget(use_trackpad_);
@@ -298,9 +305,13 @@
 	projects_view_mode_layout -> addWidget(save_label_paste_);
 	projects_view_mode_layout -> addWidget(folio_panel_);
 	projects_view_mode_layout -> addWidget(terminal_exportlist_);
-	projects_view_mode_layout->  addWidget(fontButton, 0, 0);
-	connect(fontButton, SIGNAL(clicked()), this, SLOT(setFont()));
-	projects_view_mode_ -> setLayout(projects_view_mode_layout);
+    font_view_layout->addWidget(font_label, 1);
+    font_view_layout->addWidget(fontButton, 0);
+    projects_view_mode_layout->  addLayout(font_view_layout);
+    projects_view_mode_ -> setLayout(projects_view_mode_layout);
+
+    connect(fontButton, SIGNAL(clicked()), this, SLOT(setFont()));
+
 	
 	QVBoxLayout *elements_management_layout = new QVBoxLayout();
 	elements_management_layout -> addWidget(highlight_integrated_elements_);
@@ -407,7 +418,7 @@
 	lang_combo_box->addItem(QET::Icons::nl,           tr("Pays-Bas"), "nl");
 	lang_combo_box->addItem(QET::Icons::be,           tr("Belgique-Flemish"), "be");
 
-	//set curent index to the lang found in setting file
+    //set current index to the lang found in setting file
 	//if lang doesn't exist set to system
 	for (int i=0; i<lang_combo_box->count(); i++) {
 		if (lang_combo_box->itemData(i).toString() == settings.value("lang").toString()) {
@@ -527,7 +538,7 @@
 void GeneralConfigurationPage::setFont()
 {
 	bool ok;
-	QSettings settings;
+    QSettings settings;
 	QFont font = QFontDialog::getFont(&ok, QFont(), this);
 	if (ok) {
 		settings.setValue("diagramitemfont", font.family());
@@ -534,6 +545,11 @@
 		settings.setValue("diagramitemsize", font.pointSize());
 		settings.setValue("diagramitemweight", font.weight());
 		settings.setValue("diagramitemstyle", font.styleName());
+        QString fontInfos = settings.value("diagramitemfont").toString() + " " +
+                            settings.value("diagramitemsize").toString() + " (" +
+                            settings.value("diagramitemweight").toString() + ", " +
+                            settings.value("diagramitemfont").toString() + ")";
+        fontButton->setText(fontInfos);
 	}
 }
 

Modified: trunk/sources/configpages.h
===================================================================
--- trunk/sources/configpages.h	2017-12-12 05:11:07 UTC (rev 5174)
+++ trunk/sources/configpages.h	2017-12-12 06:52:44 UTC (rev 5175)
@@ -116,6 +116,7 @@
 	QGroupBox *lang_group_box;
 	QComboBox *lang_combo_box;
 	QLabel *lang_label;
+    QLabel *font_label;
 	QPushButton *fontButton;
 };
 


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