Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic switching from light to dark mode on macOS has bugs #408

Open
LenaWil opened this issue Dec 23, 2022 · 11 comments
Open

Automatic switching from light to dark mode on macOS has bugs #408

LenaWil opened this issue Dec 23, 2022 · 11 comments
Labels
bug Something isn't working fix_available Fix is ready for merging macOS macOS-related

Comments

@LenaWil
Copy link

LenaWil commented Dec 23, 2022

macOS has the possibility to automatically switch to dark mode when the sun goes under.

This does not work correctly with Gittyup.

Schermafbeelding 0004-12-23 om 19 51 41

@Murmele
Copy link
Owner

Murmele commented Dec 29, 2022

@LenaWil currently we don't have a macos developer. Shall this change happen only at restart or when the os chabges to darkmode Gittyup changes too?

@Murmele Murmele added the macOS macOS-related label Dec 29, 2022
@LenaWil
Copy link
Author

LenaWil commented Jan 1, 2023

When the sun goes under and the theme of macOS goes to dark, and Gittyup is open at the time of the change, Gittyup changes too and the glitch happens.

I tried to reproduce it both in Gnome on Ubuntu and on Windows 11 by changing the theme while it was open there, but the same glitch doesn’t happen there, because Gittyup stayed the same theme while opened even when set to system.

@Murmele
Copy link
Owner

Murmele commented Jan 2, 2023

Thank you. We will check out to get it work also with Gnome so this might fix then also your problem

@Murmele Murmele added the bug Something isn't working label Jan 2, 2023
@LenaWil
Copy link
Author

LenaWil commented Jan 2, 2023

Thank you. We will check out to get it work also with Gnome so this might fix then also your problem

Okay, just to be clear, it did not happen with gnome or Windows because there it stays the same theme.

@Murmele
Copy link
Owner

Murmele commented Jan 3, 2023

Yes but if we get it work there we might also fix the issue with MacOS. Do you have screenshots how it looks in the lightmode? What happens if you start Gittyup at night, does it look same?

@LenaWil
Copy link
Author

LenaWil commented Jan 8, 2023

If I start up Gitty in light mode:
Light mode

And this is what dark mode looks like normally:
Dark mode

The inverse glitch: (So switching from dark to light, aka sun rise, while open)
Dark to light mode

@Murmele
Copy link
Owner

Murmele commented Jan 9, 2023

Thanks for the screenshot. I will have a look into it

@Murmele
Copy link
Owner

Murmele commented Jan 9, 2023

Just for documentation:
Used in Application.cpp

  // Initialize theme.
  mTheme.reset(Theme::create(parser.value("theme")));
  setStyle(mTheme->style());
  setStyleSheet(mTheme->styleSheet());

https://successfulsoftware.net/2021/03/31/how-to-add-a-dark-theme-to-your-qt-application/

void MainWindow::changeEvent( QEvent* e )
{
#ifdef Q_OS_MACX
    if ( e->type() == QEvent::PaletteChange )
    {
        // update icons to appropriate theme
        ...
    }
#endif
    QMainWindow::changeEvent( e );
}

@Murmele
Copy link
Owner

Murmele commented Jan 9, 2023

@LenaWil If you restart Gittyup when this problem occurs, are the colors correct?

@LenaWil
Copy link
Author

LenaWil commented Jan 9, 2023

Yes.

@Murmele Murmele added the fix_available Fix is ready for merging label Jan 27, 2023
@RokeJulianLockhart
Copy link

Same on KDE Plasma.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix_available Fix is ready for merging macOS macOS-related
Projects
None yet
Development

No branches or pull requests

3 participants