Hello,

The default font in TUI was quite small, and gets blurred out especially
when choosing the Gravity labels option. Added custom font configuration,
please find the patch in the attachment. Also moved the settings loading to
a new method, should keep the constructor clean with addition of new config
parameters.

I see that there are many config params for TUI which are not implemented
(such as tui_datetime/tui_short_obj_info). But they are in the default
config.ini. So are those changes available in some branch, or they are
placeholders to be implemented in future ? If it is the latter case, I can
help with that as time permits. Please let me know.

Regards,
Sibi.

=== modified file 'data/default_config.ini'
--- old/data/default_config.ini    2011-12-29 10:59:01 +0000
+++ new/data/default_config.ini    2012-02-19 09:20:41 +0000
@@ -155,6 +155,7 @@

 [tui]
 flag_enable_tui_menu           = true
+tui_font_size                  = 15
 flag_show_gravity_ui           = false
 flag_show_tui_datetime         = false
 flag_show_tui_short_obj_info   = false

=== modified file 'plugins/TextUserInterface/src/TextUserInterface.cpp'
--- old/plugins/TextUserInterface/src/TextUserInterface.cpp    2012-02-18
19:34:39 +0000
+++ new/plugins/TextUserInterface/src/TextUserInterface.cpp    2012-02-19
09:38:25 +0000
@@ -96,7 +96,6 @@
     : dummyDialog(this), tuiActive(false), currentNode(NULL)
 {
     setObjectName("TextUserInterface");
-    font.setPixelSize(15);
 }

 /*************************************************************************
@@ -129,6 +128,9 @@
     //unless you have a good reason. --BM

     StelCore* core = StelApp::getInstance().getCore();
+
+    // Main config.
+    loadConfiguration();
     //Reusing strings from the location dialog
     TuiNode* m1 = new TuiNode(N_("Location"));
     TuiNode* m1_1 = new TuiNodeDouble(N_("Latitude:"),
@@ -482,6 +484,17 @@
 }

 /*************************************************************************
+ Load settings from configuration file.
+*************************************************************************/
+void TextUserInterface::loadConfiguration(void)
+{
+    QSettings* conf = StelApp::getInstance().getSettings();
+    Q_ASSERT(conf);
+
+    font.setPixelSize(conf->value("tui/tui_font_size", 15).toInt());
+}
+
+/*************************************************************************
  Draw our module.
 *************************************************************************/
 void TextUserInterface::draw(StelCore* core)

=== modified file 'plugins/TextUserInterface/src/TextUserInterface.hpp'
--- old/plugins/TextUserInterface/src/TextUserInterface.hpp    2012-01-11
10:50:37 +0000
+++ new/plugins/TextUserInterface/src/TextUserInterface.hpp    2012-02-19
09:10:27 +0000
@@ -43,6 +43,11 @@
     virtual double getCallOrder(StelModuleActionName actionName) const;
     virtual void handleKeys(class QKeyEvent* event);

+
///////////////////////////////////////////////////////////////////////////
+    // Methods specific to TextUserInterface
+    //! Loads the module's configuration from the config file.
+    void loadConfiguration(void);
+
 private slots:
     void setHomePlanet(QString planetName);
     void setAltitude(int altitude);
=== modified file 'data/default_config.ini'
--- old/data/default_config.ini	2011-12-29 10:59:01 +0000
+++ new/data/default_config.ini	2012-02-19 09:20:41 +0000
@@ -155,6 +155,7 @@
 
 [tui]
 flag_enable_tui_menu           = true
+tui_font_size                  = 15
 flag_show_gravity_ui           = false
 flag_show_tui_datetime         = false
 flag_show_tui_short_obj_info   = false

=== modified file 'plugins/TextUserInterface/src/TextUserInterface.cpp'
--- old/plugins/TextUserInterface/src/TextUserInterface.cpp	2012-02-18 19:34:39 +0000
+++ new/plugins/TextUserInterface/src/TextUserInterface.cpp	2012-02-19 09:38:25 +0000
@@ -96,7 +96,6 @@
 	: dummyDialog(this), tuiActive(false), currentNode(NULL)
 {
 	setObjectName("TextUserInterface");
-	font.setPixelSize(15);
 }
 
 /*************************************************************************
@@ -129,6 +128,9 @@
 	//unless you have a good reason. --BM
 	
 	StelCore* core = StelApp::getInstance().getCore();
+
+	// Main config.
+	loadConfiguration(); 
 	//Reusing strings from the location dialog
 	TuiNode* m1 = new TuiNode(N_("Location"));
 	TuiNode* m1_1 = new TuiNodeDouble(N_("Latitude:"),
@@ -482,6 +484,17 @@
 }
 
 /*************************************************************************
+ Load settings from configuration file.
+*************************************************************************/
+void TextUserInterface::loadConfiguration(void)
+{
+	QSettings* conf = StelApp::getInstance().getSettings();
+	Q_ASSERT(conf);
+
+	font.setPixelSize(conf->value("tui/tui_font_size", 15).toInt());
+}
+
+/*************************************************************************
  Draw our module.
 *************************************************************************/
 void TextUserInterface::draw(StelCore* core)

=== modified file 'plugins/TextUserInterface/src/TextUserInterface.hpp'
--- old/plugins/TextUserInterface/src/TextUserInterface.hpp	2012-01-11 10:50:37 +0000
+++ new/plugins/TextUserInterface/src/TextUserInterface.hpp	2012-02-19 09:10:27 +0000
@@ -43,6 +43,11 @@
 	virtual double getCallOrder(StelModuleActionName actionName) const;
 	virtual void handleKeys(class QKeyEvent* event);
 
+	///////////////////////////////////////////////////////////////////////////
+	// Methods specific to TextUserInterface
+	//! Loads the module's configuration from the config file.
+	void loadConfiguration(void);
+
 private slots:
 	void setHomePlanet(QString planetName);
 	void setAltitude(int altitude);

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Stellarium-pubdevel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel

Reply via email to