machinewrapped / gpt-subtrans

Open Source project using LLMs to translate SRT subtitles
Other
311 stars 36 forks source link

subtrans-dark theme dropdowns are wrong color #108

Closed Neoony closed 5 months ago

Neoony commented 5 months ago

The dropdowns in subtrans-dark theme are quite unreadable Until you hover over something

oJGvRX2

301318008-e8110b60-b370-48e6-addb-72f44483f229

EDIT: I guess its also a default theme If this is only me, then let me know what other info you might need

Windows 10 Pro 64 bit 4k 150% scaling v0.5.3 and was also same in v0.5.1 Just in case thats in any way related

machinewrapped commented 5 months ago

Ha, yes - I fought a long battle with Qt stylesheets and drop-downs and lost, unfortunately. It's really hard to get them to do what you want and seems impossible to get Windows and Mac to look the same.

The styles are defined in _internal\theme\subtrans-dark.qss if you want to try your hand at it - QComboBox, QComboBox::drop-down and QComboBox::drop-down QAbstractItemView.

The documentation is here: https://doc.qt.io/qt-6/stylesheet-syntax.html

It's possible one of the other styles is conflicting with the drop down so maybe try creating a new .qss file with just the QComboBox related styles in, and see if you can get them to look right, then add the other styles back in one-by-one and see if or when they break.

It's also possible this is relevant and I'm missing something:

Note: With complex widgets such as QComboBox and QScrollBar, if one property or sub-control is customized, all the other properties or sub-controls must be customized as well.

machinewrapped commented 5 months ago

Hello, related to a previous issue - I've added the ability to copy project settings from another project file in v0.5.4 (currently set as pre-release): https://github.com/machinewrapped/gpt-subtrans/releases/tag/v0.5.4

Can you give it a try and let me know if you encounter any issues?

Neoony commented 5 months ago

The Project Settings instructions are not loading again when starting a new project. Exact same issue as I had before v0.5.3

hmm, also some inconsistency for loading the instructions from another project I had it load ok once, and another time not (just default instructions)

Let me try more properly and clean I got 3 subtitles in one folder I will start with 1.srt Load 1.srt Project settings open, I use InstructionsMy.txt I Edit instructions, however just default are loaded I load InstructionsMy.txt, they loaded ok Fill the name, description, characters (I dont usually use characters) [btw I have to always click away from these fields, for it to apply/save, its a bit strange and one needs to get used to that] Not going to be translating for this test

Now I will load 2.srt Now the InstructionsMy.txt did seem to load from Project settings I copy settings from another project 1.subtrans Name, description, characters is filled and loaded instructions are InstructionsMy.txt - all ok

Let me try closing gui-subtrans and reopen it I load 3.srt InstructionsMy.txt is not loaded again from Project Settings I will not load them this time, just press cancel in Edit Instructions And I will copy settings from 2.subtrans which should have InstructionsMy.txt in it (I confirmed that its saved in the .subtrans) And I just realized that the Name, description, characters was not saved in 2.subtrans I think there is something that I have to click to name and description and characters for it to save it? I will check that later again

Anyways, thats not what I really wanted (but also useful), trying to reproduce instructionsMy.txt not loading when copying from project I close it again, delete 3.subtrans project to make it clean start of the previous test I verify that 1.subtrans has Name, description, characters, and instructionsMy.txt loaded - it does I load 3.srt InstructionsMy.txt are again not loaded from Project settings, but I will not load InstructionsMy.txt just Cancel Edit instructions And now I Copy settings from another project 1.subtrans Name, description, characters is loaded, however instructions are still default There is just something wrong with loading those again So basically I think they are not loading from project either, only if I loaded them manually and dont close gui-subtrans and copy from another project then they probably just remain loaded from that custom load (guessing).

Anyways let me check if this project 3.subtrans has everything saved now, to come back to the other issue And no, it didnt save anything I loaded If I press slow translate now, everything is removed as I suspected (Name, description, characters) I have noticed it before that I just have to click away after filling Description, otherwise if I just fill description and immediately press Translate, it gets removed. So I have to click into characters for example and then it applies and saves Description into the project. First few times it was always weird and then I realized I have to always do that. Can get used to it, but its weird and unexpected first few times.

Let me try that again and then click into the fields and away I copy settings from another project 1.subtrans Name, description, characters is loaded Nothing is yet saved into project I click into name and then into target language Now everything is saved into 3.subtrans Name, description, characters

So the requirement that you have to click into the field and/or away from it for it to apply and save is pretty weird here.

Also at this point, I didnt load my InstructionsMy.txt and when I check Edit Instructions, I see the default ones I press Cancel and check the 3.subtrans and inside the project the InstructionsMy.txt is actually loaded/saved ("instructions" is also visibly my custom instructions) But this is not visible in Edit Instructions

If I go into Edit Instructions and press OK Now inside 3.subtrans "Instructions" is default ones And "instruction_file": "instructionsMy.txt"

So there is something wrong there as well


To sum it up (as it got a bit lengthy)

  1. Something is not right with loading custom instructions from Project settings at clean start again (same as before v0.5.3)

  2. Something is also not right with loading them from another project Only if I manually load them in Edit Instructions and then dont close the gui-subtrans, they remain over loading/copying projects

  3. And the fact that you have to click into Name, description, characters, etc... and away, for it to apply and save the copied project settings

Additionally (unrelated to this change as this was there before, but basically related to issue 3.)

  1. When you manually fill for example Description, you have to click away from that field, otherwise its not applied or saved into project e.g. I fill Description and immediately press translate, Description is removed because I still had text cursor/focus inside it I have to fill Description and click into another field like characters for it to apply and save into project Its a bit weird, but I guess I understand you probably dont want to be saving/applying it every keypress. Not sure what would be better, I guess its only an issue if you immediately press translate Perhaps make pressing translate button apply and save those first and that would also solve issue 3. Well maybe also when you just immediately close the app, or load another srt/project. (essentially the same issue, but different scenarios)

EDIT: Probably in real scenario you will click into name and change it after copying from another project, but still...

machinewrapped commented 5 months ago

Thanks for the detailed investigation. I've updated v0.5.4, it should fix the instructions (again). Just redownload the zip.

Project settings are updated/saved when you close the settings panel - which it should now do automatically when you click translate.

I also attempted to fix dark mode dropdowns again... seems OK on Windows now, which hopefully doesn't mean they're broken on Mac 🍀

Neoony commented 5 months ago

Works good! Didnt find any more issues, everything loading fine Dropdowns are also looking good, dont have a mac to test it there

Thanks! ❤️

machinewrapped commented 5 months ago

Good :) I've been doing some more testing too and it seems to be in good shape so I've officially released it as the latest version.

The drop downs are indeed broken again on mac, but maybe a little more usable than when they're broken on Windows. I might have to do a custom dark-mac theme, but mac users are probably used to apps being a bit broken 😆

Let me know if you find any more issues - it's always good to get feedback, I get used to a particular way of working so I don't always notice if something isn't working properly when you do something different.