-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Fix Gtk.Popover select translate and save state select language. #1399
Conversation
thank you so much for adding this feature |
Using localStorage is okay (in theory using GSettings would be better but probably not worth the trouble). But I would like to prevent it from leaking into other contexts, if possible (preferably each tool should have a separate origin). That's mainly why I haven't gotten around to fixing this. I think I attempted to set a different origin by setting the URL to But maybe it doesn't matter. But perhaps it should at least use a different URI scheme, to separate it from the main |
Now that's ok. I don't really understand GJS, as I understand the problem Gtk.Popover + Gtk.DropDown/select is not new https://gitlab.gnome.org/GNOME/gtk/-/issues/5568. I fixed Popover by replacing select with buttons and add saving via localStorage. Maybe I didn't do everything perfectly, but it works =) |
src/selection-tools.js
Outdated
width: 100%; | ||
} | ||
footer div { | ||
white-space: nowrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text will not always fit. You might try setting the flex-basis to max-content or fit-content but still allow it to shrink and wrap. The same applies to the . Also should probably add a gap so that the texts won't run together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very much possible that the line would not fit. The texts are localized and in other languages they could be much longer than they are in English. Also the font is set to menu
, so the text could also become too long depending on the font set by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fix long language name
- fix big "by Google"
So in the end I decided to fix it myself with 02c5727. It uses GSettings instead of localStorage. As for language selection, the main layout is the same as before: |
Added saving of language selection for translation, it is very inconvenient to select a new translation language each time. In addition to this, there is a bug related to Gtk.Popover & select (after selecting a language, the window can only be closed with focus on select, I have not yet figured out how to overcome this, it looks like a gtk bug).
If it is possible to save the state in the application without using localStorage, I will be glad if you tell me.