Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
895ef2a
dynamic_switching_between_exclusive_and_managed_full-screen_mode
uwes-ufo Nov 27, 2025
e03fbf1
Merge branch 'Stellarium:master' into dynamic_switching_between_exclu…
uwes-ufo Dec 1, 2025
de3ecd5
the change to locationDialogGui.ui isn't related
uwes-ufo Dec 1, 2025
61c5152
CodeFactor: "Redundant blank line ... should be deleted."
uwes-ufo Dec 1, 2025
dfd3f40
Avoid showing a separate-window tooltip
10110111 Dec 25, 2025
2d9b00a
let a mouse click close the tooltip
10110111 Dec 26, 2025
7d91fe9
shift to tooltip a bit
10110111 Dec 26, 2025
fcbab9b
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 27, 2025
0f4b128
Merge remote-tracking branch 'origin/scene-tooltips' into dynamic_swi…
uwes-ufo Dec 27, 2025
8032774
show original tooltip in managed fullscreen
uwes-ufo Dec 27, 2025
6bd5ea7
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 28, 2025
973020d
tooltip label size and position
uwes-ufo Dec 28, 2025
cd0450a
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 28, 2025
59a9a01
attempt to maintain the original tooltip size and position
uwes-ufo Dec 28, 2025
2d3c485
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 28, 2025
a971c77
tooltip child position
uwes-ufo Dec 28, 2025
1c19a37
tooltip
uwes-ufo Dec 29, 2025
2953262
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 29, 2025
318072e
Merge branch 'Stellarium:master' into dynamic_switching_between_exclu…
uwes-ufo Dec 29, 2025
402aae4
Merge branch 'Stellarium:master' into dynamic_switching_between_exclu…
uwes-ufo Dec 29, 2025
2e7bd8b
clear tooltip on mouse move
uwes-ufo Dec 29, 2025
a685ef8
Merge branch 'Stellarium:master' into dynamic_switching_between_exclu…
uwes-ufo Dec 29, 2025
c67e4b0
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 30, 2025
3af2366
btFullScreen-managed.png
uwes-ufo Dec 30, 2025
efe8b3b
tooltip duration shadow
uwes-ufo Dec 30, 2025
4660234
cleanup
uwes-ufo Dec 30, 2025
db64834
Merge branch 'Stellarium:master' into dynamic_switching_between_exclu…
uwes-ufo Dec 30, 2025
d912681
tooltip shadow clip region
uwes-ufo Dec 31, 2025
b6b6e44
Merge remote-tracking branch 'origin/master' into dynamic_switching_b…
uwes-ufo Dec 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/gui/btFullScreen-managed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/gui/guiRes.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<file>btFlipVertical-on.png</file>
<file>btFullScreen-off.png</file>
<file>btFullScreen-on.png</file>
<file>btFullScreen-managed.png</file>
<file>btGalacticGrid-off.png</file>
<file>btGalacticGrid-on.png</file>
<file>btGotoSelectedObject-off.png</file>
Expand Down
2 changes: 2 additions & 0 deletions data/gui/normalStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ QFrame[frameShape="5"] { /* QFrame::VLine == 0x0005 */
border: 1px solid rgb(31, 31, 31);
}

#StelToolTip,
QToolTip {
color: rgb(4, 5, 9);
font-size: 100%;
padding: 2px;
background: rgb(143, 143, 143);
border: 1px solid rgb(0, 0, 0);
}

*[nightMode="true"] QToolTip {
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ SET(stellarium_lib_SRCS
core/Dithering.hpp
core/Dithering.cpp
core/SaturationShader.hpp
core/TopMost.hpp
core/TopMost.cpp
core/StelAudioMgr.hpp
core/StelAudioMgr.cpp
core/StelVideoMgr.hpp
Expand Down
79 changes: 78 additions & 1 deletion src/StelMainView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <QGuiApplication>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsAnchorLayout>
#include <QGraphicsProxyWidget>
#include <QGraphicsWidget>
#include <QGraphicsEffect>
#include <QFileInfo>
Expand Down Expand Up @@ -349,6 +350,56 @@ class StelGraphicsScene : public QGraphicsScene
//pass event on to items otherwise
QGraphicsScene::keyPressEvent(event);
}
void helpEvent(QGraphicsSceneHelpEvent* event) override
{
const QPoint pos(parent->mapFromGlobal(event->screenPos()));
QList<QGraphicsItem*> itemsToCheck;
if (parent->isTransformed())
{
const auto xform = parent->viewportTransform();
itemsToCheck = items(xform.inverted().map(pos), Qt::IntersectsItemShape,
Qt::DescendingOrder, xform);
}
else
{
itemsToCheck = items(pos, Qt::IntersectsItemShape, Qt::DescendingOrder);
}
QString text;
QPoint point;
for (auto*const item : itemsToCheck)
{
if (const auto proxy = dynamic_cast<QGraphicsProxyWidget*>(item))
{
const auto itemWidget = proxy->widget();
if (!itemWidget) continue;
const auto child = itemWidget->childAt(itemWidget->mapFromParent(pos));
if (child && !child->toolTip().isEmpty())
{
text = child->toolTip();
point = pos;
break;
}
}
if (!item->toolTip().isEmpty())
{
text = item->toolTip();
point = pos;
break;
}
}

const auto &stel=StelMainView::getInstance();
const auto exclusive=!stel.topMost->isVisible();
if (exclusive)
{
parent->showToolTip(point, text);
event->setAccepted(!text.isEmpty());
}
else
{
QGraphicsScene::helpEvent(event);
}
}

private:
StelMainView* parent;
Expand Down Expand Up @@ -707,6 +758,7 @@ StelMainView::StelMainView(QSettings* settings)
//setMouseTracking(true);

setRenderHint(QPainter::Antialiasing);
topMost=new TopMost();
}

void StelMainView::resizeEvent(QResizeEvent* event)
Expand Down Expand Up @@ -967,7 +1019,8 @@ void StelMainView::init()
actionMgr->addAction("actionSave_Screenshot_Global", N_("Miscellaneous"), N_("Save screenshot"), this, "saveScreenShot()", "Ctrl+S");
actionMgr->addAction("actionReload_Shaders", N_("Miscellaneous"), N_("Reload shaders (for development)"), this, "reloadShaders()", "Ctrl+R, P");
actionMgr->addAction("actionSet_Full_Screen_Global", N_("Display Options"), N_("Full-screen mode"), this, "fullScreen", "F11");

actionMgr->addAction("actionSet_Full_Screen_Exclusive", N_("Display Options"), N_("Full-screen exclusive"), this, "fullScreenExclusive()", "Shift+F11");

StelPainter::initGLShaders();

guiItem = new StelGuiItem(size(), rootItem);
Expand Down Expand Up @@ -1086,6 +1139,22 @@ void StelMainView::reloadShaders()
emit reloadShadersRequested();
}

void StelMainView::fullScreenExclusive()
{
if (!isFullScreen())
return;

const auto exclusive=topMost->isVisible();
if (exclusive)
topMost->hide();
else
topMost->show();

const auto verbose=qApp->property("verbose").toBool();
if (verbose)
qDebug() << "running" << (exclusive?"exclusive":"managed") << "fullscreen";
}

// This is a series of various diagnostics based on "bugs" reported for 0.13.0 and 0.13.1.
// Almost all can be traced to insufficient driver level.
// No changes of OpenGL state is done here.
Expand Down Expand Up @@ -1480,8 +1549,11 @@ void StelMainView::initTitleI18n()

void StelMainView::setFullScreen(bool b)
{
topMost->hide();
if (b)
{
showFullScreen();
}
else
{
showNormal();
Expand Down Expand Up @@ -1990,6 +2062,11 @@ Vec3f StelMainView::getSkyBackgroundColor() const
return rootItem->getSkyBackgroundColor();
}

void StelMainView::showToolTip(const QPoint& scenePos, const QString& text)
{
gui->showToolTip(scenePos, text);
}

QRectF StelMainView::setWindowSize(int width, int height)
{
// Make sure to leave fullscreen if necessary.
Expand Down
6 changes: 6 additions & 0 deletions src/StelMainView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class QOpenGLDebugLogger;
class QOpenGLDebugMessage;
#endif
#include "VecMath.hpp"
#include "TopMost.hpp"
#include "StelApp.hpp"

class StelGLWidget;
Expand All @@ -45,6 +46,7 @@ class QSettings;
//! It is the class creating the singleton GL Widget, the main StelApp instance as well as the main GUI.
class StelMainView : public QGraphicsView
{
friend class StelGui;
friend class StelGuiItem;
friend class StelRootItem;
friend class StelGraphicsScene;
Expand Down Expand Up @@ -232,6 +234,8 @@ public slots:
//! Get the sky background color. (Actually retrieves from the StelRootItem.) Everything else than black creates a work of art!
Vec3f getSkyBackgroundColor() const;

void showToolTip(const QPoint& scenePos, const QString& text);

protected:
//! Hack to determine current monitor pixel ratio
//! @todo Find a better way to handle this
Expand Down Expand Up @@ -304,6 +308,7 @@ private slots:
void updateNightModeProperty(bool b);

void reloadShaders();
void fullScreenExclusive();

private:
//! The graphics scene notifies us when a draw finished, so that we can queue the next one
Expand Down Expand Up @@ -362,6 +367,7 @@ private slots:
//! The minimum desired time between frames, in milliseconds.
int minTimeBetweenFrames;
QTimer* fpsTimer;
TopMost *topMost=Q_NULLPTR;

//! A timer that resets the screensaver when CLI option --no-screensaver (or -F) is given.
QTimer* screensaverInhibitorTimer;
Expand Down
2 changes: 2 additions & 0 deletions src/core/StelGuiBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class StelGuiBase

virtual void init(QGraphicsWidget *atopLevelGraphicsWidget);

virtual void showToolTip(const QPoint& scenePos, const QString& text) = 0;

//! Load color scheme matching the section name.
virtual void setStelStyle(const QString& section) =0;

Expand Down
13 changes: 13 additions & 0 deletions src/core/TopMost.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "TopMost.hpp"

TopMost::TopMost(QWidget *parent) :
QWidget(parent)
{
setAttribute(Qt::WA_TranslucentBackground, true);
setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowTransparentForInput);
setGeometry(0,0,1,1);
}

TopMost::~TopMost()
{
}
19 changes: 19 additions & 0 deletions src/core/TopMost.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef TOPMOST_H
#define TOPMOST_H

#include <QWidget>

namespace Ui {
class TopMost;
}

class TopMost : public QWidget
{
Q_OBJECT

public:
explicit TopMost(QWidget *parent = nullptr);
~TopMost();
};

#endif // TOPMOST_H
22 changes: 19 additions & 3 deletions src/gui/StelGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ void StelGui::init(QGraphicsWidget *atopLevelGraphicsWidget)
astroCalcDialog = new AstroCalcDialog(atopLevelGraphicsWidget);
obsListDialog = new ObsListDialog(atopLevelGraphicsWidget);

toolTip = new StelToolTip(atopLevelGraphicsWidget);

///////////////////////////////////////////////////////////////////////
// Create all the main actions of the program, associated with shortcuts

Expand Down Expand Up @@ -353,7 +355,8 @@ void StelGui::init(QGraphicsWidget *atopLevelGraphicsWidget)

pxmapOn = QPixmap(":/graphicGui/btFullScreen-on.png");
pxmapOff = QPixmap(":/graphicGui/btFullScreen-off.png");
buttonFullscreen = new StelButton(nullptr, pxmapOn, pxmapOff, pxmapGlow32x32, "actionSet_Full_Screen_Global");
pxmapDefault = QPixmap(":/graphicGui/btFullScreen-managed.png");
buttonFullscreen = new StelButton(nullptr, pxmapOn, pxmapOff, pxmapDefault, pxmapGlow32x32, "actionSet_Full_Screen_Global", false, false, "actionSet_Full_Screen_Exclusive");
buttonFullscreen->setTriggerOnRelease(true);
skyGui->bottomBar->addButton(buttonFullscreen, "060-othersGroup");

Expand Down Expand Up @@ -630,7 +633,14 @@ void StelGui::update()
if (getAction("actionShow_Night_Mode")->isChecked() != flag)
getAction("actionShow_Night_Mode")->setChecked(flag);

flag = StelMainView::getInstance().isFullScreen();
const auto &stel=StelMainView::getInstance();
flag = stel.isFullScreen();
const auto exclusive=!stel.topMost->isVisible();
if (buttonFullscreen->secondState == exclusive)
{
buttonFullscreen->secondState=!exclusive;
buttonFullscreen->updateIcon();
}
if (getAction("actionSet_Full_Screen_Global")->isChecked() != flag)
getAction("actionSet_Full_Screen_Global")->setChecked(flag);

Expand All @@ -646,6 +656,11 @@ void StelGui::update()
}
}

void StelGui::showToolTip(const QPoint& scenePos, const QString& text)
{
toolTip->showToolTip(scenePos, text);
}

void StelGui::displayAllInfo()
{
setInfoTextFilters(StelObject::InfoStringGroup(StelObject::AllInfo));
Expand Down Expand Up @@ -1203,7 +1218,8 @@ void StelGui::setFlagShowFullscreenButton(bool b)
QPixmap pxmapGlow32x32(":/graphicGui/miscGlow32x32.png");
QPixmap pxmapOn(":/graphicGui/btFullScreen-on.png");
QPixmap pxmapOff(":/graphicGui/btFullScreen-off.png");
buttonFullscreen = new StelButton(nullptr, pxmapOn, pxmapOff, pxmapGlow32x32, "actionSet_Full_Screen_Global");
QPixmap pxmapManaged(":/graphicGui/btFullScreen-managed.png");
buttonFullscreen = new StelButton(nullptr, pxmapOn, pxmapOff, pxmapManaged, pxmapGlow32x32, "actionSet_Full_Screen_Global", false, false, "actionSet_Full_Screen_Exclusive");
}
getButtonBar()->addButton(buttonFullscreen, "060-othersGroup");
} else {
Expand Down
5 changes: 5 additions & 0 deletions src/gui/StelGui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class QGraphicsSceneMouseEvent;
class QTimeLine;
class StelButton;
class StelToolTip;
class BottomStelBar;
class InfoPanel;
class ConfigurationDialog;
Expand Down Expand Up @@ -90,6 +91,8 @@ class StelGui : public QObject, public StelGuiBase
void init(QGraphicsWidget* topLevelGraphicsWidget) override;
void update();

void showToolTip(const QPoint& scenePos, const QString& text) override;

StelStyle getStelStyle() const {return currentStelStyle;}

///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -379,6 +382,8 @@ private slots:
AstroCalcDialog* astroCalcDialog;
ObsListDialog* obsListDialog;

StelToolTip* toolTip;

bool flagShowFlipButtons;
StelButton* flipVert;
StelButton* flipHoriz;
Expand Down
Loading
Loading