Merge lp:~guillaume-chereau/stellarium/bug-osx-1278110 into lp:stellarium

Proposed by Guillaume Chereau
Status: Merged
Approved by: Alexander Wolf
Approved revision: 6679
Merged at revision: 6681
Proposed branch: lp:~guillaume-chereau/stellarium/bug-osx-1278110
Merge into: lp:stellarium
Diff against target: 85 lines (+16/-8)
4 files modified
src/StelMainView.cpp (+11/-8)
src/gui/SkyGui.cpp (+1/-0)
src/gui/StelGuiItems.cpp (+2/-0)
src/gui/StelGuiItems.hpp (+2/-0)
To merge this branch: bzr merge lp:~guillaume-chereau/stellarium/bug-osx-1278110
Reviewer Review Type Date Requested Status
Alexander Wolf Approve
Review via email: mp+212975@code.launchpad.net

Description of the change

Possible fix for bug 1278110.

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

I'm tested it on OS X 10.8 - bottom bar works without problems now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/StelMainView.cpp'
2--- src/StelMainView.cpp 2014-03-25 04:44:50 +0000
3+++ src/StelMainView.cpp 2014-03-27 01:54:48 +0000
4@@ -315,25 +315,28 @@
5 rootContext()->setContextProperty("stelApp", stelApp);
6 setSource(QUrl("qrc:/qml/main.qml"));
7
8- QScreen* screen = glWidget->windowHandle()->screen();
9- int width = conf->value("video/screen_w", screen->size().width()).toInt();
10- int height = conf->value("video/screen_h", screen->size().height()).toInt();
11+ QSize size = glWidget->windowHandle()->screen()->size();
12+ bool fullscreen = conf->value("video/fullscreen", true).toBool();
13+ if (!fullscreen)
14+ {
15+ size = QSize(conf->value("video/screen_w", size.width()).toInt(),
16+ conf->value("video/screen_h", size.height()).toInt());
17+ }
18
19 // Without this, the screen is not shown on a Mac + we should use resize() for correct work of fullscreen/windowed mode switch. --AW WTF???
20- resize(width, height);
21+ resize(size);
22
23- if (conf->value("video/fullscreen", true).toBool())
24+ if (fullscreen)
25 {
26- setFullScreen(true);
27+ showFullScreen();
28 }
29 else
30 {
31- setFullScreen(false);
32 int x = conf->value("video/screen_x", 0).toInt();
33 int y = conf->value("video/screen_y", 0).toInt();
34 move(x, y);
35+ showNormal();
36 }
37- show();
38
39 flagInvertScreenShotColors = conf->value("main/invert_screenshots_colors", false).toBool();
40 setFlagCursorTimeout(conf->value("gui/flag_mouse_cursor_timeout", false).toBool());
41
42=== modified file 'src/gui/SkyGui.cpp'
43--- src/gui/SkyGui.cpp 2014-02-06 17:03:47 +0000
44+++ src/gui/SkyGui.cpp 2014-03-27 01:54:48 +0000
45@@ -191,6 +191,7 @@
46 buttonBarPath->setZValue(-0.1);
47 updateBarsPos();
48 connect(&StelApp::getInstance(), SIGNAL(colorSchemeChanged(const QString&)), this, SLOT(setStelStyle(const QString&)));
49+ connect(buttonBar, SIGNAL(sizeChanged()), this, SLOT(updateBarsPos()));
50 }
51
52 void SkyGui::resizeEvent(QGraphicsSceneResizeEvent* event)
53
54=== modified file 'src/gui/StelGuiItems.cpp'
55--- src/gui/StelGuiItems.cpp 2014-02-12 07:58:13 +0000
56+++ src/gui/StelGuiItems.cpp 2014-03-27 01:54:48 +0000
57@@ -376,6 +376,7 @@
58 updateButtonsGroups();
59
60 connect(button, SIGNAL(hoverChanged(bool)), this, SLOT(buttonHoverChanged(bool)));
61+ emit sizeChanged();
62 }
63
64 StelButton* BottomStelBar::hideButton(const QString& actionName)
65@@ -408,6 +409,7 @@
66 bToRemove->setParentItem(NULL);
67 bToRemove->setVisible(false);
68 updateButtonsGroups();
69+ emit sizeChanged();
70 return bToRemove;
71 }
72
73
74=== modified file 'src/gui/StelGuiItems.hpp'
75--- src/gui/StelGuiItems.hpp 2013-10-14 09:27:54 +0000
76+++ src/gui/StelGuiItems.hpp 2014-03-27 01:54:48 +0000
77@@ -217,6 +217,8 @@
78 //! Set whether location info must be displayed in the bottom bar
79 void setFlagShowLocation(bool b) {flagShowLocation=b;}
80
81+signals:
82+ void sizeChanged();
83
84 private slots:
85 //! Update the help label when a button is hovered