nomacs icon indicating copy to clipboard operation
nomacs copied to clipboard

nomacs could not change theme through Setting Tab

Open LloydLore opened this issue 10 months ago • 8 comments

I am a new user for nomacs v3.172295. The default theme is "Dark-theme", and I'd like to use "Light-theme". Issue Description: Could not change theme through menu/settings tab, Reproduce Step:

  1. Edit --> Settings, (Ctrl+Shift+P, could enter setting tab as well)
  2. In settings tab, select General tab, and choose the option "Color Settings" from "Dark Theme" to "Light Theme"
  3. The bottom line of this tab will prompt "Please Restart nomacs to apply changes"
  4. Click the prompt, the application restarts, and the theme doesn't change
  5. Also, the option "Color Setting"'s value doesn't change.

Walkaround: I could manually change the settings resides in path "$HOME/.config/nomacs/'Image Louge.conf', the config field is "themeName312", change this value will result in application theme change.

BTW, this application is awesome, thank you!

LloydLore avatar Apr 12 '24 06:04 LloydLore

Can reproduce in Arch Linux, installed through the AUR package.

I could manually change the settings resides in path "$HOME/.config/nomacs/'Image Louge.conf', the config field is "themeName312", change this value will result in application theme change.

For anyone wondering, that variable belongs in the [DisplaySettings] section and it values can be Dark-Theme.css, Light-Theme.css or System.css

Thanks!

Aqa-Ib avatar Apr 13 '24 19:04 Aqa-Ib

Reproduced with nomacs 3.17.2295 (94e9ada) on Arch Linux.

leejuyuu avatar Apr 26 '24 19:04 leejuyuu

It seems that this bug is intermittent. Some times the theme and config file is written correctly.

leejuyuu avatar Apr 27 '24 07:04 leejuyuu

@LloydLore @Aqa-Ib I had a harder time reproducing this on 3.17.2296 (515812d) when trying to fix this. Could you try newer version as well?

A possible cause is that QSettings does not write to the file before the program closes. Maybe we can call sync() manually to try to make file writes earlier.

leejuyuu avatar Apr 27 '24 09:04 leejuyuu

@leejuyuu , I am using Arco Linux while it seems the package manager didn't update to the newest version. I will try it once the package is updated.

LloydLore avatar Apr 29 '24 09:04 LloydLore

I have tried with latest git (installed through AUR package nomacs-git) and still the same here. Probably these warnings are relevant:

[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_themeBox_currentIndexChanged(QString)
[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_keepZoom_buttonClicked(int)
[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_loadGroup_buttonClicked(int)
[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_saveGroup_buttonClicked(int)
[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_openDefault_clicked()
[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_associateFiles_clicked()
[WARNING] QMetaObject::connectSlotsByName: No matching signal for on_loadRaw_buttonClicked(int)

Aqa-Ib avatar Apr 29 '24 11:04 Aqa-Ib

I have tried with latest git (installed through AUR package nomacs-git) and still the same here.

@Aqa-Ib Thanks for providing the warning messages. Please help provide the version of nomacs you can find in “? > About”. It would be hard to identify "the latest git version" for future issue readers because the project is still being developed.

leejuyuu avatar Apr 30 '24 00:04 leejuyuu

My build is from commit e9a25e560e218713d1fdf1876aee20b858adb0a7

Aqa-Ib avatar Apr 30 '24 11:04 Aqa-Ib

I have the same issue( does not save settings) with a fresh install of Manjaro XFCE 24.0 Nomacs 3.17.2295(Qt 6.7.0 ; 94e9adaa 2024-02-29)

The build Nomacs 3.17.2295 with Qt 5.15.13 (6dfc7790, 2024-05-20) solves the issues !! So probably a Qt6 bug

REM: under "/.config/nomacs/'Image Louge.conf" I do not see/have a theme field as said in first post

artofit avatar May 21 '24 13:05 artofit

I have the same issue( does not save settings) with a fresh install of Manjaro XFCE 24.0 Nomacs 3.17.2295(Qt 6.7.0 ; 94e9ada 2024-02-29)

The build Nomacs 3.17.2295 with Qt 5.15.13 (6dfc779, 2024-05-20) solves the issues !! So probably a Qt6 bug

REM: under "/.config/nomacs/'Image Louge.conf" I do not see/have a theme field as said in first post

The theme field lies under section [DisplaySettings] and the field is themeName312

LloydLore avatar May 29 '24 13:05 LloydLore

The theme field lies under section [DisplaySettings] and the field is themeName312 With Qt 5.15.13 I have indeed under "/.config/nomacs/'Image Louge.conf" : themeName312=Dark-Theme.css @LloydLore do you mean if I revert back to Qt 6.7.x and manually modify themeName312 as such it'll be ok?

artofit avatar May 29 '24 16:05 artofit

@artofit , on my machine, nomacs is build on top of Qt 6.6.3, see below: image and I manually set the theme as such: image I shall say it works on my machine, and I don't tried this method with Qt 6.7.x.

LloydLore avatar May 30 '24 02:05 LloydLore

Thanks for the input! Confirmed it's related to the Qt version and the missing signals.

leejuyuu avatar Jun 02 '24 09:06 leejuyuu

@novomesk I think these missing signals appears because some things got renamed at some point. I suggest removing the autoconnecting QMetaObject::connectSlotsByName and replace with manually writing QObject::connect, so we can (probably) catch some of the renaming problems at compile time. Do you think this is a valid approach?

leejuyuu avatar Jun 02 '24 10:06 leejuyuu

Do you think this is a valid approach?

Honestly, I don't know. I am not familiar with this part of code.

novomesk avatar Jun 02 '24 10:06 novomesk

Thanks for the response! I'll try what I can do then.

leejuyuu avatar Jun 02 '24 10:06 leejuyuu

@LloydLore, @Aqa-Ib, @artofit If you are available, please help test whether #1096 fixes this issue (and if it breaks other things). Thanks!

leejuyuu avatar Jun 09 '24 09:06 leejuyuu