Merge lp:~alexwolf/stellarium/base-font-size into lp:stellarium

Proposed by Alexander Wolf
Status: Merged
Merged at revision: 6945
Proposed branch: lp:~alexwolf/stellarium/base-font-size
Merge into: lp:stellarium
Diff against target: 277 lines (+37/-22)
18 files modified
plugins/Exoplanets/src/Exoplanets.cpp (+1/-1)
plugins/Novae/src/Novae.cpp (+1/-1)
plugins/Oculars/src/Oculars.cpp (+2/-1)
plugins/Oculars/src/gui/OcularsGuiPanel.cpp (+2/-1)
plugins/Pulsars/src/Pulsars.cpp (+1/-1)
plugins/Quasars/src/Quasars.cpp (+1/-1)
plugins/Satellites/src/Satellite.cpp (+2/-1)
plugins/Supernovae/src/Supernovae.cpp (+1/-1)
src/core/StelApp.cpp (+2/-0)
src/core/StelApp.hpp (+6/-0)
src/core/modules/ConstellationMgr.cpp (+0/-1)
src/core/modules/GridLinesMgr.cpp (+4/-2)
src/core/modules/LandscapeMgr.cpp (+2/-1)
src/core/modules/NebulaMgr.cpp (+1/-1)
src/core/modules/SolarSystem.cpp (+1/-1)
src/core/modules/StarMgr.cpp (+2/-3)
src/gui/ShortcutsDialog.cpp (+2/-1)
src/gui/StelGuiItems.cpp (+6/-4)
To merge this branch: bzr merge lp:~alexwolf/stellarium/base-font-size
Reviewer Review Type Date Requested Status
Fabien Chéreau Needs Fixing
gzotti Pending
Stellarium Pending
Review via email: mp+230228@code.launchpad.net

Description of the change

Avoid unmanaged settings of the font size: use the relative to base_font_size sizes for fonts instead hard-coded settings for font size.

Details of issue: http://www.astronomyforum.net/astronomy-software-forum/184838-increasing-font-size-stellarium.html

To post a comment you must log in.
Revision history for this message
Fabien Chéreau (xalioth) wrote :

Please see inline comments

Revision history for this message
Fabien Chéreau (xalioth) :
review: Needs Fixing
Revision history for this message
Alexander Wolf (alexwolf) wrote :

I can replace commented code with the equivalent code but in ::init() methods this code reassigned.

Example:

in ConstellationMgr::ConstellationMgr() we have asterFont.setPixelSize(15);
and in ConstellationMgr::init() we have asterFont.setPixelSize(14);

Revision history for this message
Fabien Chéreau (xalioth) wrote :

OK, I see

On Mon, Aug 11, 2014 at 2:25 PM, Alexander Wolf <email address hidden>
wrote:

> I can replace commented code with the equivalent code but in ::init()
> methods this code reassigned.
>
> Example:
>
> in ConstellationMgr::ConstellationMgr() we have asterFont.setPixelSize(15);
> and in ConstellationMgr::init() we have asterFont.setPixelSize(14);
> --
>
> https://code.launchpad.net/~alexwolf/stellarium/base-font-size/+merge/230228
> You are reviewing the proposed merge of
> lp:~alexwolf/stellarium/base-font-size into lp:stellarium.
>

Revision history for this message
Alexander Wolf (alexwolf) wrote :

Can I merge it?

Revision history for this message
Fabien Chéreau (xalioth) wrote :

Fine for me!

On Mon, Aug 11, 2014 at 2:45 PM, Alexander Wolf <email address hidden>
wrote:

> Can I merge it?
> --
>
> https://code.launchpad.net/~alexwolf/stellarium/base-font-size/+merge/230228
> You are reviewing the proposed merge of
> lp:~alexwolf/stellarium/base-font-size into lp:stellarium.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Exoplanets/src/Exoplanets.cpp'
2--- plugins/Exoplanets/src/Exoplanets.cpp 2014-04-26 12:38:42 +0000
3+++ plugins/Exoplanets/src/Exoplanets.cpp 2014-08-10 10:42:47 +0000
4@@ -102,7 +102,7 @@
5 setObjectName("Exoplanets");
6 exoplanetsConfigDialog = new ExoplanetsDialog();
7 conf = StelApp::getInstance().getSettings();
8- font.setPixelSize(conf->value("gui/base_font_size", 13).toInt());
9+ font.setPixelSize(StelApp::getInstance().getBaseFontSize());
10 }
11
12 /*
13
14=== modified file 'plugins/Novae/src/Novae.cpp'
15--- plugins/Novae/src/Novae.cpp 2014-04-13 20:23:39 +0000
16+++ plugins/Novae/src/Novae.cpp 2014-08-10 10:42:47 +0000
17@@ -96,7 +96,7 @@
18 setObjectName("Novae");
19 configDialog = new NovaeDialog();
20 conf = StelApp::getInstance().getSettings();
21- font.setPixelSize(conf->value("gui/base_font_size", 13).toInt());
22+ font.setPixelSize(StelApp::getInstance().getBaseFontSize());
23 }
24
25 /*
26
27=== modified file 'plugins/Oculars/src/Oculars.cpp'
28--- plugins/Oculars/src/Oculars.cpp 2014-06-13 23:57:53 +0000
29+++ plugins/Oculars/src/Oculars.cpp 2014-08-10 10:42:47 +0000
30@@ -150,7 +150,8 @@
31 flagInitFOVUsage(false),
32 reticleRotation(0)
33 {
34- font.setPixelSize(14);
35+ // Font size is 14
36+ font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
37
38 ccds = QList<CCD *>();
39 oculars = QList<Ocular *>();
40
41=== modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.cpp'
42--- plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2013-11-13 12:15:53 +0000
43+++ plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2014-08-10 10:42:47 +0000
44@@ -145,7 +145,8 @@
45 fieldLensMultipler = new QGraphicsTextItem(lensControls);
46
47 QFont newFont = font();
48- newFont.setPixelSize(12);
49+ // Font size is 12
50+ newFont.setPixelSize(StelApp::getInstance().getBaseFontSize()-1);
51 setControlsFont(newFont);
52 //setControlsColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9));
53
54
55=== modified file 'plugins/Pulsars/src/Pulsars.cpp'
56--- plugins/Pulsars/src/Pulsars.cpp 2014-04-14 15:40:40 +0000
57+++ plugins/Pulsars/src/Pulsars.cpp 2014-08-10 10:42:47 +0000
58@@ -101,7 +101,7 @@
59 setObjectName("Pulsars");
60 configDialog = new PulsarsDialog();
61 conf = StelApp::getInstance().getSettings();
62- font.setPixelSize(conf->value("gui/base_font_size", 13).toInt());
63+ font.setPixelSize(StelApp::getInstance().getBaseFontSize());
64 }
65
66 /*
67
68=== modified file 'plugins/Quasars/src/Quasars.cpp'
69--- plugins/Quasars/src/Quasars.cpp 2014-04-14 15:40:40 +0000
70+++ plugins/Quasars/src/Quasars.cpp 2014-08-10 10:42:47 +0000
71@@ -102,7 +102,7 @@
72 setObjectName("Quasars");
73 configDialog = new QuasarsDialog();
74 conf = StelApp::getInstance().getSettings();
75- font.setPixelSize(conf->value("gui/base_font_size", 13).toInt());
76+ font.setPixelSize(StelApp::getInstance().getBaseFontSize());
77 }
78
79 /*
80
81=== modified file 'plugins/Satellites/src/Satellite.cpp'
82--- plugins/Satellites/src/Satellite.cpp 2014-05-22 08:08:43 +0000
83+++ plugins/Satellites/src/Satellite.cpp 2014-08-10 10:42:47 +0000
84@@ -79,7 +79,8 @@
85 if (!map.contains("name") || !map.contains("tle1") || !map.contains("tle2"))
86 return;
87
88- font.setPixelSize(16);
89+ // Font size is 16
90+ font.setPixelSize(StelApp::getInstance().getBaseFontSize()+3);
91
92 id = identifier;
93 name = map.value("name").toString();
94
95=== modified file 'plugins/Supernovae/src/Supernovae.cpp'
96--- plugins/Supernovae/src/Supernovae.cpp 2014-04-14 15:40:40 +0000
97+++ plugins/Supernovae/src/Supernovae.cpp 2014-08-10 10:42:47 +0000
98@@ -92,7 +92,7 @@
99 setObjectName("Supernovae");
100 configDialog = new SupernovaeDialog();
101 conf = StelApp::getInstance().getSettings();
102- font.setPixelSize(conf->value("gui/base_font_size", 13).toInt());
103+ font.setPixelSize(StelApp::getInstance().getBaseFontSize());
104 }
105
106 /*
107
108=== modified file 'src/core/StelApp.cpp'
109--- src/core/StelApp.cpp 2014-06-28 13:44:47 +0000
110+++ src/core/StelApp.cpp 2014-08-10 10:42:47 +0000
111@@ -367,6 +367,8 @@
112 confSettings = conf;
113
114 devicePixelsPerPixel = QOpenGLContext::currentContext()->screen()->devicePixelRatio();
115+
116+ setBaseFontSize(confSettings->value("gui/base_font_size", 13).toInt());
117
118 core = new StelCore();
119 if (saveProjW!=-1 && saveProjH!=-1)
120
121=== modified file 'src/core/StelApp.hpp'
122--- src/core/StelApp.hpp 2014-06-28 13:44:47 +0000
123+++ src/core/StelApp.hpp 2014-08-10 10:42:47 +0000
124@@ -163,6 +163,10 @@
125 //! computer screen with 96 pixel per inch (reference for tuning sizes).
126 float getGlobalScalingRatio() const {return globalScalingRatio;}
127 void setGlobalScalingRatio(float r) {globalScalingRatio=r;}
128+
129+ //! Get the size of font
130+ int getBaseFontSize() const { return baseFontSize; }
131+ void setBaseFontSize(int s) { baseFontSize=s; }
132
133 //! Get the GUI instance implementing the abstract GUI interface.
134 StelGuiBase* getGui() const {return stelGui;}
135@@ -332,6 +336,8 @@
136 qint64 totalUsedCacheSize;
137
138 QList<StelProgressController*> progressControllers;
139+
140+ int baseFontSize;
141 };
142
143 #endif // _STELAPP_HPP_
144
145=== modified file 'src/core/modules/ConstellationMgr.cpp'
146--- src/core/modules/ConstellationMgr.cpp 2014-02-18 06:36:58 +0000
147+++ src/core/modules/ConstellationMgr.cpp 2014-08-10 10:42:47 +0000
148@@ -59,7 +59,6 @@
149 setObjectName("ConstellationMgr");
150 Q_ASSERT(hipStarMgr);
151 isolateSelected = false;
152- asterFont.setPixelSize(15);
153 }
154
155 ConstellationMgr::~ConstellationMgr()
156
157=== modified file 'src/core/modules/GridLinesMgr.cpp'
158--- src/core/modules/GridLinesMgr.cpp 2014-04-18 23:52:29 +0000
159+++ src/core/modules/GridLinesMgr.cpp 2014-08-10 10:42:47 +0000
160@@ -99,7 +99,8 @@
161 // rms added color as parameter
162 SkyGrid::SkyGrid(StelCore::FrameType frame) : color(0.2,0.2,0.2), frameType(frame)
163 {
164- font.setPixelSize(12);
165+ // Font size is 12
166+ font.setPixelSize(StelApp::getInstance().getBaseFontSize()-1);
167 }
168
169 SkyGrid::~SkyGrid()
170@@ -522,7 +523,8 @@
171
172 SkyLine::SkyLine(SKY_LINE_TYPE _line_type) : color(0.f, 0.f, 1.f)
173 {
174- font.setPixelSize(14);
175+ // Font size is 14
176+ font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
177 line_type = _line_type;
178
179 updateLabel();
180
181=== modified file 'src/core/modules/LandscapeMgr.cpp'
182--- src/core/modules/LandscapeMgr.cpp 2014-06-20 01:09:08 +0000
183+++ src/core/modules/LandscapeMgr.cpp 2014-08-10 10:42:47 +0000
184@@ -72,7 +72,8 @@
185
186 Cardinals::Cardinals(float _radius) : radius(_radius), color(0.6,0.2,0.2)
187 {
188- font.setPixelSize(30);
189+ // Font size is 30
190+ font.setPixelSize(StelApp::getInstance().getBaseFontSize()+17);
191 // Default labels - if sky locale specified, loaded later
192 // Improvement for gettext translation
193 sNorth = "N";
194
195=== modified file 'src/core/modules/NebulaMgr.cpp'
196--- src/core/modules/NebulaMgr.cpp 2014-04-13 20:09:47 +0000
197+++ src/core/modules/NebulaMgr.cpp 2014-08-10 10:42:47 +0000
198@@ -100,7 +100,7 @@
199 QSettings* conf = StelApp::getInstance().getSettings();
200 Q_ASSERT(conf);
201
202- nebulaFont.setPixelSize(StelApp::getInstance().getSettings()->value("gui/base_font_size", 13).toInt());
203+ nebulaFont.setPixelSize(StelApp::getInstance().getBaseFontSize());
204 Nebula::texCircle = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb.png"); // Load circle texture
205 Nebula::texGalaxy = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gal.png"); // Load ellipse texture
206 Nebula::texOpenCluster = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_ocl.png"); // Load open cluster marker texture
207
208=== modified file 'src/core/modules/SolarSystem.cpp'
209--- src/core/modules/SolarSystem.cpp 2014-07-27 19:44:13 +0000
210+++ src/core/modules/SolarSystem.cpp 2014-08-10 10:42:47 +0000
211@@ -69,7 +69,7 @@
212 , flagMarker(false)
213 , allTrails(NULL)
214 {
215- planetNameFont.setPixelSize(StelApp::getInstance().getSettings()->value("gui/base_font_size", 13).toInt());
216+ planetNameFont.setPixelSize(StelApp::getInstance().getBaseFontSize());
217 setObjectName("SolarSystem");
218 }
219
220
221=== modified file 'src/core/modules/StarMgr.cpp'
222--- src/core/modules/StarMgr.cpp 2014-06-23 14:48:44 +0000
223+++ src/core/modules/StarMgr.cpp 2014-08-10 10:42:47 +0000
224@@ -135,8 +135,7 @@
225 qFatal("ERROR: StarMgr::StarMgr: no memory");
226 }
227 maxGeodesicGridLevel = -1;
228- lastMaxSearchLevel = -1;
229- starFont.setPixelSize(StelApp::getInstance().getSettings()->value("gui/base_font_size", 13).toInt());
230+ lastMaxSearchLevel = -1;
231 objectMgr = GETSTELMODULE(StelObjectMgr);
232 Q_ASSERT(objectMgr);
233 }
234@@ -319,7 +318,7 @@
235 }
236
237 loadData(starSettings);
238- starFont.setPixelSize(StelApp::getInstance().getSettings()->value("gui/base_font_size", 13).toInt());
239+ starFont.setPixelSize(StelApp::getInstance().getBaseFontSize());
240
241 setFlagStars(conf->value("astro/flag_stars", true).toBool());
242 setFlagLabels(conf->value("astro/flag_star_name",true).toBool());
243
244=== modified file 'src/gui/ShortcutsDialog.cpp'
245--- src/gui/ShortcutsDialog.cpp 2013-10-12 07:57:37 +0000
246+++ src/gui/ShortcutsDialog.cpp 2014-08-10 10:42:47 +0000
247@@ -361,7 +361,8 @@
248 // setup bold font for group lines
249 QFont rootFont = groupItem->font();
250 rootFont.setBold(true);
251- rootFont.setPixelSize(14);
252+ // Font size is 14
253+ rootFont.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
254 groupItem->setFont(rootFont);
255 if (isNew)
256 mainModel->appendRow(groupItem);
257
258=== modified file 'src/gui/StelGuiItems.cpp'
259--- src/gui/StelGuiItems.cpp 2014-06-09 01:02:28 +0000
260+++ src/gui/StelGuiItems.cpp 2014-08-10 10:42:47 +0000
261@@ -335,10 +335,12 @@
262 QColor color = QColor::fromRgbF(1,1,1,1);
263 setColor(color);
264
265- datetime->font().setPixelSize(12);
266- location->font().setPixelSize(12);
267- fov->font().setPixelSize(12);
268- fps->font().setPixelSize(12);
269+ // Font size is 12
270+ int baseFontSize = StelApp::getInstance().getBaseFontSize()-1;
271+ datetime->font().setPixelSize(baseFontSize);
272+ location->font().setPixelSize(baseFontSize);
273+ fov->font().setPixelSize(baseFontSize);
274+ fps->font().setPixelSize(baseFontSize);
275
276 flagShowTime = true;
277 flagShowLocation = true;