Merge lp:~stellarium/stellarium/night-mode-shader into lp:stellarium
- night-mode-shader
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Alexander Wolf |
Approved revision: | 6321 |
Merged at revision: | 6329 |
Proposed branch: | lp:~stellarium/stellarium/night-mode-shader |
Merge into: | lp:stellarium |
Diff against target: |
1598 lines (+141/-484) 51 files modified
data/default_config.ini (+0/-29) data/qml/main.qml (+33/-9) plugins/AngleMeasure/src/AngleMeasure.cpp (+3/-14) plugins/CompassMarks/src/CompassMarks.cpp (+1/-7) plugins/Exoplanets/src/Exoplanet.cpp (+1/-4) plugins/Novae/src/Nova.cpp (+1/-4) plugins/Oculars/src/Oculars.cpp (+1/-5) plugins/Oculars/src/gui/OcularsGuiPanel.cpp (+3/-28) plugins/Oculars/src/gui/OcularsGuiPanel.hpp (+0/-2) plugins/Pulsars/src/Pulsar.cpp (+1/-4) plugins/Quasars/src/Quasar.cpp (+1/-4) plugins/Satellites/src/Satellite.cpp (+9/-30) plugins/Satellites/src/Satellite.hpp (+1/-4) plugins/Satellites/src/Satellites.cpp (+1/-15) plugins/Satellites/src/Satellites.hpp (+0/-1) plugins/Supernovae/src/Supernova.cpp (+1/-4) plugins/TelescopeControl/src/clients/TelescopeClient.hpp (+1/-1) src/StelMainView.cpp (+3/-1) src/core/StelApp.cpp (+3/-4) src/core/StelApp.hpp (+3/-2) src/core/StelSkyDrawer.cpp (+4/-15) src/core/modules/Constellation.cpp (+1/-4) src/core/modules/GridLinesMgr.cpp (+1/-13) src/core/modules/Landscape.cpp (+6/-20) src/core/modules/MilkyWay.cpp (+1/-5) src/core/modules/Nebula.cpp (+1/-6) src/core/modules/NebulaMgr.cpp (+2/-5) src/core/modules/Planet.cpp (+5/-23) src/core/modules/SolarSystem.cpp (+1/-4) src/core/modules/StarMgr.cpp (+0/-3) src/core/modules/StarWrapper.hpp (+1/-1) src/core/modules/ZoneArray.cpp (+1/-1) src/gui/ConfigurationDialog.cpp (+1/-22) src/gui/ConfigurationDialog.hpp (+1/-2) src/gui/DateTimeDialog.cpp (+2/-1) src/gui/DateTimeDialog.hpp (+1/-1) src/gui/HelpDialog.cpp (+1/-22) src/gui/HelpDialog.hpp (+1/-2) src/gui/LocationDialog.cpp (+3/-14) src/gui/LocationDialog.hpp (+2/-4) src/gui/SearchDialog.cpp (+1/-1) src/gui/SearchDialog.hpp (+1/-1) src/gui/ShortcutsDialog.cpp (+2/-1) src/gui/ShortcutsDialog.hpp (+1/-1) src/gui/SkyGui.cpp (+4/-22) src/gui/StelDialog.cpp (+15/-10) src/gui/StelGui.cpp (+7/-7) src/gui/StelGuiItems.cpp (+5/-56) src/gui/StelGuiItems.hpp (+0/-21) src/gui/ViewDialog.cpp (+1/-22) src/gui/ViewDialog.hpp (+1/-2) |
To merge this branch: | bzr merge lp:~stellarium/stellarium/night-mode-shader |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexander Wolf | Approve | ||
Review via email: mp+191558@code.launchpad.net |
Commit message
Description of the change
This branch uses a fragment shader to implement the night mode.
It makes most of the code much simpler because the modules and the GUI don't need to check for night mode anymore.
I tested it on my linux machine, but it would be good to check if there is no problem on windows or different machines before merging.
gzotti (georg-zotti) wrote : | # |
Seems good. Win7/64, NVidia GTX580M, Qt5.1.1
I have not dealt with QML so far. What happens with plugin content rendered by other shaders? Will this be mixed/filtered with the QML?
G.
Guillaume Chereau (guillaume-chereau) wrote : | # |
On Thu, Oct 17, 2013 at 7:24 PM, gzotti <email address hidden> wrote:
> Seems good. Win7/64, NVidia GTX580M, Qt5.1.1
>
> I have not dealt with QML so far. What happens with plugin content rendered by other shaders? Will this be mixed/filtered with the QML?
Yes, normally the ShaderEffect forces Qt to render all the scene into
a buffer, and then apply the effect on this buffer, so this should be
OK.
--
Guillaume
<email address hidden>
+886 970422910
Alexander Wolf (alexwolf) wrote : | # |
I'm added configurable color of planet's pointer and now this patch possible has conflicts in SolarSystem.cpp file.
barrykgerdes (barrygastro) wrote : | # |
Hi Alex
A few days ago I mentioned how washed out all the planets were in Windows
It is something to do with how the program handles the lighting = true/false in the ssystem.ini file
I have done a blanket change to the entry lighting = true to lighting = false as the default for this parameter.
This has fixed the problem.
Barry
Preview Diff
1 | === modified file 'data/default_config.ini' | |||
2 | --- data/default_config.ini 2013-10-07 14:36:24 +0000 | |||
3 | +++ data/default_config.ini 2013-10-17 06:10:44 +0000 | |||
4 | @@ -149,35 +149,6 @@ | |||
5 | 149 | script_console_function_color = 0.0,1.0,0.0 | 149 | script_console_function_color = 0.0,1.0,0.0 |
6 | 150 | script_console_constant_color = 1.0,0.5,0.5 | 150 | script_console_constant_color = 1.0,0.5,0.5 |
7 | 151 | 151 | ||
8 | 152 | [night_color] | ||
9 | 153 | default_color = 0.7,0.0,0.0 | ||
10 | 154 | gui_base_color = 0.7,0.0,0.0 | ||
11 | 155 | gui_text_color = 0.9,0.0,0.0 | ||
12 | 156 | azimuthal_color = 0.4,0.0,0.0 | ||
13 | 157 | equatorial_color = 0.4,0.0,0.0 | ||
14 | 158 | equator_color = 0.6,0.0,0.0 | ||
15 | 159 | ecliptic_color = 0.6,0.0,0.0 | ||
16 | 160 | meridian_color = 0.6,0.0,0.0 | ||
17 | 161 | horizon_color = 0.2,0.6,0.2 | ||
18 | 162 | const_lines_color = 0.2,0.0,0.0 | ||
19 | 163 | const_names_color = 0.5,0.0,0.0 | ||
20 | 164 | const_boundary_color = 0.3,0.0,0.0 | ||
21 | 165 | nebula_label_color = 0.7,0.0,0.0 | ||
22 | 166 | nebula_circle_color = 1.0,0.0,0.0 | ||
23 | 167 | star_label_color = 0.5,0.0,0.0 | ||
24 | 168 | star_circle_color = 0.2,0.2,0.8 | ||
25 | 169 | cardinal_color = 0.8,0.0,0.0 | ||
26 | 170 | planet_names_color = 0.7,0.0,0.0 | ||
27 | 171 | planet_orbits_color = 0.7,0.0,0.0 | ||
28 | 172 | object_trails_color = 1.0,0.0,0.0 | ||
29 | 173 | telescope_label_color = 0.6,0.0,0.0 | ||
30 | 174 | telescope_circle_color = 0.6,0.0,0.0 | ||
31 | 175 | script_console_keyword_color = 1.0,0.0,0.0 | ||
32 | 176 | script_console_module_color = 1.0,0.0,0.0 | ||
33 | 177 | script_console_comment_color = 1.0,0.0,0.0 | ||
34 | 178 | script_console_function_color = 1.0,0.0,0.0 | ||
35 | 179 | script_console_constant_color = 1.0,0.0,0.0 | ||
36 | 180 | |||
37 | 181 | [tui] | 152 | [tui] |
38 | 182 | flag_enable_tui_menu = true | 153 | flag_enable_tui_menu = true |
39 | 183 | flag_show_gravity_ui = false | 154 | flag_show_gravity_ui = false |
40 | 184 | 155 | ||
41 | === modified file 'data/qml/main.qml' | |||
42 | --- data/qml/main.qml 2013-08-28 18:30:47 +0000 | |||
43 | +++ data/qml/main.qml 2013-10-17 06:10:44 +0000 | |||
44 | @@ -1,16 +1,40 @@ | |||
45 | 1 | 1 | ||
46 | 2 | import QtQuick 1.0 | 2 | import QtQuick 1.0 |
47 | 3 | import Qt.labs.shaders 1.0 | ||
48 | 3 | import Stellarium 1.0 | 4 | import Stellarium 1.0 |
49 | 4 | 5 | ||
50 | 5 | Rectangle { | 6 | Rectangle { |
51 | 6 | 7 | ||
61 | 7 | StelSky { | 8 | Item { |
62 | 8 | anchors.fill: parent | 9 | id: all |
63 | 9 | } | 10 | anchors.fill: parent |
64 | 10 | 11 | StelSky { | |
65 | 11 | // This will generate a single big QGraphicsWidget, and initialize | 12 | anchors.fill: parent |
66 | 12 | // Stellarium GUI into it. | 13 | } |
67 | 13 | StelGui { | 14 | |
68 | 14 | anchors.fill: parent | 15 | // This will generate a single big QGraphicsWidget, and initialize |
69 | 15 | } | 16 | // Stellarium GUI into it. |
70 | 17 | StelGui { | ||
71 | 18 | anchors.fill: parent | ||
72 | 19 | } | ||
73 | 20 | } | ||
74 | 21 | |||
75 | 22 | ShaderEffectItem { | ||
76 | 23 | property variant source: ShaderEffectSource { sourceItem: all; hideSource: true } | ||
77 | 24 | anchors.fill: all | ||
78 | 25 | blending: false | ||
79 | 26 | visible: stelApp.nightMode | ||
80 | 27 | |||
81 | 28 | fragmentShader: " | ||
82 | 29 | varying highp vec2 qt_TexCoord0; | ||
83 | 30 | uniform sampler2D source; | ||
84 | 31 | void main(void) | ||
85 | 32 | { | ||
86 | 33 | mediump vec3 color = texture2D(source, qt_TexCoord0).rgb; | ||
87 | 34 | mediump float luminance = max(max(color.r, color.g), color.b); | ||
88 | 35 | gl_FragColor = vec4(luminance, 0.0, 0.0, 1.0); | ||
89 | 36 | |||
90 | 37 | } | ||
91 | 38 | " | ||
92 | 39 | } | ||
93 | 16 | } | 40 | } |
94 | 17 | 41 | ||
95 | === modified file 'plugins/AngleMeasure/src/AngleMeasure.cpp' | |||
96 | --- plugins/AngleMeasure/src/AngleMeasure.cpp 2013-10-01 22:05:10 +0000 | |||
97 | +++ plugins/AngleMeasure/src/AngleMeasure.cpp 2013-10-17 06:10:44 +0000 | |||
98 | @@ -151,17 +151,6 @@ | |||
99 | 151 | const StelProjectorP prj = core->getProjection(StelCore::FrameEquinoxEqu); | 151 | const StelProjectorP prj = core->getProjection(StelCore::FrameEquinoxEqu); |
100 | 152 | StelPainter painter(prj); | 152 | StelPainter painter(prj); |
101 | 153 | painter.setFont(font); | 153 | painter.setFont(font); |
102 | 154 | Vec3f tColor, lColor; | ||
103 | 155 | if (StelApp::getInstance().getVisionModeNight()) | ||
104 | 156 | { | ||
105 | 157 | tColor = StelUtils::getNightColor(textColor); | ||
106 | 158 | lColor = StelUtils::getNightColor(lineColor); | ||
107 | 159 | } | ||
108 | 160 | else | ||
109 | 161 | { | ||
110 | 162 | tColor = textColor; | ||
111 | 163 | lColor = lineColor; | ||
112 | 164 | } | ||
113 | 165 | 154 | ||
114 | 166 | if (lineVisible.getInterstate() > 0.000001f) | 155 | if (lineVisible.getInterstate() > 0.000001f) |
115 | 167 | { | 156 | { |
116 | @@ -172,7 +161,7 @@ | |||
117 | 172 | Vec3d xy; | 161 | Vec3d xy; |
118 | 173 | if (prj->project(perp1EndPoint,xy)) | 162 | if (prj->project(perp1EndPoint,xy)) |
119 | 174 | { | 163 | { |
121 | 175 | painter.setColor(tColor[0], tColor[1], tColor[2], lineVisible.getInterstate()); | 164 | painter.setColor(textColor[0], textColor[1], textColor[2], lineVisible.getInterstate()); |
122 | 176 | painter.drawText(xy[0], xy[1], angleText, 0, 15, 15); | 165 | painter.drawText(xy[0], xy[1], angleText, 0, 15, 15); |
123 | 177 | } | 166 | } |
124 | 178 | 167 | ||
125 | @@ -181,7 +170,7 @@ | |||
126 | 181 | glEnable(GL_BLEND); | 170 | glEnable(GL_BLEND); |
127 | 182 | 171 | ||
128 | 183 | // main line is a great circle | 172 | // main line is a great circle |
130 | 184 | painter.setColor(lColor[0], lColor[1], lColor[2], lineVisible.getInterstate()); | 173 | painter.setColor(lineColor[0], lineColor[1], lineColor[2], lineVisible.getInterstate()); |
131 | 185 | painter.drawGreatCircleArc(startPoint, endPoint, NULL); | 174 | painter.drawGreatCircleArc(startPoint, endPoint, NULL); |
132 | 186 | 175 | ||
133 | 187 | // End lines | 176 | // End lines |
134 | @@ -191,7 +180,7 @@ | |||
135 | 191 | 180 | ||
136 | 192 | if (messageFader.getInterstate() > 0.000001f) | 181 | if (messageFader.getInterstate() > 0.000001f) |
137 | 193 | { | 182 | { |
139 | 194 | painter.setColor(tColor[0], tColor[1], tColor[2], messageFader.getInterstate()); | 183 | painter.setColor(textColor[0], textColor[1], textColor[2], messageFader.getInterstate()); |
140 | 195 | int x = 83; | 184 | int x = 83; |
141 | 196 | int y = 120; | 185 | int y = 120; |
142 | 197 | int ls = painter.getFontMetrics().lineSpacing(); | 186 | int ls = painter.getFontMetrics().lineSpacing(); |
143 | 198 | 187 | ||
144 | === modified file 'plugins/CompassMarks/src/CompassMarks.cpp' | |||
145 | --- plugins/CompassMarks/src/CompassMarks.cpp 2013-10-01 22:05:10 +0000 | |||
146 | +++ plugins/CompassMarks/src/CompassMarks.cpp 2013-10-17 06:10:44 +0000 | |||
147 | @@ -146,13 +146,7 @@ | |||
148 | 146 | StelPainter painter(prj); | 146 | StelPainter painter(prj); |
149 | 147 | painter.setFont(font); | 147 | painter.setFont(font); |
150 | 148 | 148 | ||
158 | 149 | Vec3f mColor; | 149 | painter.setColor(markColor[0], markColor[1], markColor[2], markFader.getInterstate()); |
152 | 150 | if (StelApp::getInstance().getVisionModeNight()) | ||
153 | 151 | mColor = StelUtils::getNightColor(markColor); | ||
154 | 152 | else | ||
155 | 153 | mColor = markColor; | ||
156 | 154 | |||
157 | 155 | painter.setColor(mColor[0], mColor[1], mColor[2], markFader.getInterstate()); | ||
159 | 156 | glDisable(GL_TEXTURE_2D); | 150 | glDisable(GL_TEXTURE_2D); |
160 | 157 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 151 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
161 | 158 | glEnable(GL_BLEND); | 152 | glEnable(GL_BLEND); |
162 | 159 | 153 | ||
163 | === modified file 'plugins/Exoplanets/src/Exoplanet.cpp' | |||
164 | --- plugins/Exoplanets/src/Exoplanet.cpp 2013-10-16 16:55:17 +0000 | |||
165 | +++ plugins/Exoplanets/src/Exoplanet.cpp 2013-10-17 06:10:44 +0000 | |||
166 | @@ -342,7 +342,7 @@ | |||
167 | 342 | 342 | ||
168 | 343 | Vec3f Exoplanet::getInfoColor(void) const | 343 | Vec3f Exoplanet::getInfoColor(void) const |
169 | 344 | { | 344 | { |
171 | 345 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : Vec3f(1.0, 1.0, 1.0); | 345 | return Vec3f(1.0, 1.0, 1.0); |
172 | 346 | } | 346 | } |
173 | 347 | 347 | ||
174 | 348 | float Exoplanet::getVMagnitude(const StelCore* core) const | 348 | float Exoplanet::getVMagnitude(const StelCore* core) const |
175 | @@ -411,9 +411,6 @@ | |||
176 | 411 | if (hasHabitableExoplanets) | 411 | if (hasHabitableExoplanets) |
177 | 412 | color = Vec3f(1.f,0.5f,0.f); | 412 | color = Vec3f(1.f,0.5f,0.f); |
178 | 413 | 413 | ||
179 | 414 | if (StelApp::getInstance().getVisionModeNight()) | ||
180 | 415 | color = StelUtils::getNightColor(color); | ||
181 | 416 | |||
182 | 417 | double mag = getVMagnitudeWithExtinction(core); | 414 | double mag = getVMagnitudeWithExtinction(core); |
183 | 418 | 415 | ||
184 | 419 | StelUtils::spheToRect(RA, DE, XYZ); | 416 | StelUtils::spheToRect(RA, DE, XYZ); |
185 | 420 | 417 | ||
186 | === modified file 'plugins/Novae/src/Nova.cpp' | |||
187 | --- plugins/Novae/src/Nova.cpp 2013-10-16 16:55:17 +0000 | |||
188 | +++ plugins/Novae/src/Nova.cpp 2013-10-17 06:10:44 +0000 | |||
189 | @@ -150,7 +150,7 @@ | |||
190 | 150 | 150 | ||
191 | 151 | Vec3f Nova::getInfoColor(void) const | 151 | Vec3f Nova::getInfoColor(void) const |
192 | 152 | { | 152 | { |
194 | 153 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : Vec3f(1.0, 1.0, 1.0); | 153 | return Vec3f(1.0, 1.0, 1.0); |
195 | 154 | } | 154 | } |
196 | 155 | 155 | ||
197 | 156 | float Nova::getVMagnitude(const StelCore* core) const | 156 | float Nova::getVMagnitude(const StelCore* core) const |
198 | @@ -285,9 +285,6 @@ | |||
199 | 285 | StarMgr* smgr = GETSTELMODULE(StarMgr); // It's need for checking displaying of labels for stars | 285 | StarMgr* smgr = GETSTELMODULE(StarMgr); // It's need for checking displaying of labels for stars |
200 | 286 | 286 | ||
201 | 287 | Vec3f color = Vec3f(1.f,1.f,1.f); | 287 | Vec3f color = Vec3f(1.f,1.f,1.f); |
202 | 288 | if (StelApp::getInstance().getVisionModeNight()) | ||
203 | 289 | color = StelUtils::getNightColor(color); | ||
204 | 290 | |||
205 | 291 | RCMag rcMag; | 288 | RCMag rcMag; |
206 | 292 | float size, shift; | 289 | float size, shift; |
207 | 293 | double mag; | 290 | double mag; |
208 | 294 | 291 | ||
209 | === modified file 'plugins/Oculars/src/Oculars.cpp' | |||
210 | --- plugins/Oculars/src/Oculars.cpp 2013-10-11 18:31:08 +0000 | |||
211 | +++ plugins/Oculars/src/Oculars.cpp 2013-10-17 06:10:44 +0000 | |||
212 | @@ -809,11 +809,7 @@ | |||
213 | 809 | xPosition = xPosition - 0.5 * (metrics.width(labelText)); | 809 | xPosition = xPosition - 0.5 * (metrics.width(labelText)); |
214 | 810 | int yPosition = projectorParams.viewportCenter[1]; | 810 | int yPosition = projectorParams.viewportCenter[1]; |
215 | 811 | yPosition = yPosition - 0.5 * (metrics.height()); | 811 | yPosition = yPosition - 0.5 * (metrics.height()); |
221 | 812 | const char *tcolor; | 812 | const char *tcolor = "#99FF99"; |
217 | 813 | if (StelApp::getInstance().getVisionModeNight()) | ||
218 | 814 | tcolor = "#C40303"; | ||
219 | 815 | else | ||
220 | 816 | tcolor = "#99FF99"; | ||
222 | 817 | usageMessageLabelID = labelManager->labelScreen(labelText, xPosition, yPosition, | 813 | usageMessageLabelID = labelManager->labelScreen(labelText, xPosition, yPosition, |
223 | 818 | true, font.pixelSize(), tcolor); | 814 | true, font.pixelSize(), tcolor); |
224 | 819 | } | 815 | } |
225 | 820 | 816 | ||
226 | === modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.cpp' | |||
227 | --- plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2013-10-01 22:05:10 +0000 | |||
228 | +++ plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2013-10-17 06:10:44 +0000 | |||
229 | @@ -1033,36 +1033,11 @@ | |||
230 | 1033 | fieldLensMultipler->setFont(font); | 1033 | fieldLensMultipler->setFont(font); |
231 | 1034 | } | 1034 | } |
232 | 1035 | 1035 | ||
233 | 1036 | void OcularsGuiPanel::setButtonsNightMode(bool nightMode) | ||
234 | 1037 | { | ||
235 | 1038 | //Reused from SkyGui, with modifications | ||
236 | 1039 | foreach (QGraphicsItem *child, QGraphicsItem::childItems()) | ||
237 | 1040 | { | ||
238 | 1041 | foreach (QGraphicsItem *grandchild, child->childItems()) | ||
239 | 1042 | { | ||
240 | 1043 | StelButton* button = qgraphicsitem_cast<StelButton*>(grandchild); | ||
241 | 1044 | if (button) | ||
242 | 1045 | button->setRedMode(nightMode); | ||
243 | 1046 | } | ||
244 | 1047 | } | ||
245 | 1048 | } | ||
246 | 1049 | |||
247 | 1050 | void OcularsGuiPanel::setColorScheme(const QString &schemeName) | 1036 | void OcularsGuiPanel::setColorScheme(const QString &schemeName) |
248 | 1051 | { | 1037 | { |
263 | 1052 | if (schemeName == "night_color") | 1038 | borderPath->setPen(QColor::fromRgbF(0.7,0.7,0.7,0.5)); |
264 | 1053 | { | 1039 | borderPath->setBrush(QColor::fromRgbF(0.15, 0.16, 0.19, 0.2)); |
265 | 1054 | borderPath->setPen(QColor::fromRgbF(0.7,0.2,0.2,0.5)); | 1040 | setControlsColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9)); |
252 | 1055 | borderPath->setBrush(QColor::fromRgbF(0.23, 0.13, 0.03, 0.2)); | ||
253 | 1056 | setControlsColor(QColor::fromRgbF(0.9, 0.33, 0.33, 0.9)); | ||
254 | 1057 | setButtonsNightMode(true); | ||
255 | 1058 | } | ||
256 | 1059 | else | ||
257 | 1060 | { | ||
258 | 1061 | borderPath->setPen(QColor::fromRgbF(0.7,0.7,0.7,0.5)); | ||
259 | 1062 | borderPath->setBrush(QColor::fromRgbF(0.15, 0.16, 0.19, 0.2)); | ||
260 | 1063 | setControlsColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9)); | ||
261 | 1064 | setButtonsNightMode(false); | ||
262 | 1065 | } | ||
266 | 1066 | } | 1041 | } |
267 | 1067 | 1042 | ||
268 | 1068 | QPixmap OcularsGuiPanel::createPixmapFromText(const QString& text, | 1043 | QPixmap OcularsGuiPanel::createPixmapFromText(const QString& text, |
269 | 1069 | 1044 | ||
270 | === modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.hpp' | |||
271 | --- plugins/Oculars/src/gui/OcularsGuiPanel.hpp 2013-02-27 17:01:24 +0000 | |||
272 | +++ plugins/Oculars/src/gui/OcularsGuiPanel.hpp 2013-10-17 06:10:44 +0000 | |||
273 | @@ -130,8 +130,6 @@ | |||
274 | 130 | 130 | ||
275 | 131 | void setControlsColor(const QColor& color); | 131 | void setControlsColor(const QColor& color); |
276 | 132 | void setControlsFont(const QFont& font); | 132 | void setControlsFont(const QFont& font); |
277 | 133 | //! Sets the night mode flag on all StelButton-s. | ||
278 | 134 | void setButtonsNightMode(bool nightMode); | ||
279 | 135 | 133 | ||
280 | 136 | static QPixmap createPixmapFromText(const QString& text, | 134 | static QPixmap createPixmapFromText(const QString& text, |
281 | 137 | int width, | 135 | int width, |
282 | 138 | 136 | ||
283 | === modified file 'plugins/Pulsars/src/Pulsar.cpp' | |||
284 | --- plugins/Pulsars/src/Pulsar.cpp 2013-10-16 16:55:17 +0000 | |||
285 | +++ plugins/Pulsars/src/Pulsar.cpp 2013-10-17 06:10:44 +0000 | |||
286 | @@ -228,7 +228,7 @@ | |||
287 | 228 | 228 | ||
288 | 229 | Vec3f Pulsar::getInfoColor(void) const | 229 | Vec3f Pulsar::getInfoColor(void) const |
289 | 230 | { | 230 | { |
291 | 231 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : Vec3f(1.0, 1.0, 1.0); | 231 | return Vec3f(1.0, 1.0, 1.0); |
292 | 232 | } | 232 | } |
293 | 233 | 233 | ||
294 | 234 | float Pulsar::getVMagnitude(const StelCore* core) const | 234 | float Pulsar::getVMagnitude(const StelCore* core) const |
295 | @@ -331,9 +331,6 @@ | |||
296 | 331 | StelSkyDrawer* sd = core->getSkyDrawer(); | 331 | StelSkyDrawer* sd = core->getSkyDrawer(); |
297 | 332 | 332 | ||
298 | 333 | Vec3f color = Vec3f(0.4f,0.5f,1.2f); | 333 | Vec3f color = Vec3f(0.4f,0.5f,1.2f); |
299 | 334 | if (StelApp::getInstance().getVisionModeNight()) | ||
300 | 335 | color = StelUtils::getNightColor(color); | ||
301 | 336 | |||
302 | 337 | double mag = getVMagnitudeWithExtinction(core); | 334 | double mag = getVMagnitudeWithExtinction(core); |
303 | 338 | 335 | ||
304 | 339 | StelUtils::spheToRect(RA, DE, XYZ); | 336 | StelUtils::spheToRect(RA, DE, XYZ); |
305 | 340 | 337 | ||
306 | === modified file 'plugins/Quasars/src/Quasar.cpp' | |||
307 | --- plugins/Quasars/src/Quasar.cpp 2013-10-16 16:55:17 +0000 | |||
308 | +++ plugins/Quasars/src/Quasar.cpp 2013-10-17 06:10:44 +0000 | |||
309 | @@ -143,7 +143,7 @@ | |||
310 | 143 | 143 | ||
311 | 144 | Vec3f Quasar::getInfoColor(void) const | 144 | Vec3f Quasar::getInfoColor(void) const |
312 | 145 | { | 145 | { |
314 | 146 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : Vec3f(1.0, 1.0, 1.0); | 146 | return Vec3f(1.0, 1.0, 1.0); |
315 | 147 | } | 147 | } |
316 | 148 | 148 | ||
317 | 149 | float Quasar::getVMagnitude(const StelCore* core) const | 149 | float Quasar::getVMagnitude(const StelCore* core) const |
318 | @@ -168,9 +168,6 @@ | |||
319 | 168 | 168 | ||
320 | 169 | Vec3f color = sd->indexToColor(BvToColorIndex(bV))*0.75f; | 169 | Vec3f color = sd->indexToColor(BvToColorIndex(bV))*0.75f; |
321 | 170 | Vec3f dcolor = Vec3f(1.2f,0.5f,0.4f); | 170 | Vec3f dcolor = Vec3f(1.2f,0.5f,0.4f); |
322 | 171 | if (StelApp::getInstance().getVisionModeNight()) | ||
323 | 172 | dcolor = StelUtils::getNightColor(dcolor); | ||
324 | 173 | |||
325 | 174 | RCMag rcMag; | 171 | RCMag rcMag; |
326 | 175 | float size, shift=0; | 172 | float size, shift=0; |
327 | 176 | double mag; | 173 | double mag; |
328 | 177 | 174 | ||
329 | === modified file 'plugins/Satellites/src/Satellite.cpp' | |||
330 | --- plugins/Satellites/src/Satellite.cpp 2013-10-16 16:55:17 +0000 | |||
331 | +++ plugins/Satellites/src/Satellite.cpp 2013-10-17 06:10:44 +0000 | |||
332 | @@ -96,27 +96,15 @@ | |||
333 | 96 | list = map.value("orbitColor", QVariantList()).toList(); | 96 | list = map.value("orbitColor", QVariantList()).toList(); |
334 | 97 | if (list.count() == 3) | 97 | if (list.count() == 3) |
335 | 98 | { | 98 | { |
339 | 99 | orbitColorNormal[0] = list.at(0).toDouble(); | 99 | orbitColor[0] = list.at(0).toDouble(); |
340 | 100 | orbitColorNormal[1] = list.at(1).toDouble(); | 100 | orbitColor[1] = list.at(1).toDouble(); |
341 | 101 | orbitColorNormal[2] = list.at(2).toDouble(); | 101 | orbitColor[2] = list.at(2).toDouble(); |
342 | 102 | } | 102 | } |
343 | 103 | else | 103 | else |
344 | 104 | { | 104 | { |
346 | 105 | orbitColorNormal = hintColor; | 105 | orbitColor = hintColor; |
347 | 106 | } | 106 | } |
348 | 107 | 107 | ||
349 | 108 | // Set the night color of orbit lines to red with the | ||
350 | 109 | // intensity of the average of the RGB for the day color. | ||
351 | 110 | float orbitColorBrightness = (orbitColorNormal[0] + orbitColorNormal[1] + orbitColorNormal[2])/3; | ||
352 | 111 | orbitColorNight[0] = orbitColorBrightness; | ||
353 | 112 | orbitColorNight[1] = 0; | ||
354 | 113 | orbitColorNight[2] = 0; | ||
355 | 114 | |||
356 | 115 | if (StelApp::getInstance().getVisionModeNight()) | ||
357 | 116 | orbitColor = &orbitColorNight; | ||
358 | 117 | else | ||
359 | 118 | orbitColor = &orbitColorNormal; | ||
360 | 119 | |||
361 | 120 | if (map.contains("comms")) | 108 | if (map.contains("comms")) |
362 | 121 | { | 109 | { |
363 | 122 | foreach(const QVariant &comm, map.value("comms").toList()) | 110 | foreach(const QVariant &comm, map.value("comms").toList()) |
364 | @@ -185,7 +173,7 @@ | |||
365 | 185 | map.insert("userDefined", userDefined); | 173 | map.insert("userDefined", userDefined); |
366 | 186 | QVariantList col, orbitCol; | 174 | QVariantList col, orbitCol; |
367 | 187 | col << roundToDp(hintColor[0],3) << roundToDp(hintColor[1], 3) << roundToDp(hintColor[2], 3); | 175 | col << roundToDp(hintColor[0],3) << roundToDp(hintColor[1], 3) << roundToDp(hintColor[2], 3); |
369 | 188 | orbitCol << roundToDp(orbitColorNormal[0], 3) << roundToDp(orbitColorNormal[1], 3) << roundToDp(orbitColorNormal[2],3); | 176 | orbitCol << roundToDp(orbitColor[0], 3) << roundToDp(orbitColor[1], 3) << roundToDp(orbitColor[2],3); |
370 | 189 | map["hintColor"] = col; | 177 | map["hintColor"] = col; |
371 | 190 | map["orbitColor"] = orbitCol; | 178 | map["orbitColor"] = orbitCol; |
372 | 191 | QVariantList commList; | 179 | QVariantList commList; |
373 | @@ -352,7 +340,7 @@ | |||
374 | 352 | 340 | ||
375 | 353 | Vec3f Satellite::getInfoColor(void) const | 341 | Vec3f Satellite::getInfoColor(void) const |
376 | 354 | { | 342 | { |
378 | 355 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : hintColor; | 343 | return hintColor; |
379 | 356 | } | 344 | } |
380 | 357 | 345 | ||
381 | 358 | float Satellite::getVMagnitude(const StelCore* core) const | 346 | float Satellite::getVMagnitude(const StelCore* core) const |
382 | @@ -510,7 +498,7 @@ | |||
383 | 510 | XYZ = getJ2000EquatorialPos(core); | 498 | XYZ = getJ2000EquatorialPos(core); |
384 | 511 | Vec3f drawColor; | 499 | Vec3f drawColor; |
385 | 512 | (visibility==RADAR_NIGHT) ? drawColor = Vec3f(0.2f,0.2f,0.2f) : drawColor = hintColor; | 500 | (visibility==RADAR_NIGHT) ? drawColor = Vec3f(0.2f,0.2f,0.2f) : drawColor = hintColor; |
387 | 513 | StelApp::getInstance().getVisionModeNight() ? glColor4f(0.6,0.0,0.0,1.0) : glColor4f(drawColor[0],drawColor[1],drawColor[2], Satellite::hintBrightness); | 501 | glColor4f(drawColor[0],drawColor[1],drawColor[2], Satellite::hintBrightness); |
388 | 514 | 502 | ||
389 | 515 | StelProjectorP prj = core->getProjection(StelCore::FrameJ2000); | 503 | StelProjectorP prj = core->getProjection(StelCore::FrameJ2000); |
390 | 516 | 504 | ||
391 | @@ -555,7 +543,7 @@ | |||
392 | 555 | // Draw end (fading) parts of orbit lines one segment at a time. | 543 | // Draw end (fading) parts of orbit lines one segment at a time. |
393 | 556 | if (i<=orbitLineFadeSegments || orbitLineSegments-i < orbitLineFadeSegments) | 544 | if (i<=orbitLineFadeSegments || orbitLineSegments-i < orbitLineFadeSegments) |
394 | 557 | { | 545 | { |
396 | 558 | painter.setColor((*orbitColor)[0], (*orbitColor)[1], (*orbitColor)[2], hintBrightness * calculateOrbitSegmentIntensity(i)); | 546 | painter.setColor(orbitColor[0], orbitColor[1], orbitColor[2], hintBrightness * calculateOrbitSegmentIntensity(i)); |
397 | 559 | painter.drawGreatCircleArc(previousPosition, position, &viewportHalfspace); | 547 | painter.drawGreatCircleArc(previousPosition, position, &viewportHalfspace); |
398 | 560 | } | 548 | } |
399 | 561 | else | 549 | else |
400 | @@ -566,7 +554,7 @@ | |||
401 | 566 | } | 554 | } |
402 | 567 | 555 | ||
403 | 568 | // Draw center section of orbit in one go | 556 | // Draw center section of orbit in one go |
405 | 569 | painter.setColor((*orbitColor)[0], (*orbitColor)[1], (*orbitColor)[2], hintBrightness); | 557 | painter.setColor(orbitColor[0], orbitColor[1], orbitColor[2], hintBrightness); |
406 | 570 | painter.drawGreatCircleArcs(vertexArray, &viewportHalfspace); | 558 | painter.drawGreatCircleArcs(vertexArray, &viewportHalfspace); |
407 | 571 | 559 | ||
408 | 572 | glEnable(GL_TEXTURE_2D); | 560 | glEnable(GL_TEXTURE_2D); |
409 | @@ -587,15 +575,6 @@ | |||
410 | 587 | } | 575 | } |
411 | 588 | } | 576 | } |
412 | 589 | 577 | ||
413 | 590 | void Satellite::setNightColors(bool night) | ||
414 | 591 | { | ||
415 | 592 | if (night) | ||
416 | 593 | orbitColor = &orbitColorNight; | ||
417 | 594 | else | ||
418 | 595 | orbitColor = &orbitColorNormal; | ||
419 | 596 | } | ||
420 | 597 | |||
421 | 598 | |||
422 | 599 | void Satellite::computeOrbitPoints() | 578 | void Satellite::computeOrbitPoints() |
423 | 600 | { | 579 | { |
424 | 601 | gTimeSpan computeInterval(0, 0, 0, orbitLineSegmentDuration); | 580 | gTimeSpan computeInterval(0, 0, 0, orbitLineSegmentDuration); |
425 | 602 | 581 | ||
426 | === modified file 'plugins/Satellites/src/Satellite.hpp' | |||
427 | --- plugins/Satellites/src/Satellite.hpp 2013-10-16 16:55:17 +0000 | |||
428 | +++ plugins/Satellites/src/Satellite.hpp 2013-10-17 06:10:44 +0000 | |||
429 | @@ -169,7 +169,6 @@ | |||
430 | 169 | //! returns 0 - 1.0 for the DRAWORBIT_FADE_NUMBER segments at | 169 | //! returns 0 - 1.0 for the DRAWORBIT_FADE_NUMBER segments at |
431 | 170 | //! each end of an orbit, with 1 in the middle. | 170 | //! each end of an orbit, with 1 in the middle. |
432 | 171 | float calculateOrbitSegmentIntensity(int segNum); | 171 | float calculateOrbitSegmentIntensity(int segNum); |
433 | 172 | void setNightColors(bool night); | ||
434 | 173 | 172 | ||
435 | 174 | private: | 173 | private: |
436 | 175 | bool initialized; | 174 | bool initialized; |
437 | @@ -237,9 +236,7 @@ | |||
438 | 237 | 236 | ||
439 | 238 | //Satellite Orbit Draw | 237 | //Satellite Orbit Draw |
440 | 239 | QFont font; | 238 | QFont font; |
444 | 240 | Vec3f orbitColorNormal; | 239 | Vec3f orbitColor; |
442 | 241 | Vec3f orbitColorNight; | ||
443 | 242 | Vec3f* orbitColor; | ||
445 | 243 | double lastEpochCompForOrbit; //measured in Julian Days | 240 | double lastEpochCompForOrbit; //measured in Julian Days |
446 | 244 | double epochTime; //measured in Julian Days | 241 | double epochTime; //measured in Julian Days |
447 | 245 | QList<Vec3d> orbitPoints; //orbit points represented by ElAzPos vectors | 242 | QList<Vec3d> orbitPoints; //orbit points represented by ElAzPos vectors |
448 | 246 | 243 | ||
449 | === modified file 'plugins/Satellites/src/Satellites.cpp' | |||
450 | --- plugins/Satellites/src/Satellites.cpp 2013-10-01 22:05:10 +0000 | |||
451 | +++ plugins/Satellites/src/Satellites.cpp 2013-10-17 06:10:44 +0000 | |||
452 | @@ -246,17 +246,6 @@ | |||
453 | 246 | return true; | 246 | return true; |
454 | 247 | } | 247 | } |
455 | 248 | 248 | ||
456 | 249 | void Satellites::setStelStyle(const QString& mode) | ||
457 | 250 | { | ||
458 | 251 | foreach(const SatelliteP& sat, satellites) | ||
459 | 252 | { | ||
460 | 253 | if (sat->initialized) | ||
461 | 254 | { | ||
462 | 255 | sat->setNightColors(mode=="night_color"); | ||
463 | 256 | } | ||
464 | 257 | } | ||
465 | 258 | } | ||
466 | 259 | |||
467 | 260 | const StelStyle Satellites::getModuleStyleSheet(const StelStyle& style) | 249 | const StelStyle Satellites::getModuleStyleSheet(const StelStyle& style) |
468 | 261 | { | 250 | { |
469 | 262 | StelStyle pluginStyle(style); | 251 | StelStyle pluginStyle(style); |
470 | @@ -1555,10 +1544,7 @@ | |||
471 | 1555 | // Compute 2D pos and return if outside screen | 1544 | // Compute 2D pos and return if outside screen |
472 | 1556 | if (!prj->project(pos, screenpos)) | 1545 | if (!prj->project(pos, screenpos)) |
473 | 1557 | return; | 1546 | return; |
478 | 1558 | if (StelApp::getInstance().getVisionModeNight()) | 1547 | glColor3f(0.4f,0.5f,0.8f); |
475 | 1559 | glColor3f(0.8f,0.0f,0.0f); | ||
476 | 1560 | else | ||
477 | 1561 | glColor3f(0.4f,0.5f,0.8f); | ||
479 | 1562 | texPointer->bind(); | 1548 | texPointer->bind(); |
480 | 1563 | 1549 | ||
481 | 1564 | glEnable(GL_TEXTURE_2D); | 1550 | glEnable(GL_TEXTURE_2D); |
482 | 1565 | 1551 | ||
483 | === modified file 'plugins/Satellites/src/Satellites.hpp' | |||
484 | --- plugins/Satellites/src/Satellites.hpp 2013-10-01 01:11:14 +0000 | |||
485 | +++ plugins/Satellites/src/Satellites.hpp 2013-10-17 06:10:44 +0000 | |||
486 | @@ -435,7 +435,6 @@ | |||
487 | 435 | void saveCatalog(QString path=QString()); | 435 | void saveCatalog(QString path=QString()); |
488 | 436 | 436 | ||
489 | 437 | private slots: | 437 | private slots: |
490 | 438 | void setStelStyle(const QString& section); | ||
491 | 439 | 438 | ||
492 | 440 | private: | 439 | private: |
493 | 441 | //! Add to the current collection the satellite described by the data. | 440 | //! Add to the current collection the satellite described by the data. |
494 | 442 | 441 | ||
495 | === modified file 'plugins/Supernovae/src/Supernova.cpp' | |||
496 | --- plugins/Supernovae/src/Supernova.cpp 2013-10-16 16:55:17 +0000 | |||
497 | +++ plugins/Supernovae/src/Supernova.cpp 2013-10-17 06:10:44 +0000 | |||
498 | @@ -148,7 +148,7 @@ | |||
499 | 148 | 148 | ||
500 | 149 | Vec3f Supernova::getInfoColor(void) const | 149 | Vec3f Supernova::getInfoColor(void) const |
501 | 150 | { | 150 | { |
503 | 151 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : Vec3f(1.0, 1.0, 1.0); | 151 | return Vec3f(1.0, 1.0, 1.0); |
504 | 152 | } | 152 | } |
505 | 153 | 153 | ||
506 | 154 | float Supernova::getVMagnitude(const StelCore* core) const | 154 | float Supernova::getVMagnitude(const StelCore* core) const |
507 | @@ -225,9 +225,6 @@ | |||
508 | 225 | StarMgr* smgr = GETSTELMODULE(StarMgr); // It's need for checking displaying of labels for stars | 225 | StarMgr* smgr = GETSTELMODULE(StarMgr); // It's need for checking displaying of labels for stars |
509 | 226 | 226 | ||
510 | 227 | Vec3f color = Vec3f(1.f,1.f,1.f); | 227 | Vec3f color = Vec3f(1.f,1.f,1.f); |
511 | 228 | if (StelApp::getInstance().getVisionModeNight()) | ||
512 | 229 | color = StelUtils::getNightColor(color); | ||
513 | 230 | |||
514 | 231 | RCMag rcMag; | 228 | RCMag rcMag; |
515 | 232 | float size, shift; | 229 | float size, shift; |
516 | 233 | double mag; | 230 | double mag; |
517 | 234 | 231 | ||
518 | === modified file 'plugins/TelescopeControl/src/clients/TelescopeClient.hpp' | |||
519 | --- plugins/TelescopeControl/src/clients/TelescopeClient.hpp 2012-02-23 07:48:31 +0000 | |||
520 | +++ plugins/TelescopeControl/src/clients/TelescopeClient.hpp 2013-10-17 06:10:44 +0000 | |||
521 | @@ -62,7 +62,7 @@ | |||
522 | 62 | QString getNameI18n(void) const {return nameI18n;} | 62 | QString getNameI18n(void) const {return nameI18n;} |
523 | 63 | Vec3f getInfoColor(void) const | 63 | Vec3f getInfoColor(void) const |
524 | 64 | { | 64 | { |
526 | 65 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8, 0.2, 0.2) : Vec3f(1, 1, 1); | 65 | return Vec3f(1, 1, 1); |
527 | 66 | } | 66 | } |
528 | 67 | //! TelescopeClient supports the following InfoStringGroup flags: | 67 | //! TelescopeClient supports the following InfoStringGroup flags: |
529 | 68 | //! - Name | 68 | //! - Name |
530 | 69 | 69 | ||
531 | === modified file 'src/StelMainView.cpp' | |||
532 | --- src/StelMainView.cpp 2013-10-05 18:52:05 +0000 | |||
533 | +++ src/StelMainView.cpp 2013-10-17 06:10:44 +0000 | |||
534 | @@ -46,6 +46,7 @@ | |||
535 | 46 | #include <QTimer> | 46 | #include <QTimer> |
536 | 47 | #include <QWidget> | 47 | #include <QWidget> |
537 | 48 | #include <QWindow> | 48 | #include <QWindow> |
538 | 49 | #include <QDeclarativeContext> | ||
539 | 49 | 50 | ||
540 | 50 | // Initialize static variables | 51 | // Initialize static variables |
541 | 51 | StelMainView* StelMainView::singleton = NULL; | 52 | StelMainView* StelMainView::singleton = NULL; |
542 | @@ -112,7 +113,7 @@ | |||
543 | 112 | StelApp::getInstance().draw(); | 113 | StelApp::getInstance().draw(); |
544 | 113 | 114 | ||
545 | 114 | painter->endNativePainting(); | 115 | painter->endNativePainting(); |
547 | 115 | // update(); | 116 | update(); |
548 | 116 | } | 117 | } |
549 | 117 | 118 | ||
550 | 118 | void StelSkyItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | 119 | void StelSkyItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
551 | @@ -300,6 +301,7 @@ | |||
552 | 300 | setResizeMode(QDeclarativeView::SizeRootObjectToView); | 301 | setResizeMode(QDeclarativeView::SizeRootObjectToView); |
553 | 301 | qmlRegisterType<StelSkyItem>("Stellarium", 1, 0, "StelSky"); | 302 | qmlRegisterType<StelSkyItem>("Stellarium", 1, 0, "StelSky"); |
554 | 302 | qmlRegisterType<StelGuiItem>("Stellarium", 1, 0, "StelGui"); | 303 | qmlRegisterType<StelGuiItem>("Stellarium", 1, 0, "StelGui"); |
555 | 304 | rootContext()->setContextProperty("stelApp", stelApp); | ||
556 | 303 | setSource(QUrl("qrc:/qml/qml/main.qml")); | 305 | setSource(QUrl("qrc:/qml/qml/main.qml")); |
557 | 304 | 306 | ||
558 | 305 | QScreen* screen = glWidget->windowHandle()->screen(); | 307 | QScreen* screen = glWidget->windowHandle()->screen(); |
559 | 306 | 308 | ||
560 | === modified file 'src/core/StelApp.cpp' | |||
561 | --- src/core/StelApp.cpp 2013-10-13 20:39:02 +0000 | |||
562 | +++ src/core/StelApp.cpp 2013-10-17 06:10:44 +0000 | |||
563 | @@ -423,9 +423,8 @@ | |||
564 | 423 | initScriptMgr(conf); | 423 | initScriptMgr(conf); |
565 | 424 | 424 | ||
566 | 425 | // Initialisation of the color scheme | 425 | // Initialisation of the color scheme |
570 | 426 | bool tmp = confSettings->value("viewing/flag_night").toBool(); | 426 | emit colorSchemeChanged("color"); |
571 | 427 | flagNightVision=!tmp; // fool caching | 427 | setVisionModeNight(confSettings->value("viewing/flag_night").toBool()); |
569 | 428 | setVisionModeNight(tmp); | ||
572 | 429 | 428 | ||
573 | 430 | // Initialisation of the render of solar shadows | 429 | // Initialisation of the render of solar shadows |
574 | 431 | //setRenderSolarShadows(confSettings->value("viewing/flag_render_solar_shadows", true).toBool()); | 430 | //setRenderSolarShadows(confSettings->value("viewing/flag_render_solar_shadows", true).toBool()); |
575 | @@ -663,7 +662,7 @@ | |||
576 | 663 | if (flagNightVision!=b) | 662 | if (flagNightVision!=b) |
577 | 664 | { | 663 | { |
578 | 665 | flagNightVision=b; | 664 | flagNightVision=b; |
580 | 666 | emit(colorSchemeChanged(b ? "night_color" : "color")); | 665 | emit(visionNightModeChanged(b)); |
581 | 667 | } | 666 | } |
582 | 668 | } | 667 | } |
583 | 669 | 668 | ||
584 | 670 | 669 | ||
585 | === modified file 'src/core/StelApp.hpp' | |||
586 | --- src/core/StelApp.hpp 2013-10-13 20:39:02 +0000 | |||
587 | +++ src/core/StelApp.hpp 2013-10-17 06:10:44 +0000 | |||
588 | @@ -59,7 +59,7 @@ | |||
589 | 59 | class StelApp : public QObject | 59 | class StelApp : public QObject |
590 | 60 | { | 60 | { |
591 | 61 | Q_OBJECT | 61 | Q_OBJECT |
593 | 62 | Q_PROPERTY(bool nightMode READ getVisionModeNight WRITE setVisionModeNight) | 62 | Q_PROPERTY(bool nightMode READ getVisionModeNight WRITE setVisionModeNight NOTIFY visionNightModeChanged) |
594 | 63 | 63 | ||
595 | 64 | public: | 64 | public: |
596 | 65 | friend class StelAppGraphicsWidget; | 65 | friend class StelAppGraphicsWidget; |
597 | @@ -140,7 +140,7 @@ | |||
598 | 140 | QSettings* getSettings() {return confSettings;} | 140 | QSettings* getSettings() {return confSettings;} |
599 | 141 | 141 | ||
600 | 142 | //! Return the currently used style | 142 | //! Return the currently used style |
602 | 143 | QString getCurrentStelStyle() {return flagNightVision ? "night_color" : "color";} | 143 | QString getCurrentStelStyle() {return "color";} |
603 | 144 | 144 | ||
604 | 145 | //! Update all object according to the deltaTime in seconds. | 145 | //! Update all object according to the deltaTime in seconds. |
605 | 146 | void update(double deltaTime); | 146 | void update(double deltaTime); |
606 | @@ -212,6 +212,7 @@ | |||
607 | 212 | void reportFileDownloadFinished(QNetworkReply* reply); | 212 | void reportFileDownloadFinished(QNetworkReply* reply); |
608 | 213 | 213 | ||
609 | 214 | signals: | 214 | signals: |
610 | 215 | void visionNightModeChanged(bool); | ||
611 | 215 | void colorSchemeChanged(const QString&); | 216 | void colorSchemeChanged(const QString&); |
612 | 216 | void languageChanged(); | 217 | void languageChanged(); |
613 | 217 | void skyCultureChanged(const QString&); | 218 | void skyCultureChanged(const QString&); |
614 | 218 | 219 | ||
615 | === modified file 'src/core/StelSkyDrawer.cpp' | |||
616 | --- src/core/StelSkyDrawer.cpp 2013-10-09 20:58:58 +0000 | |||
617 | +++ src/core/StelSkyDrawer.cpp 2013-10-17 06:10:44 +0000 | |||
618 | @@ -442,21 +442,14 @@ | |||
619 | 442 | sPainter->enableTexture2d(true); | 442 | sPainter->enableTexture2d(true); |
620 | 443 | glBlendFunc(GL_ONE, GL_ONE); | 443 | glBlendFunc(GL_ONE, GL_ONE); |
621 | 444 | glEnable(GL_BLEND); | 444 | glEnable(GL_BLEND); |
627 | 445 | if (StelApp::getInstance().getVisionModeNight()) | 445 | sPainter->setColor(color[0]*cmag, color[1]*cmag, color[2]*cmag); |
623 | 446 | sPainter->setColor(color[0]*cmag, 0.0, 0.0); | ||
624 | 447 | else | ||
625 | 448 | sPainter->setColor(color[0]*cmag, color[1]*cmag, color[2]*cmag); | ||
626 | 449 | |||
628 | 450 | sPainter->drawSprite2dMode(win[0], win[1], rmag); | 446 | sPainter->drawSprite2dMode(win[0], win[1], rmag); |
629 | 451 | } | 447 | } |
630 | 452 | 448 | ||
631 | 453 | unsigned char starColor[3] = {0, 0, 0}; | 449 | unsigned char starColor[3] = {0, 0, 0}; |
632 | 454 | starColor[0] = (unsigned char)std::min((int)(color[0]*tw*255+0.5f), 255); | 450 | starColor[0] = (unsigned char)std::min((int)(color[0]*tw*255+0.5f), 255); |
638 | 455 | if (!StelApp::getInstance().getVisionModeNight()) | 451 | starColor[1] = (unsigned char)std::min((int)(color[1]*tw*255+0.5f), 255); |
639 | 456 | { | 452 | starColor[2] = (unsigned char)std::min((int)(color[2]*tw*255+0.5f), 255); |
635 | 457 | starColor[1] = (unsigned char)std::min((int)(color[1]*tw*255+0.5f), 255); | ||
636 | 458 | starColor[2] = (unsigned char)std::min((int)(color[2]*tw*255+0.5f), 255); | ||
637 | 459 | } | ||
640 | 460 | 453 | ||
641 | 461 | // Store the drawing instructions in the vertex arrays | 454 | // Store the drawing instructions in the vertex arrays |
642 | 462 | StarVertex* vx = &(vertexArray[nbPointSources*6]); | 455 | StarVertex* vx = &(vertexArray[nbPointSources*6]); |
643 | @@ -500,11 +493,7 @@ | |||
644 | 500 | cmag = qMax(0.f, 1.f-(pixRadius*3.f+100-rmag)/100); | 493 | cmag = qMax(0.f, 1.f-(pixRadius*3.f+100-rmag)/100); |
645 | 501 | Vec3f win; | 494 | Vec3f win; |
646 | 502 | painter->getProjector()->project(v, win); | 495 | painter->getProjector()->project(v, win); |
652 | 503 | Vec3f c = color; | 496 | painter->setColor(color[0]*cmag, color[1]*cmag, color[2]*cmag); |
648 | 504 | if (StelApp::getInstance().getVisionModeNight()) | ||
649 | 505 | c = StelUtils::getNightColor(c); | ||
650 | 506 | |||
651 | 507 | painter->setColor(c[0]*cmag, c[1]*cmag, c[2]*cmag); | ||
653 | 508 | painter->drawSprite2dMode(win[0], win[1], rmag); | 497 | painter->drawSprite2dMode(win[0], win[1], rmag); |
654 | 509 | noStarHalo = true; | 498 | noStarHalo = true; |
655 | 510 | } | 499 | } |
656 | 511 | 500 | ||
657 | === modified file 'src/core/modules/Constellation.cpp' | |||
658 | --- src/core/modules/Constellation.cpp 2013-09-07 13:01:20 +0000 | |||
659 | +++ src/core/modules/Constellation.cpp 2013-10-17 06:10:44 +0000 | |||
660 | @@ -128,10 +128,7 @@ | |||
661 | 128 | const float intensity = artFader.getInterstate(); | 128 | const float intensity = artFader.getInterstate(); |
662 | 129 | if (artTexture && intensity && region.intersects(boundingCap)) | 129 | if (artTexture && intensity && region.intersects(boundingCap)) |
663 | 130 | { | 130 | { |
668 | 131 | if (StelApp::getInstance().getVisionModeNight()) | 131 | sPainter.setColor(intensity,intensity,intensity); |
665 | 132 | sPainter.setColor(intensity, 0.0, 0.0); | ||
666 | 133 | else | ||
667 | 134 | sPainter.setColor(intensity,intensity,intensity); | ||
669 | 135 | 132 | ||
670 | 136 | // The texture is not fully loaded | 133 | // The texture is not fully loaded |
671 | 137 | if (artTexture->bind()==false) | 134 | if (artTexture->bind()==false) |
672 | 138 | 135 | ||
673 | === modified file 'src/core/modules/GridLinesMgr.cpp' | |||
674 | --- src/core/modules/GridLinesMgr.cpp 2013-10-01 22:05:10 +0000 | |||
675 | +++ src/core/modules/GridLinesMgr.cpp 2013-10-17 06:10:44 +0000 | |||
676 | @@ -311,19 +311,7 @@ | |||
677 | 311 | glEnable(GL_BLEND); | 311 | glEnable(GL_BLEND); |
678 | 312 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode | 312 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode |
679 | 313 | Vec4f textColor(color[0], color[1], color[2], 0); | 313 | Vec4f textColor(color[0], color[1], color[2], 0); |
693 | 314 | if (StelApp::getInstance().getVisionModeNight()) | 314 | sPainter.setColor(color[0],color[1],color[2], fader.getInterstate()); |
681 | 315 | { | ||
682 | 316 | // instead of a filter which just zeros G&B, set the red | ||
683 | 317 | // value to the mean brightness of RGB. | ||
684 | 318 | float red = (color[0] + color[1] + color[2]) / 3.0; | ||
685 | 319 | textColor[0] = red; | ||
686 | 320 | textColor[1] = 0.; textColor[2] = 0.; | ||
687 | 321 | sPainter.setColor(red, 0, 0, fader.getInterstate()); | ||
688 | 322 | } | ||
689 | 323 | else | ||
690 | 324 | { | ||
691 | 325 | sPainter.setColor(color[0],color[1],color[2], fader.getInterstate()); | ||
692 | 326 | } | ||
694 | 327 | 315 | ||
695 | 328 | textColor*=2; | 316 | textColor*=2; |
696 | 329 | textColor[3]=fader.getInterstate(); | 317 | textColor[3]=fader.getInterstate(); |
697 | 330 | 318 | ||
698 | === modified file 'src/core/modules/Landscape.cpp' | |||
699 | --- src/core/modules/Landscape.cpp 2013-09-23 20:24:50 +0000 | |||
700 | +++ src/core/modules/Landscape.cpp 2013-10-17 06:10:44 +0000 | |||
701 | @@ -351,10 +351,9 @@ | |||
702 | 351 | transfo->combine(Mat4d::translation(Vec3d(0.,0.,vpos))); | 351 | transfo->combine(Mat4d::translation(Vec3d(0.,0.,vpos))); |
703 | 352 | sPainter.setProjector(core->getProjection(transfo)); | 352 | sPainter.setProjector(core->getProjection(transfo)); |
704 | 353 | glBlendFunc(GL_ONE, GL_ONE); | 353 | glBlendFunc(GL_ONE, GL_ONE); |
705 | 354 | const float nightModeFilter = StelApp::getInstance().getVisionModeNight() ? 0.f : 1.f; | ||
706 | 355 | sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*skyBrightness), | 354 | sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*skyBrightness), |
709 | 356 | fogFader.getInterstate()*(0.1f+0.1f*skyBrightness)*nightModeFilter, | 355 | fogFader.getInterstate()*(0.1f+0.1f*skyBrightness), |
710 | 357 | fogFader.getInterstate()*(0.1f+0.1f*skyBrightness)*nightModeFilter); | 356 | fogFader.getInterstate()*(0.1f+0.1f*skyBrightness)); |
711 | 358 | fogTex->bind(); | 357 | fogTex->bind(); |
712 | 359 | const float height = (tanMode||calibrated) ? radius*std::tan(fogAltAngle*M_PI/180.) : radius*std::sin(fogAltAngle*M_PI/180.); | 358 | const float height = (tanMode||calibrated) ? radius*std::tan(fogAltAngle*M_PI/180.) : radius*std::sin(fogAltAngle*M_PI/180.); |
713 | 360 | sPainter.sCylinder(radius, height, 64, 1); | 359 | sPainter.sCylinder(radius, height, 64, 1); |
714 | @@ -379,10 +378,7 @@ | |||
715 | 379 | 378 | ||
716 | 380 | if (!landFader.getInterstate()) | 379 | if (!landFader.getInterstate()) |
717 | 381 | return; | 380 | return; |
722 | 382 | if (StelApp::getInstance().getVisionModeNight()) | 381 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); |
719 | 383 | sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, landFader.getInterstate()); | ||
720 | 384 | else | ||
721 | 385 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); | ||
723 | 386 | 382 | ||
724 | 387 | foreach (const LOSSide& side, precomputedSides) | 383 | foreach (const LOSSide& side, precomputedSides) |
725 | 388 | { | 384 | { |
726 | @@ -404,10 +400,7 @@ | |||
727 | 404 | transfo->combine(Mat4d::zrotation((groundAngleRotateZ-angleRotateZOffset)*M_PI/180.f) * Mat4d::translation(Vec3d(0,0,vshift))); | 400 | transfo->combine(Mat4d::zrotation((groundAngleRotateZ-angleRotateZOffset)*M_PI/180.f) * Mat4d::translation(Vec3d(0,0,vshift))); |
728 | 405 | 401 | ||
729 | 406 | sPainter.setProjector(core->getProjection(transfo)); | 402 | sPainter.setProjector(core->getProjection(transfo)); |
734 | 407 | if (StelApp::getInstance().getVisionModeNight()) | 403 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); |
731 | 408 | sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, landFader.getInterstate()); | ||
732 | 409 | else | ||
733 | 410 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); | ||
735 | 411 | 404 | ||
736 | 412 | groundTex->bind(); | 405 | groundTex->bind(); |
737 | 413 | sPainter.setArrays((Vec3d*)groundVertexArr.constData(), (Vec2f*)groundTexCoordArr.constData()); | 406 | sPainter.setArrays((Vec3d*)groundVertexArr.constData(), (Vec2f*)groundTexCoordArr.constData()); |
738 | @@ -462,10 +455,7 @@ | |||
739 | 462 | 455 | ||
740 | 463 | // Normal transparency mode | 456 | // Normal transparency mode |
741 | 464 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 457 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
746 | 465 | if (StelApp::getInstance().getVisionModeNight()) | 458 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); |
743 | 466 | sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, landFader.getInterstate()); | ||
744 | 467 | else | ||
745 | 468 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); | ||
747 | 469 | 459 | ||
748 | 470 | 460 | ||
749 | 471 | glEnable(GL_CULL_FACE); | 461 | glEnable(GL_CULL_FACE); |
750 | @@ -530,11 +520,7 @@ | |||
751 | 530 | 520 | ||
752 | 531 | // Normal transparency mode | 521 | // Normal transparency mode |
753 | 532 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 522 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
759 | 533 | if (StelApp::getInstance().getVisionModeNight()) | 523 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); |
755 | 534 | sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, landFader.getInterstate()); | ||
756 | 535 | else | ||
757 | 536 | sPainter.setColor(skyBrightness, skyBrightness, skyBrightness, landFader.getInterstate()); | ||
758 | 537 | |||
760 | 538 | 524 | ||
761 | 539 | glEnable(GL_CULL_FACE); | 525 | glEnable(GL_CULL_FACE); |
762 | 540 | sPainter.enableTexture2d(true); | 526 | sPainter.enableTexture2d(true); |
763 | 541 | 527 | ||
764 | === modified file 'src/core/modules/MilkyWay.cpp' | |||
765 | --- src/core/modules/MilkyWay.cpp 2013-09-22 20:28:42 +0000 | |||
766 | +++ src/core/modules/MilkyWay.cpp 2013-10-17 06:10:44 +0000 | |||
767 | @@ -85,11 +85,7 @@ | |||
768 | 85 | 85 | ||
769 | 86 | // This RGB color corresponds to the night blue scotopic color = 0.25, 0.25 in xyY mode. | 86 | // This RGB color corresponds to the night blue scotopic color = 0.25, 0.25 in xyY mode. |
770 | 87 | // since milky way is always seen white RGB value in the texture (1.0,1.0,1.0) | 87 | // since milky way is always seen white RGB value in the texture (1.0,1.0,1.0) |
776 | 88 | Vec3f c; | 88 | Vec3f c = Vec3f(0.34165f, 0.429666f, 0.63586f); |
772 | 89 | if (StelApp::getInstance().getVisionModeNight()) | ||
773 | 90 | c = Vec3f(0.34165f, 0.f, 0.f); | ||
774 | 91 | else | ||
775 | 92 | c = Vec3f(0.34165f, 0.429666f, 0.63586f); | ||
777 | 93 | 89 | ||
778 | 94 | float lum = core->getSkyDrawer()->surfacebrightnessToLuminance(13.5f); | 90 | float lum = core->getSkyDrawer()->surfacebrightnessToLuminance(13.5f); |
779 | 95 | 91 | ||
780 | 96 | 92 | ||
781 | === modified file 'src/core/modules/Nebula.cpp' | |||
782 | --- src/core/modules/Nebula.cpp 2013-10-16 16:55:17 +0000 | |||
783 | +++ src/core/modules/Nebula.cpp 2013-10-17 06:10:44 +0000 | |||
784 | @@ -142,8 +142,7 @@ | |||
785 | 142 | 142 | ||
786 | 143 | Vec3f Nebula::getInfoColor(void) const | 143 | Vec3f Nebula::getInfoColor(void) const |
787 | 144 | { | 144 | { |
790 | 145 | Vec3f col = ((NebulaMgr*)StelApp::getInstance().getModuleMgr().getModule("NebulaMgr"))->getLabelsColor(); | 145 | return ((NebulaMgr*)StelApp::getInstance().getModuleMgr().getModule("NebulaMgr"))->getLabelsColor(); |
789 | 146 | return StelApp::getInstance().getVisionModeNight() ? StelUtils::getNightColor(col) : col; | ||
791 | 147 | } | 146 | } |
792 | 148 | 147 | ||
793 | 149 | double Nebula::getCloseViewFov(const StelCore*) const | 148 | double Nebula::getCloseViewFov(const StelCore*) const |
794 | @@ -166,8 +165,6 @@ | |||
795 | 166 | glBlendFunc(GL_ONE, GL_ONE); | 165 | glBlendFunc(GL_ONE, GL_ONE); |
796 | 167 | float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8; | 166 | float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8; |
797 | 168 | Vec3f col(circleColor[0]*lum*hintsBrightness, circleColor[1]*lum*hintsBrightness, circleColor[2]*lum*hintsBrightness); | 167 | Vec3f col(circleColor[0]*lum*hintsBrightness, circleColor[1]*lum*hintsBrightness, circleColor[2]*lum*hintsBrightness); |
798 | 169 | if (StelApp::getInstance().getVisionModeNight()) | ||
799 | 170 | col = StelUtils::getNightColor(col); | ||
800 | 171 | 168 | ||
801 | 172 | sPainter.setColor(col[0], col[1], col[2], 1); | 169 | sPainter.setColor(col[0], col[1], col[2], 1); |
802 | 173 | switch (nType) { | 170 | switch (nType) { |
803 | @@ -209,8 +206,6 @@ | |||
804 | 209 | return; | 206 | return; |
805 | 210 | 207 | ||
806 | 211 | Vec3f col(labelColor[0], labelColor[1], labelColor[2]); | 208 | Vec3f col(labelColor[0], labelColor[1], labelColor[2]); |
807 | 212 | if (StelApp::getInstance().getVisionModeNight()) | ||
808 | 213 | col = StelUtils::getNightColor(col); | ||
809 | 214 | 209 | ||
810 | 215 | sPainter.setColor(col[0], col[1], col[2], hintsBrightness); | 210 | sPainter.setColor(col[0], col[1], col[2], hintsBrightness); |
811 | 216 | float size = getAngularSize(NULL)*M_PI/180.*sPainter.getProjector()->getPixelPerRadAtCenter(); | 211 | float size = getAngularSize(NULL)*M_PI/180.*sPainter.getProjector()->getPixelPerRadAtCenter(); |
812 | 217 | 212 | ||
813 | === modified file 'src/core/modules/NebulaMgr.cpp' | |||
814 | --- src/core/modules/NebulaMgr.cpp 2013-10-11 23:49:02 +0000 | |||
815 | +++ src/core/modules/NebulaMgr.cpp 2013-10-17 06:10:44 +0000 | |||
816 | @@ -192,11 +192,8 @@ | |||
817 | 192 | Vec3d pos=obj->getJ2000EquatorialPos(core); | 192 | Vec3d pos=obj->getJ2000EquatorialPos(core); |
818 | 193 | 193 | ||
819 | 194 | // Compute 2D pos and return if outside screen | 194 | // Compute 2D pos and return if outside screen |
825 | 195 | if (!prj->projectInPlace(pos)) return; | 195 | if (!prj->projectInPlace(pos)) return; |
826 | 196 | if (StelApp::getInstance().getVisionModeNight()) | 196 | sPainter.setColor(0.4f,0.5f,0.8f); |
822 | 197 | sPainter.setColor(0.8f,0.0f,0.0f); | ||
823 | 198 | else | ||
824 | 199 | sPainter.setColor(0.4f,0.5f,0.8f); | ||
827 | 200 | 197 | ||
828 | 201 | texPointer->bind(); | 198 | texPointer->bind(); |
829 | 202 | 199 | ||
830 | 203 | 200 | ||
831 | === modified file 'src/core/modules/Planet.cpp' | |||
832 | --- src/core/modules/Planet.cpp 2013-10-16 16:55:17 +0000 | |||
833 | +++ src/core/modules/Planet.cpp 2013-10-17 06:10:44 +0000 | |||
834 | @@ -245,10 +245,7 @@ | |||
835 | 245 | 245 | ||
836 | 246 | Vec3f Planet::getInfoColor(void) const | 246 | Vec3f Planet::getInfoColor(void) const |
837 | 247 | { | 247 | { |
842 | 248 | Vec3f col = ((SolarSystem*)StelApp::getInstance().getModuleMgr().getModule("SolarSystem"))->getLabelsColor(); | 248 | return ((SolarSystem*)StelApp::getInstance().getModuleMgr().getModule("SolarSystem"))->getLabelsColor(); |
839 | 249 | if (StelApp::getInstance().getVisionModeNight()) | ||
840 | 250 | col = StelUtils::getNightColor(col); | ||
841 | 251 | return col; | ||
843 | 252 | } | 249 | } |
844 | 253 | 250 | ||
845 | 254 | 251 | ||
846 | @@ -873,16 +870,8 @@ | |||
847 | 873 | static Vec4f diffuse = Vec4f(2.f,2.f,2.f,1.f); | 870 | static Vec4f diffuse = Vec4f(2.f,2.f,2.f,1.f); |
848 | 874 | static Vec4f zero = Vec4f(0.f,0.f,0.f,0.f); | 871 | static Vec4f zero = Vec4f(0.f,0.f,0.f,0.f); |
849 | 875 | static Vec4f ambient = Vec4f(0.02f,0.02f,0.02f,0.02f); | 872 | static Vec4f ambient = Vec4f(0.02f,0.02f,0.02f,0.02f); |
860 | 876 | if (StelApp::getInstance().getVisionModeNight()) | 873 | diffuse[1] = 2.; diffuse[2] = 2.; |
861 | 877 | { | 874 | ambient[1] = 0.02; ambient[2] = 0.02; |
852 | 878 | diffuse[1] = 0.; diffuse[2] = 0.; | ||
853 | 879 | ambient[1] = 0.; ambient[2] = 0.; | ||
854 | 880 | } | ||
855 | 881 | else | ||
856 | 882 | { | ||
857 | 883 | diffuse[1] = 2.; diffuse[2] = 2.; | ||
858 | 884 | ambient[1] = 0.02; ambient[2] = 0.02; | ||
859 | 885 | } | ||
862 | 886 | sPainter->getLight().setAmbient(ambient); | 875 | sPainter->getLight().setAmbient(ambient); |
863 | 887 | sPainter->getLight().setDiffuse(diffuse); | 876 | sPainter->getLight().setDiffuse(diffuse); |
864 | 888 | sPainter->getLight().setSpecular(zero); | 877 | sPainter->getLight().setSpecular(zero); |
865 | @@ -966,10 +955,7 @@ | |||
866 | 966 | } | 955 | } |
867 | 967 | } | 956 | } |
868 | 968 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 957 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
873 | 969 | if (StelApp::getInstance().getVisionModeNight()) | 958 | painter->setColor(1.f, 1.f, 1.f); |
870 | 970 | painter->setColor(1.f, 0.f, 0.f); | ||
871 | 971 | else | ||
872 | 972 | painter->setColor(1.f, 1.f, 1.f); | ||
874 | 973 | 959 | ||
875 | 974 | painter->enableTexture2d(true); | 960 | painter->enableTexture2d(true); |
876 | 975 | glDisable(GL_BLEND); | 961 | glDisable(GL_BLEND); |
877 | @@ -1131,11 +1117,7 @@ | |||
878 | 1131 | 1117 | ||
879 | 1132 | // Normal transparency mode | 1118 | // Normal transparency mode |
880 | 1133 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 1119 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
886 | 1134 | if (StelApp::getInstance().getVisionModeNight()) | 1120 | sPainter->setColor(1.f, 1.f, 1.f); |
882 | 1135 | sPainter->setColor(1.f, 0.f, 0.f); | ||
883 | 1136 | else | ||
884 | 1137 | sPainter->setColor(1.f, 1.f, 1.f); | ||
885 | 1138 | |||
887 | 1139 | sPainter->enableTexture2d(true); | 1121 | sPainter->enableTexture2d(true); |
888 | 1140 | glEnable(GL_CULL_FACE); | 1122 | glEnable(GL_CULL_FACE); |
889 | 1141 | glEnable(GL_BLEND); | 1123 | glEnable(GL_BLEND); |
890 | 1142 | 1124 | ||
891 | === modified file 'src/core/modules/SolarSystem.cpp' | |||
892 | --- src/core/modules/SolarSystem.cpp 2013-10-01 22:05:10 +0000 | |||
893 | +++ src/core/modules/SolarSystem.cpp 2013-10-17 06:10:44 +0000 | |||
894 | @@ -176,10 +176,7 @@ | |||
895 | 176 | 176 | ||
896 | 177 | 177 | ||
897 | 178 | StelPainter sPainter(prj); | 178 | StelPainter sPainter(prj); |
902 | 179 | if (StelApp::getInstance().getVisionModeNight()) | 179 | sPainter.setColor(1.0f,0.3f,0.3f); |
899 | 180 | sPainter.setColor(1.0f,0.0f,0.0f); | ||
900 | 181 | else | ||
901 | 182 | sPainter.setColor(1.0f,0.3f,0.3f); | ||
903 | 183 | 180 | ||
904 | 184 | float size = obj->getAngularSize(core)*M_PI/180.*prj->getPixelPerRadAtCenter()*2.; | 181 | float size = obj->getAngularSize(core)*M_PI/180.*prj->getPixelPerRadAtCenter()*2.; |
905 | 185 | size+=40.f + 10.f*std::sin(2.f * StelApp::getInstance().getTotalRunTime()); | 182 | size+=40.f + 10.f*std::sin(2.f * StelApp::getInstance().getTotalRunTime()); |
906 | 186 | 183 | ||
907 | === modified file 'src/core/modules/StarMgr.cpp' | |||
908 | --- src/core/modules/StarMgr.cpp 2013-10-13 20:39:02 +0000 | |||
909 | +++ src/core/modules/StarMgr.cpp 2013-10-17 06:10:44 +0000 | |||
910 | @@ -351,9 +351,6 @@ | |||
911 | 351 | return; | 351 | return; |
912 | 352 | 352 | ||
913 | 353 | Vec3f c(obj->getInfoColor()); | 353 | Vec3f c(obj->getInfoColor()); |
914 | 354 | if (StelApp::getInstance().getVisionModeNight()) | ||
915 | 355 | c = StelUtils::getNightColor(c); | ||
916 | 356 | |||
917 | 357 | sPainter.setColor(c[0], c[1], c[2]); | 354 | sPainter.setColor(c[0], c[1], c[2]); |
918 | 358 | texPointer->bind(); | 355 | texPointer->bind(); |
919 | 359 | sPainter.enableTexture2d(true); | 356 | sPainter.enableTexture2d(true); |
920 | 360 | 357 | ||
921 | === modified file 'src/core/modules/StarWrapper.hpp' | |||
922 | --- src/core/modules/StarWrapper.hpp 2013-10-16 16:55:17 +0000 | |||
923 | +++ src/core/modules/StarWrapper.hpp 2013-10-17 06:10:44 +0000 | |||
924 | @@ -81,7 +81,7 @@ | |||
925 | 81 | } | 81 | } |
926 | 82 | Vec3f getInfoColor(void) const | 82 | Vec3f getInfoColor(void) const |
927 | 83 | { | 83 | { |
929 | 84 | return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8, 0.0, 0.0) : StelSkyDrawer::indexToColor(s->bV); | 84 | return StelSkyDrawer::indexToColor(s->bV); |
930 | 85 | } | 85 | } |
931 | 86 | float getVMagnitude(const StelCore* core) const | 86 | float getVMagnitude(const StelCore* core) const |
932 | 87 | { | 87 | { |
933 | 88 | 88 | ||
934 | === modified file 'src/core/modules/ZoneArray.cpp' | |||
935 | --- src/core/modules/ZoneArray.cpp 2013-10-11 23:49:02 +0000 | |||
936 | +++ src/core/modules/ZoneArray.cpp 2013-10-17 06:10:44 +0000 | |||
937 | @@ -556,7 +556,7 @@ | |||
938 | 556 | if (drawer->drawPointSource(sPainter, vf, *tmpRcmag, s->bV, !isInsideViewport) && s->hasName() && extinctedMagIndex < maxMagStarName && s->hasComponentID()<=1) | 556 | if (drawer->drawPointSource(sPainter, vf, *tmpRcmag, s->bV, !isInsideViewport) && s->hasName() && extinctedMagIndex < maxMagStarName && s->hasComponentID()<=1) |
939 | 557 | { | 557 | { |
940 | 558 | const float offset = tmpRcmag->radius*0.7f; | 558 | const float offset = tmpRcmag->radius*0.7f; |
942 | 559 | const Vec3f& colorr = (StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8f, 0.0f, 0.0f) : StelSkyDrawer::indexToColor(s->bV))*0.75f; | 559 | const Vec3f colorr = StelSkyDrawer::indexToColor(s->bV)*0.75f; |
943 | 560 | sPainter->setColor(colorr[0], colorr[1], colorr[2],names_brightness); | 560 | sPainter->setColor(colorr[0], colorr[1], colorr[2],names_brightness); |
944 | 561 | sPainter->drawText(Vec3d(vf[0], vf[1], vf[2]), s->getNameI18n(), 0, offset, offset, false); | 561 | sPainter->drawText(Vec3d(vf[0], vf[1], vf[2]), s->getNameI18n(), 0, offset, offset, false); |
945 | 562 | } | 562 | } |
946 | 563 | 563 | ||
947 | === modified file 'src/gui/ConfigurationDialog.cpp' | |||
948 | --- src/gui/ConfigurationDialog.cpp 2013-10-16 16:55:17 +0000 | |||
949 | +++ src/gui/ConfigurationDialog.cpp 2013-10-17 06:10:44 +0000 | |||
950 | @@ -65,7 +65,7 @@ | |||
951 | 65 | #include <QComboBox> | 65 | #include <QComboBox> |
952 | 66 | #include <QDir> | 66 | #include <QDir> |
953 | 67 | 67 | ||
955 | 68 | ConfigurationDialog::ConfigurationDialog(StelGui* agui) : StelDialog(agui), starCatalogDownloadReply(NULL), currentDownloadFile(NULL), progressBar(NULL), gui(agui) | 68 | ConfigurationDialog::ConfigurationDialog(StelGui* agui, QObject* parent) : StelDialog(parent), starCatalogDownloadReply(NULL), currentDownloadFile(NULL), progressBar(NULL), gui(agui) |
956 | 69 | { | 69 | { |
957 | 70 | ui = new Ui_configurationDialogForm; | 70 | ui = new Ui_configurationDialogForm; |
958 | 71 | customDeltaTEquationDialog = NULL; | 71 | customDeltaTEquationDialog = NULL; |
959 | @@ -116,25 +116,6 @@ | |||
960 | 116 | // Nothing for now | 116 | // Nothing for now |
961 | 117 | } | 117 | } |
962 | 118 | 118 | ||
963 | 119 | void ConfigurationDialog::updateIconsColor() | ||
964 | 120 | { | ||
965 | 121 | QPixmap pixmap(50, 50); | ||
966 | 122 | QStringList icons; | ||
967 | 123 | icons << "main" << "info" << "navigation" << "tools" << "scripts" << "plugins"; | ||
968 | 124 | bool redIcon = false; | ||
969 | 125 | if (StelApp::getInstance().getVisionModeNight()) | ||
970 | 126 | redIcon = true; | ||
971 | 127 | |||
972 | 128 | foreach(const QString &iconName, icons) | ||
973 | 129 | { | ||
974 | 130 | pixmap.load(":/graphicGui/tabicon-" + iconName +".png"); | ||
975 | 131 | if (redIcon) | ||
976 | 132 | pixmap = StelButton::makeRed(pixmap); | ||
977 | 133 | |||
978 | 134 | ui->stackListWidget->item(icons.indexOf(iconName))->setIcon(QIcon(pixmap)); | ||
979 | 135 | } | ||
980 | 136 | } | ||
981 | 137 | |||
982 | 138 | void ConfigurationDialog::createDialogContent() | 119 | void ConfigurationDialog::createDialogContent() |
983 | 139 | { | 120 | { |
984 | 140 | const StelProjectorP proj = StelApp::getInstance().getCore()->getProjection(StelCore::FrameJ2000); | 121 | const StelProjectorP proj = StelApp::getInstance().getCore()->getProjection(StelCore::FrameJ2000); |
985 | @@ -144,11 +125,9 @@ | |||
986 | 144 | 125 | ||
987 | 145 | ui->setupUi(dialog); | 126 | ui->setupUi(dialog); |
988 | 146 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); | 127 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
989 | 147 | connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(QString)), this, SLOT(updateIconsColor())); | ||
990 | 148 | 128 | ||
991 | 149 | // Set the main tab activated by default | 129 | // Set the main tab activated by default |
992 | 150 | ui->configurationStackedWidget->setCurrentIndex(0); | 130 | ui->configurationStackedWidget->setCurrentIndex(0); |
993 | 151 | updateIconsColor(); | ||
994 | 152 | ui->stackListWidget->setCurrentRow(0); | 131 | ui->stackListWidget->setCurrentRow(0); |
995 | 153 | 132 | ||
996 | 154 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); | 133 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
997 | 155 | 134 | ||
998 | === modified file 'src/gui/ConfigurationDialog.hpp' | |||
999 | --- src/gui/ConfigurationDialog.hpp 2013-09-09 23:21:42 +0000 | |||
1000 | +++ src/gui/ConfigurationDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1001 | @@ -37,14 +37,13 @@ | |||
1002 | 37 | { | 37 | { |
1003 | 38 | Q_OBJECT | 38 | Q_OBJECT |
1004 | 39 | public: | 39 | public: |
1006 | 40 | ConfigurationDialog(StelGui* agui); | 40 | ConfigurationDialog(StelGui* agui, QObject* parent); |
1007 | 41 | virtual ~ConfigurationDialog(); | 41 | virtual ~ConfigurationDialog(); |
1008 | 42 | //! Notify that the application style changed | 42 | //! Notify that the application style changed |
1009 | 43 | void styleChanged(); | 43 | void styleChanged(); |
1010 | 44 | 44 | ||
1011 | 45 | public slots: | 45 | public slots: |
1012 | 46 | void retranslate(); | 46 | void retranslate(); |
1013 | 47 | void updateIconsColor(); | ||
1014 | 48 | 47 | ||
1015 | 49 | protected: | 48 | protected: |
1016 | 50 | //! Initialize the dialog widgets and connect the signals/slots | 49 | //! Initialize the dialog widgets and connect the signals/slots |
1017 | 51 | 50 | ||
1018 | === modified file 'src/gui/DateTimeDialog.cpp' | |||
1019 | --- src/gui/DateTimeDialog.cpp 2013-08-30 22:42:40 +0000 | |||
1020 | +++ src/gui/DateTimeDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1021 | @@ -31,7 +31,8 @@ | |||
1022 | 31 | #include <QFrame> | 31 | #include <QFrame> |
1023 | 32 | #include <QLineEdit> | 32 | #include <QLineEdit> |
1024 | 33 | 33 | ||
1026 | 34 | DateTimeDialog::DateTimeDialog() : | 34 | DateTimeDialog::DateTimeDialog(QObject* parent) : |
1027 | 35 | StelDialog(parent), | ||
1028 | 35 | year(0), | 36 | year(0), |
1029 | 36 | month(0), | 37 | month(0), |
1030 | 37 | day(0), | 38 | day(0), |
1031 | 38 | 39 | ||
1032 | === modified file 'src/gui/DateTimeDialog.hpp' | |||
1033 | --- src/gui/DateTimeDialog.hpp 2012-02-13 18:59:16 +0000 | |||
1034 | +++ src/gui/DateTimeDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1035 | @@ -30,7 +30,7 @@ | |||
1036 | 30 | { | 30 | { |
1037 | 31 | Q_OBJECT | 31 | Q_OBJECT |
1038 | 32 | public: | 32 | public: |
1040 | 33 | DateTimeDialog(); | 33 | DateTimeDialog(QObject* parent); |
1041 | 34 | ~DateTimeDialog(); | 34 | ~DateTimeDialog(); |
1042 | 35 | double newJd(); | 35 | double newJd(); |
1043 | 36 | bool valid(int y, int m, int d, int h, int min, int s); | 36 | bool valid(int y, int m, int d, int h, int min, int s); |
1044 | 37 | 37 | ||
1045 | === modified file 'src/gui/HelpDialog.cpp' | |||
1046 | --- src/gui/HelpDialog.cpp 2013-09-13 07:33:37 +0000 | |||
1047 | +++ src/gui/HelpDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1048 | @@ -45,7 +45,7 @@ | |||
1049 | 45 | #include "StelStyle.hpp" | 45 | #include "StelStyle.hpp" |
1050 | 46 | #include "StelActionMgr.hpp" | 46 | #include "StelActionMgr.hpp" |
1051 | 47 | 47 | ||
1053 | 48 | HelpDialog::HelpDialog() | 48 | HelpDialog::HelpDialog(QObject* parent) : StelDialog(parent) |
1054 | 49 | { | 49 | { |
1055 | 50 | ui = new Ui_helpDialogForm; | 50 | ui = new Ui_helpDialogForm; |
1056 | 51 | } | 51 | } |
1057 | @@ -73,32 +73,11 @@ | |||
1058 | 73 | } | 73 | } |
1059 | 74 | } | 74 | } |
1060 | 75 | 75 | ||
1061 | 76 | void HelpDialog::updateIconsColor() | ||
1062 | 77 | { | ||
1063 | 78 | QPixmap pixmap(50, 50); | ||
1064 | 79 | QStringList icons; | ||
1065 | 80 | icons << "help" << "info" << "logs"; | ||
1066 | 81 | bool redIcon = false; | ||
1067 | 82 | if (StelApp::getInstance().getVisionModeNight()) | ||
1068 | 83 | redIcon = true; | ||
1069 | 84 | |||
1070 | 85 | foreach(const QString &iconName, icons) | ||
1071 | 86 | { | ||
1072 | 87 | pixmap.load(":/graphicGui/tabicon-" + iconName +".png"); | ||
1073 | 88 | if (redIcon) | ||
1074 | 89 | pixmap = StelButton::makeRed(pixmap); | ||
1075 | 90 | |||
1076 | 91 | ui->stackListWidget->item(icons.indexOf(iconName))->setIcon(QIcon(pixmap)); | ||
1077 | 92 | } | ||
1078 | 93 | } | ||
1079 | 94 | |||
1080 | 95 | void HelpDialog::createDialogContent() | 76 | void HelpDialog::createDialogContent() |
1081 | 96 | { | 77 | { |
1082 | 97 | ui->setupUi(dialog); | 78 | ui->setupUi(dialog); |
1083 | 98 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); | 79 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
1084 | 99 | connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(QString)), this, SLOT(updateIconsColor())); | ||
1085 | 100 | ui->stackedWidget->setCurrentIndex(0); | 80 | ui->stackedWidget->setCurrentIndex(0); |
1086 | 101 | updateIconsColor(); | ||
1087 | 102 | ui->stackListWidget->setCurrentRow(0); | 81 | ui->stackListWidget->setCurrentRow(0); |
1088 | 103 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); | 82 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
1089 | 104 | 83 | ||
1090 | 105 | 84 | ||
1091 | === modified file 'src/gui/HelpDialog.hpp' | |||
1092 | --- src/gui/HelpDialog.hpp 2013-09-13 07:33:37 +0000 | |||
1093 | +++ src/gui/HelpDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1094 | @@ -32,7 +32,7 @@ | |||
1095 | 32 | { | 32 | { |
1096 | 33 | Q_OBJECT | 33 | Q_OBJECT |
1097 | 34 | public: | 34 | public: |
1099 | 35 | HelpDialog(); | 35 | HelpDialog(QObject* parent); |
1100 | 36 | ~HelpDialog(); | 36 | ~HelpDialog(); |
1101 | 37 | 37 | ||
1102 | 38 | //! Notify that the application style changed | 38 | //! Notify that the application style changed |
1103 | @@ -40,7 +40,6 @@ | |||
1104 | 40 | 40 | ||
1105 | 41 | public slots: | 41 | public slots: |
1106 | 42 | void retranslate(); | 42 | void retranslate(); |
1107 | 43 | void updateIconsColor(); | ||
1108 | 44 | 43 | ||
1109 | 45 | protected: | 44 | protected: |
1110 | 46 | //! Initialize the dialog widgets and connect the signals/slots | 45 | //! Initialize the dialog widgets and connect the signals/slots |
1111 | 47 | 46 | ||
1112 | === modified file 'src/gui/LocationDialog.cpp' | |||
1113 | --- src/gui/LocationDialog.cpp 2013-09-22 19:42:45 +0000 | |||
1114 | +++ src/gui/LocationDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1115 | @@ -41,10 +41,9 @@ | |||
1116 | 41 | #include <QTimer> | 41 | #include <QTimer> |
1117 | 42 | #include <QStringListModel> | 42 | #include <QStringListModel> |
1118 | 43 | 43 | ||
1120 | 44 | LocationDialog::LocationDialog() : isEditingNew(false) | 44 | LocationDialog::LocationDialog(QObject* parent) : StelDialog(parent), isEditingNew(false) |
1121 | 45 | { | 45 | { |
1122 | 46 | ui = new Ui_locationDialogForm; | 46 | ui = new Ui_locationDialogForm; |
1123 | 47 | lastVisionMode = StelApp::getInstance().getVisionModeNight(); | ||
1124 | 48 | } | 47 | } |
1125 | 49 | 48 | ||
1126 | 50 | LocationDialog::~LocationDialog() | 49 | LocationDialog::~LocationDialog() |
1127 | @@ -224,7 +223,7 @@ | |||
1128 | 224 | void LocationDialog::setMapForLocation(const StelLocation& loc) | 223 | void LocationDialog::setMapForLocation(const StelLocation& loc) |
1129 | 225 | { | 224 | { |
1130 | 226 | // Avoids usless processing | 225 | // Avoids usless processing |
1132 | 227 | if (lastPlanet==loc.planetName && lastVisionMode==StelApp::getInstance().getVisionModeNight()) | 226 | if (lastPlanet==loc.planetName) |
1133 | 228 | return; | 227 | return; |
1134 | 229 | 228 | ||
1135 | 230 | QPixmap pixmap; | 229 | QPixmap pixmap; |
1136 | @@ -249,19 +248,9 @@ | |||
1137 | 249 | pixmap = QPixmap(path); | 248 | pixmap = QPixmap(path); |
1138 | 250 | } | 249 | } |
1139 | 251 | } | 250 | } |
1150 | 252 | 251 | ui->mapLabel->setPixmap(pixmap); | |
1141 | 253 | if (StelApp::getInstance().getVisionModeNight()) | ||
1142 | 254 | { | ||
1143 | 255 | ui->mapLabel->setPixmap(StelButton::makeRed(pixmap)); | ||
1144 | 256 | } | ||
1145 | 257 | else | ||
1146 | 258 | { | ||
1147 | 259 | ui->mapLabel->setPixmap(pixmap); | ||
1148 | 260 | } | ||
1149 | 261 | |||
1151 | 262 | // For caching | 252 | // For caching |
1152 | 263 | lastPlanet = loc.planetName; | 253 | lastPlanet = loc.planetName; |
1153 | 264 | lastVisionMode = StelApp::getInstance().getVisionModeNight(); | ||
1154 | 265 | } | 254 | } |
1155 | 266 | 255 | ||
1156 | 267 | void LocationDialog::populatePlanetList() | 256 | void LocationDialog::populatePlanetList() |
1157 | 268 | 257 | ||
1158 | === modified file 'src/gui/LocationDialog.hpp' | |||
1159 | --- src/gui/LocationDialog.hpp 2012-08-03 18:57:40 +0000 | |||
1160 | +++ src/gui/LocationDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1161 | @@ -31,7 +31,7 @@ | |||
1162 | 31 | { | 31 | { |
1163 | 32 | Q_OBJECT | 32 | Q_OBJECT |
1164 | 33 | public: | 33 | public: |
1166 | 34 | LocationDialog(); | 34 | LocationDialog(QObject* parent); |
1167 | 35 | virtual ~LocationDialog(); | 35 | virtual ~LocationDialog(); |
1168 | 36 | //! Notify that the application style changed | 36 | //! Notify that the application style changed |
1169 | 37 | void styleChanged(); | 37 | void styleChanged(); |
1170 | @@ -102,9 +102,7 @@ | |||
1171 | 102 | void setDefaultLocation(); | 102 | void setDefaultLocation(); |
1172 | 103 | 103 | ||
1173 | 104 | private: | 104 | private: |
1177 | 105 | QString lastPlanet; | 105 | QString lastPlanet; |
1175 | 106 | bool lastVisionMode; | ||
1176 | 107 | |||
1178 | 108 | //! Updates the check state and the enabled/disabled status. | 106 | //! Updates the check state and the enabled/disabled status. |
1179 | 109 | void updateDefaultLocationControls(bool currentIsDefault); | 107 | void updateDefaultLocationControls(bool currentIsDefault); |
1180 | 110 | }; | 108 | }; |
1181 | 111 | 109 | ||
1182 | === modified file 'src/gui/SearchDialog.cpp' | |||
1183 | --- src/gui/SearchDialog.cpp 2013-08-12 13:03:38 +0000 | |||
1184 | +++ src/gui/SearchDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1185 | @@ -121,7 +121,7 @@ | |||
1186 | 121 | 121 | ||
1187 | 122 | const char* SearchDialog::DEF_SIMBAD_URL = "http://simbad.u-strasbg.fr/"; | 122 | const char* SearchDialog::DEF_SIMBAD_URL = "http://simbad.u-strasbg.fr/"; |
1188 | 123 | 123 | ||
1190 | 124 | SearchDialog::SearchDialog() : simbadReply(NULL) | 124 | SearchDialog::SearchDialog(QObject* parent) : StelDialog(parent), simbadReply(NULL) |
1191 | 125 | { | 125 | { |
1192 | 126 | ui = new Ui_searchDialogForm; | 126 | ui = new Ui_searchDialogForm; |
1193 | 127 | simbadSearcher = new SimbadSearcher(this); | 127 | simbadSearcher = new SimbadSearcher(this); |
1194 | 128 | 128 | ||
1195 | === modified file 'src/gui/SearchDialog.hpp' | |||
1196 | --- src/gui/SearchDialog.hpp 2013-08-12 13:03:38 +0000 | |||
1197 | +++ src/gui/SearchDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1198 | @@ -67,7 +67,7 @@ | |||
1199 | 67 | Q_OBJECT | 67 | Q_OBJECT |
1200 | 68 | 68 | ||
1201 | 69 | public: | 69 | public: |
1203 | 70 | SearchDialog(); | 70 | SearchDialog(QObject* parent); |
1204 | 71 | virtual ~SearchDialog(); | 71 | virtual ~SearchDialog(); |
1205 | 72 | //! Notify that the application style changed | 72 | //! Notify that the application style changed |
1206 | 73 | void styleChanged(); | 73 | void styleChanged(); |
1207 | 74 | 74 | ||
1208 | === modified file 'src/gui/ShortcutsDialog.cpp' | |||
1209 | --- src/gui/ShortcutsDialog.cpp 2013-10-07 14:36:24 +0000 | |||
1210 | +++ src/gui/ShortcutsDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1211 | @@ -59,7 +59,8 @@ | |||
1212 | 59 | } | 59 | } |
1213 | 60 | 60 | ||
1214 | 61 | 61 | ||
1216 | 62 | ShortcutsDialog::ShortcutsDialog() : | 62 | ShortcutsDialog::ShortcutsDialog(QObject* parent) : |
1217 | 63 | StelDialog(parent), | ||
1218 | 63 | ui(new Ui_shortcutsDialogForm), | 64 | ui(new Ui_shortcutsDialogForm), |
1219 | 64 | filterModel(new ShortcutsFilterModel(this)), | 65 | filterModel(new ShortcutsFilterModel(this)), |
1220 | 65 | mainModel(new QStandardItemModel(this)) | 66 | mainModel(new QStandardItemModel(this)) |
1221 | 66 | 67 | ||
1222 | === modified file 'src/gui/ShortcutsDialog.hpp' | |||
1223 | --- src/gui/ShortcutsDialog.hpp 2013-09-13 08:21:23 +0000 | |||
1224 | +++ src/gui/ShortcutsDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1225 | @@ -55,7 +55,7 @@ | |||
1226 | 55 | Q_OBJECT | 55 | Q_OBJECT |
1227 | 56 | 56 | ||
1228 | 57 | public: | 57 | public: |
1230 | 58 | ShortcutsDialog(); | 58 | ShortcutsDialog(QObject* parent); |
1231 | 59 | ~ShortcutsDialog(); | 59 | ~ShortcutsDialog(); |
1232 | 60 | 60 | ||
1233 | 61 | //! higlight items that have collisions with current lineEdits' state according to css. | 61 | //! higlight items that have collisions with current lineEdits' state according to css. |
1234 | 62 | 62 | ||
1235 | === modified file 'src/gui/SkyGui.cpp' | |||
1236 | --- src/gui/SkyGui.cpp 2013-10-16 16:55:17 +0000 | |||
1237 | +++ src/gui/SkyGui.cpp 2013-10-17 06:10:44 +0000 | |||
1238 | @@ -278,28 +278,10 @@ | |||
1239 | 278 | 278 | ||
1240 | 279 | void SkyGui::setStelStyle(const QString& style) | 279 | void SkyGui::setStelStyle(const QString& style) |
1241 | 280 | { | 280 | { |
1264 | 281 | if (style == "night_color") | 281 | buttonBarPath->setPen(QColor::fromRgbF(0.7,0.7,0.7,0.5)); |
1265 | 282 | { | 282 | buttonBarPath->setBrush(QColor::fromRgbF(0.15, 0.16, 0.19, 0.2)); |
1266 | 283 | buttonBarPath->setPen(QColor::fromRgbF(0.7,0.0,0.0,0.5)); | 283 | buttonBar->setColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9)); |
1267 | 284 | buttonBarPath->setBrush(QColor::fromRgbF(0.23, 0.0, 0.00, 0.2)); | 284 | winBar->setColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9)); |
1246 | 285 | buttonBar->setColor(QColor::fromRgbF(0.9, 0.0, 0.0, 0.9)); | ||
1247 | 286 | winBar->setColor(QColor::fromRgbF(0.9, 0.0, 0.0, 0.9)); | ||
1248 | 287 | winBar->setRedMode(true); | ||
1249 | 288 | buttonBar->setRedMode(true); | ||
1250 | 289 | btHorizAutoHide->setRedMode(true); | ||
1251 | 290 | btVertAutoHide->setRedMode(true); | ||
1252 | 291 | } | ||
1253 | 292 | else | ||
1254 | 293 | { | ||
1255 | 294 | buttonBarPath->setPen(QColor::fromRgbF(0.7,0.7,0.7,0.5)); | ||
1256 | 295 | buttonBarPath->setBrush(QColor::fromRgbF(0.15, 0.16, 0.19, 0.2)); | ||
1257 | 296 | buttonBar->setColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9)); | ||
1258 | 297 | winBar->setColor(QColor::fromRgbF(0.9, 0.91, 0.95, 0.9)); | ||
1259 | 298 | buttonBar->setRedMode(false); | ||
1260 | 299 | winBar->setRedMode(false); | ||
1261 | 300 | btHorizAutoHide->setRedMode(false); | ||
1262 | 301 | btVertAutoHide->setRedMode(false); | ||
1263 | 302 | } | ||
1268 | 303 | } | 285 | } |
1269 | 304 | 286 | ||
1270 | 305 | // Add a new progress bar in the lower right corner of the screen. | 287 | // Add a new progress bar in the lower right corner of the screen. |
1271 | 306 | 288 | ||
1272 | === modified file 'src/gui/StelDialog.cpp' | |||
1273 | --- src/gui/StelDialog.cpp 2013-09-11 10:01:13 +0000 | |||
1274 | +++ src/gui/StelDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1275 | @@ -48,13 +48,17 @@ | |||
1276 | 48 | 48 | ||
1277 | 49 | virtual bool event(QEvent* event) | 49 | virtual bool event(QEvent* event) |
1278 | 50 | { | 50 | { |
1286 | 51 | if (event->type()==QEvent::WindowDeactivate) | 51 | switch (event->type()) |
1287 | 52 | { | 52 | { |
1288 | 53 | widget()->setWindowOpacity(0.4); | 53 | case QEvent::WindowDeactivate: |
1289 | 54 | } | 54 | widget()->setWindowOpacity(0.4); |
1290 | 55 | if (event->type()==QEvent::WindowActivate) | 55 | break; |
1291 | 56 | { | 56 | case QEvent::WindowActivate: |
1292 | 57 | widget()->setWindowOpacity(0.9); | 57 | case QEvent::GrabMouse: |
1293 | 58 | widget()->setWindowOpacity(0.9); | ||
1294 | 59 | break; | ||
1295 | 60 | default: | ||
1296 | 61 | break; | ||
1297 | 58 | } | 62 | } |
1298 | 59 | return QGraphicsProxyWidget::event(event); | 63 | return QGraphicsProxyWidget::event(event); |
1299 | 60 | } | 64 | } |
1300 | @@ -102,8 +106,10 @@ | |||
1301 | 102 | proxy->setFocus(); | 106 | proxy->setFocus(); |
1302 | 103 | return; | 107 | return; |
1303 | 104 | } | 108 | } |
1305 | 105 | 109 | ||
1306 | 110 | QGraphicsWidget* parent = qobject_cast<QGraphicsWidget*>(this->parent()); | ||
1307 | 106 | dialog = new QDialog(NULL); | 111 | dialog = new QDialog(NULL); |
1308 | 112 | // dialog->setParent(parent); | ||
1309 | 107 | StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); | 113 | StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); |
1310 | 108 | Q_ASSERT(gui); | 114 | Q_ASSERT(gui); |
1311 | 109 | //dialog->setAttribute(Qt::WA_OpaquePaintEvent, true); | 115 | //dialog->setAttribute(Qt::WA_OpaquePaintEvent, true); |
1312 | @@ -111,7 +117,7 @@ | |||
1313 | 111 | createDialogContent(); | 117 | createDialogContent(); |
1314 | 112 | dialog->setStyleSheet(gui->getStelStyle().qtStyleSheet); | 118 | dialog->setStyleSheet(gui->getStelStyle().qtStyleSheet); |
1315 | 113 | 119 | ||
1317 | 114 | proxy = new CustomProxy(NULL, Qt::Tool); | 120 | proxy = new CustomProxy(parent, Qt::Tool); |
1318 | 115 | proxy->setWidget(dialog); | 121 | proxy->setWidget(dialog); |
1319 | 116 | QSizeF size = proxy->size(); | 122 | QSizeF size = proxy->size(); |
1320 | 117 | 123 | ||
1321 | @@ -122,7 +128,6 @@ | |||
1322 | 122 | if (newY <-0) | 128 | if (newY <-0) |
1323 | 123 | newY = 0; | 129 | newY = 0; |
1324 | 124 | proxy->setPos(newX, newY); | 130 | proxy->setPos(newX, newY); |
1325 | 125 | StelMainView::getInstance().scene()->addItem(proxy); | ||
1326 | 126 | proxy->setWindowFrameMargins(2,0,2,2); | 131 | proxy->setWindowFrameMargins(2,0,2,2); |
1327 | 127 | // (this also changes the bounding rectangle size) | 132 | // (this also changes the bounding rectangle size) |
1328 | 128 | 133 | ||
1329 | 129 | 134 | ||
1330 | === modified file 'src/gui/StelGui.cpp' | |||
1331 | --- src/gui/StelGui.cpp 2013-09-29 17:32:30 +0000 | |||
1332 | +++ src/gui/StelGui.cpp 2013-10-17 06:10:44 +0000 | |||
1333 | @@ -154,13 +154,13 @@ | |||
1334 | 154 | 154 | ||
1335 | 155 | StelGuiBase::init(atopLevelGraphicsWidget); | 155 | StelGuiBase::init(atopLevelGraphicsWidget); |
1336 | 156 | skyGui = new SkyGui(atopLevelGraphicsWidget); | 156 | skyGui = new SkyGui(atopLevelGraphicsWidget); |
1344 | 157 | locationDialog = new LocationDialog(); | 157 | locationDialog = new LocationDialog(atopLevelGraphicsWidget); |
1345 | 158 | helpDialog = new HelpDialog(); | 158 | helpDialog = new HelpDialog(atopLevelGraphicsWidget); |
1346 | 159 | dateTimeDialog = new DateTimeDialog(); | 159 | dateTimeDialog = new DateTimeDialog(atopLevelGraphicsWidget); |
1347 | 160 | searchDialog = new SearchDialog(); | 160 | searchDialog = new SearchDialog(atopLevelGraphicsWidget); |
1348 | 161 | viewDialog = new ViewDialog(); | 161 | viewDialog = new ViewDialog(atopLevelGraphicsWidget); |
1349 | 162 | shortcutsDialog = new ShortcutsDialog(); | 162 | shortcutsDialog = new ShortcutsDialog(atopLevelGraphicsWidget); |
1350 | 163 | configurationDialog = new ConfigurationDialog(this); | 163 | configurationDialog = new ConfigurationDialog(this, atopLevelGraphicsWidget); |
1351 | 164 | #ifdef ENABLE_SCRIPT_CONSOLE | 164 | #ifdef ENABLE_SCRIPT_CONSOLE |
1352 | 165 | scriptConsole = new ScriptConsole(); | 165 | scriptConsole = new ScriptConsole(); |
1353 | 166 | #endif | 166 | #endif |
1354 | 167 | 167 | ||
1355 | === modified file 'src/gui/StelGuiItems.cpp' | |||
1356 | --- src/gui/StelGuiItems.cpp 2013-10-07 14:36:24 +0000 | |||
1357 | +++ src/gui/StelGuiItems.cpp 2013-10-17 06:10:44 +0000 | |||
1358 | @@ -72,18 +72,10 @@ | |||
1359 | 72 | Q_ASSERT(!pixOn.isNull()); | 72 | Q_ASSERT(!pixOn.isNull()); |
1360 | 73 | Q_ASSERT(!pixOff.isNull()); | 73 | Q_ASSERT(!pixOff.isNull()); |
1361 | 74 | 74 | ||
1362 | 75 | redMode = StelApp::getInstance().getVisionModeNight(); | ||
1363 | 76 | pixOnRed = StelButton::makeRed(pixOn); | ||
1364 | 77 | pixOffRed = StelButton::makeRed(pixOff); | ||
1365 | 78 | if (isTristate_) | 75 | if (isTristate_) |
1366 | 79 | { | 76 | { |
1367 | 80 | Q_ASSERT(!pixNoChange.isNull()); | 77 | Q_ASSERT(!pixNoChange.isNull()); |
1368 | 81 | pixNoChangeRed = StelButton::makeRed(pixNoChange); | ||
1369 | 82 | } | 78 | } |
1370 | 83 | if (!pixHover.isNull()) | ||
1371 | 84 | pixHoverRed = StelButton::makeRed(pixHover); | ||
1372 | 85 | if (!pixBackground.isNull()) | ||
1373 | 86 | pixBackgroundRed = StelButton::makeRed(pixBackground); | ||
1374 | 87 | 79 | ||
1375 | 88 | setShapeMode(QGraphicsPixmapItem::BoundingRectShape); | 80 | setShapeMode(QGraphicsPixmapItem::BoundingRectShape); |
1376 | 89 | setAcceptHoverEvents(true); | 81 | setAcceptHoverEvents(true); |
1377 | @@ -197,15 +189,15 @@ | |||
1378 | 197 | QPainter painter(&pix); | 189 | QPainter painter(&pix); |
1379 | 198 | painter.setOpacity(opacity); | 190 | painter.setOpacity(opacity); |
1380 | 199 | if (!pixBackground.isNull() && noBckground==false) | 191 | if (!pixBackground.isNull() && noBckground==false) |
1382 | 200 | painter.drawPixmap(0, 0, redMode ? pixBackgroundRed : pixBackground); | 192 | painter.drawPixmap(0, 0, pixBackground); |
1383 | 201 | painter.drawPixmap(0, 0, | 193 | painter.drawPixmap(0, 0, |
1387 | 202 | (isTristate_ && checked == ButtonStateNoChange) ? (redMode ? pixNoChangeRed : pixNoChange) : | 194 | (isTristate_ && checked == ButtonStateNoChange) ? (pixNoChange) : |
1388 | 203 | (checked == ButtonStateOn) ? (redMode ? pixOnRed : pixOn) : | 195 | (checked == ButtonStateOn) ? (pixOn) : |
1389 | 204 | /* (checked == ButtonStateOff) ? */ (redMode ? pixOffRed : pixOff)); | 196 | /* (checked == ButtonStateOff) ? */ (pixOff)); |
1390 | 205 | if (hoverOpacity > 0) | 197 | if (hoverOpacity > 0) |
1391 | 206 | { | 198 | { |
1392 | 207 | painter.setOpacity(hoverOpacity * opacity); | 199 | painter.setOpacity(hoverOpacity * opacity); |
1394 | 208 | painter.drawPixmap(0, 0, redMode ? pixHoverRed : pixHover); | 200 | painter.drawPixmap(0, 0, pixHover); |
1395 | 209 | } | 201 | } |
1396 | 210 | setPixmap(pix); | 202 | setPixmap(pix); |
1397 | 211 | } | 203 | } |
1398 | @@ -225,28 +217,9 @@ | |||
1399 | 225 | void StelButton::setBackgroundPixmap(const QPixmap &newBackground) | 217 | void StelButton::setBackgroundPixmap(const QPixmap &newBackground) |
1400 | 226 | { | 218 | { |
1401 | 227 | pixBackground = newBackground; | 219 | pixBackground = newBackground; |
1402 | 228 | pixBackgroundRed = makeRed(newBackground); | ||
1403 | 229 | updateIcon(); | 220 | updateIcon(); |
1404 | 230 | } | 221 | } |
1405 | 231 | 222 | ||
1406 | 232 | QPixmap StelButton::makeRed(const QPixmap& p) | ||
1407 | 233 | { | ||
1408 | 234 | QImage im = p.toImage().convertToFormat(QImage::Format_ARGB32); | ||
1409 | 235 | Q_ASSERT(im.format()==QImage::Format_ARGB32); | ||
1410 | 236 | QRgb* bits = (QRgb*)im.bits(); | ||
1411 | 237 | const QRgb* stop = bits+im.width()*im.height(); | ||
1412 | 238 | do | ||
1413 | 239 | { | ||
1414 | 240 | Vec3f col = StelUtils::getNightColor(Vec3f(qRed(*bits)/256.0, qGreen(*bits)/256.0, qBlue(*bits)/256.0)); | ||
1415 | 241 | *bits = qRgba((int)(256*col[0]), (int)(256*col[1]), (int)(256*col[2]), qAlpha(*bits)); | ||
1416 | 242 | ++bits; | ||
1417 | 243 | } | ||
1418 | 244 | while (bits!=stop); | ||
1419 | 245 | |||
1420 | 246 | return QPixmap::fromImage(im); | ||
1421 | 247 | } | ||
1422 | 248 | |||
1423 | 249 | |||
1424 | 250 | LeftStelBar::LeftStelBar(QGraphicsItem* parent) : QGraphicsItem(parent) | 223 | LeftStelBar::LeftStelBar(QGraphicsItem* parent) : QGraphicsItem(parent) |
1425 | 251 | { | 224 | { |
1426 | 252 | // Create the help label | 225 | // Create the help label |
1427 | @@ -332,18 +305,6 @@ | |||
1428 | 332 | helpLabel->setBrush(c); | 305 | helpLabel->setBrush(c); |
1429 | 333 | } | 306 | } |
1430 | 334 | 307 | ||
1431 | 335 | // Activate red mode for the buttons, i.e. will reduce the non red color component of the icon | ||
1432 | 336 | void LeftStelBar::setRedMode(bool b) | ||
1433 | 337 | { | ||
1434 | 338 | foreach (QGraphicsItem *child, QGraphicsItem::childItems()) | ||
1435 | 339 | { | ||
1436 | 340 | StelButton* bt = qgraphicsitem_cast<StelButton*>(child); | ||
1437 | 341 | if (bt==0) | ||
1438 | 342 | continue; | ||
1439 | 343 | bt->setRedMode(b); | ||
1440 | 344 | } | ||
1441 | 345 | } | ||
1442 | 346 | |||
1443 | 347 | BottomStelBar::BottomStelBar(QGraphicsItem* parent, | 308 | BottomStelBar::BottomStelBar(QGraphicsItem* parent, |
1444 | 348 | const QPixmap& pixLeft, | 309 | const QPixmap& pixLeft, |
1445 | 349 | const QPixmap& pixRight, | 310 | const QPixmap& pixRight, |
1446 | @@ -709,18 +670,6 @@ | |||
1447 | 709 | helpLabel->setBrush(c); | 670 | helpLabel->setBrush(c); |
1448 | 710 | } | 671 | } |
1449 | 711 | 672 | ||
1450 | 712 | // Activate red mode for the buttons, i.e. will reduce the non red color component of the icon | ||
1451 | 713 | void BottomStelBar::setRedMode(bool b) | ||
1452 | 714 | { | ||
1453 | 715 | foreach (QGraphicsItem *child, QGraphicsItem::childItems()) | ||
1454 | 716 | { | ||
1455 | 717 | StelButton* bt = qgraphicsitem_cast<StelButton*>(child); | ||
1456 | 718 | if (bt==0) | ||
1457 | 719 | continue; | ||
1458 | 720 | bt->setRedMode(b); | ||
1459 | 721 | } | ||
1460 | 722 | } | ||
1461 | 723 | |||
1462 | 724 | // Update the help label when a button is hovered | 673 | // Update the help label when a button is hovered |
1463 | 725 | void BottomStelBar::buttonHoverChanged(bool b) | 674 | void BottomStelBar::buttonHoverChanged(bool b) |
1464 | 726 | { | 675 | { |
1465 | 727 | 676 | ||
1466 | === modified file 'src/gui/StelGuiItems.hpp' | |||
1467 | --- src/gui/StelGuiItems.hpp 2013-09-18 11:16:57 +0000 | |||
1468 | +++ src/gui/StelGuiItems.hpp 2013-10-17 06:10:44 +0000 | |||
1469 | @@ -108,17 +108,9 @@ | |||
1470 | 108 | //! Set the button opacity | 108 | //! Set the button opacity |
1471 | 109 | void setOpacity(double v) {opacity=v; updateIcon();} | 109 | void setOpacity(double v) {opacity=v; updateIcon();} |
1472 | 110 | 110 | ||
1473 | 111 | //! Activate red mode for this button, i.e. will reduce the non red color component of the icon | ||
1474 | 112 | void setRedMode(bool b) {redMode=b; updateIcon();} | ||
1475 | 113 | |||
1476 | 114 | //! Set the background pixmap of the button. | 111 | //! Set the background pixmap of the button. |
1477 | 115 | //! A variant for night vision mode (pixBackgroundRed) is automatically | ||
1478 | 116 | //! generated from the new background. | ||
1479 | 117 | void setBackgroundPixmap(const QPixmap& newBackground); | 112 | void setBackgroundPixmap(const QPixmap& newBackground); |
1480 | 118 | 113 | ||
1481 | 119 | //! Transform the pixmap so that it look red for night vision mode | ||
1482 | 120 | static QPixmap makeRed(const QPixmap& p); | ||
1483 | 121 | |||
1484 | 122 | signals: | 114 | signals: |
1485 | 123 | //! Triggered when the button state changes | 115 | //! Triggered when the button state changes |
1486 | 124 | void toggled(bool); | 116 | void toggled(bool); |
1487 | @@ -157,12 +149,6 @@ | |||
1488 | 157 | QPixmap pixHover; | 149 | QPixmap pixHover; |
1489 | 158 | QPixmap pixBackground; | 150 | QPixmap pixBackground; |
1490 | 159 | 151 | ||
1491 | 160 | QPixmap pixOnRed; | ||
1492 | 161 | QPixmap pixOffRed; | ||
1493 | 162 | QPixmap pixNoChangeRed; | ||
1494 | 163 | QPixmap pixHoverRed; | ||
1495 | 164 | QPixmap pixBackgroundRed; | ||
1496 | 165 | |||
1497 | 166 | int checked; | 152 | int checked; |
1498 | 167 | 153 | ||
1499 | 168 | QTimeLine* timeLine; | 154 | QTimeLine* timeLine; |
1500 | @@ -171,8 +157,6 @@ | |||
1501 | 171 | bool isTristate_; | 157 | bool isTristate_; |
1502 | 172 | double opacity; | 158 | double opacity; |
1503 | 173 | double hoverOpacity; | 159 | double hoverOpacity; |
1504 | 174 | |||
1505 | 175 | bool redMode; | ||
1506 | 176 | }; | 160 | }; |
1507 | 177 | 161 | ||
1508 | 178 | // The button bar on the left containing windows toggle buttons | 162 | // The button bar on the left containing windows toggle buttons |
1509 | @@ -189,8 +173,6 @@ | |||
1510 | 189 | QRectF boundingRectNoHelpLabel() const; | 173 | QRectF boundingRectNoHelpLabel() const; |
1511 | 190 | //! Set the color for all the sub elements | 174 | //! Set the color for all the sub elements |
1512 | 191 | void setColor(const QColor& c); | 175 | void setColor(const QColor& c); |
1513 | 192 | //! Activate red mode for the buttons, i.e. will reduce the non red color component of the icon | ||
1514 | 193 | void setRedMode(bool b); | ||
1515 | 194 | private slots: | 176 | private slots: |
1516 | 195 | //! Update the help label when a button is hovered | 177 | //! Update the help label when a button is hovered |
1517 | 196 | void buttonHoverChanged(bool b); | 178 | void buttonHoverChanged(bool b); |
1518 | @@ -230,9 +212,6 @@ | |||
1519 | 230 | //! Set the color for all the sub elements | 212 | //! Set the color for all the sub elements |
1520 | 231 | void setColor(const QColor& c); | 213 | void setColor(const QColor& c); |
1521 | 232 | 214 | ||
1522 | 233 | //! Activate red mode for the buttons, i.e. will reduce the non red color component of the icon | ||
1523 | 234 | void setRedMode(bool b); | ||
1524 | 235 | |||
1525 | 236 | //! Set whether time must be displayed in the bottom bar | 215 | //! Set whether time must be displayed in the bottom bar |
1526 | 237 | void setFlagShowTime(bool b) {flagShowTime=b;} | 216 | void setFlagShowTime(bool b) {flagShowTime=b;} |
1527 | 238 | //! Set whether location info must be displayed in the bottom bar | 217 | //! Set whether location info must be displayed in the bottom bar |
1528 | 239 | 218 | ||
1529 | === modified file 'src/gui/ViewDialog.cpp' | |||
1530 | --- src/gui/ViewDialog.cpp 2013-09-27 03:25:58 +0000 | |||
1531 | +++ src/gui/ViewDialog.cpp 2013-10-17 06:10:44 +0000 | |||
1532 | @@ -53,7 +53,7 @@ | |||
1533 | 53 | #include <QTimer> | 53 | #include <QTimer> |
1534 | 54 | #include <QDialog> | 54 | #include <QDialog> |
1535 | 55 | 55 | ||
1537 | 56 | ViewDialog::ViewDialog() | 56 | ViewDialog::ViewDialog(QObject* parent) : StelDialog(parent) |
1538 | 57 | { | 57 | { |
1539 | 58 | ui = new Ui_viewDialogForm; | 58 | ui = new Ui_viewDialogForm; |
1540 | 59 | addRemoveLandscapesDialog = NULL; | 59 | addRemoveLandscapesDialog = NULL; |
1541 | @@ -92,25 +92,6 @@ | |||
1542 | 92 | } | 92 | } |
1543 | 93 | } | 93 | } |
1544 | 94 | 94 | ||
1545 | 95 | void ViewDialog::updateIconsColor() | ||
1546 | 96 | { | ||
1547 | 97 | QPixmap pixmap(50, 50); | ||
1548 | 98 | QStringList icons; | ||
1549 | 99 | icons << "sky" << "markings" << "landscape" << "starlore"; | ||
1550 | 100 | bool redIcon = false; | ||
1551 | 101 | if (StelApp::getInstance().getVisionModeNight()) | ||
1552 | 102 | redIcon = true; | ||
1553 | 103 | |||
1554 | 104 | foreach(const QString &iconName, icons) | ||
1555 | 105 | { | ||
1556 | 106 | pixmap.load(":/graphicGui/tabicon-" + iconName +".png"); | ||
1557 | 107 | if (redIcon) | ||
1558 | 108 | pixmap = StelButton::makeRed(pixmap); | ||
1559 | 109 | |||
1560 | 110 | ui->stackListWidget->item(icons.indexOf(iconName))->setIcon(QIcon(pixmap)); | ||
1561 | 111 | } | ||
1562 | 112 | } | ||
1563 | 113 | |||
1564 | 114 | void ViewDialog::connectCheckBox(QCheckBox* checkBox, const QString& actionId) | 95 | void ViewDialog::connectCheckBox(QCheckBox* checkBox, const QString& actionId) |
1565 | 115 | { | 96 | { |
1566 | 116 | StelAction* action = StelApp::getInstance().getStelActionManager()->findAction(actionId); | 97 | StelAction* action = StelApp::getInstance().getStelActionManager()->findAction(actionId); |
1567 | @@ -124,11 +105,9 @@ | |||
1568 | 124 | { | 105 | { |
1569 | 125 | ui->setupUi(dialog); | 106 | ui->setupUi(dialog); |
1570 | 126 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); | 107 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
1571 | 127 | connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(QString)), this, SLOT(updateIconsColor())); | ||
1572 | 128 | 108 | ||
1573 | 129 | // Set the Sky tab activated by default | 109 | // Set the Sky tab activated by default |
1574 | 130 | ui->stackedWidget->setCurrentIndex(0); | 110 | ui->stackedWidget->setCurrentIndex(0); |
1575 | 131 | updateIconsColor(); | ||
1576 | 132 | ui->stackListWidget->setCurrentRow(0); | 111 | ui->stackListWidget->setCurrentRow(0); |
1577 | 133 | 112 | ||
1578 | 134 | //ui->viewTabWidget->removeTab(4); | 113 | //ui->viewTabWidget->removeTab(4); |
1579 | 135 | 114 | ||
1580 | === modified file 'src/gui/ViewDialog.hpp' | |||
1581 | --- src/gui/ViewDialog.hpp 2013-09-11 07:20:51 +0000 | |||
1582 | +++ src/gui/ViewDialog.hpp 2013-10-17 06:10:44 +0000 | |||
1583 | @@ -33,14 +33,13 @@ | |||
1584 | 33 | { | 33 | { |
1585 | 34 | Q_OBJECT | 34 | Q_OBJECT |
1586 | 35 | public: | 35 | public: |
1588 | 36 | ViewDialog(); | 36 | ViewDialog(QObject* parent); |
1589 | 37 | virtual ~ViewDialog(); | 37 | virtual ~ViewDialog(); |
1590 | 38 | //! Notify that the application style changed | 38 | //! Notify that the application style changed |
1591 | 39 | void styleChanged(); | 39 | void styleChanged(); |
1592 | 40 | 40 | ||
1593 | 41 | public slots: | 41 | public slots: |
1594 | 42 | void retranslate(); | 42 | void retranslate(); |
1595 | 43 | void updateIconsColor(); | ||
1596 | 44 | 43 | ||
1597 | 45 | protected: | 44 | protected: |
1598 | 46 | Ui_viewDialogForm* ui; | 45 | Ui_viewDialogForm* ui; |
I've tested it on linux and this feature worked good for me. I think simplification of some parts of Stellarium is good idea.