Opened 9 years ago
Closed 8 years ago
#12243 closed bug (fixed)
[DataTranslations] stabilize window width
Reported by: | diver | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Preferences/DataTranslations | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
DataTranslations window width jumps when walking through the list of translators which is not that nice. The same problem with Tracker's settings and Network preflet (in some locales)
Change History (12)
comment:1 by , 9 years ago
Summary: | [DataTranslations] stabilize window size → [DataTranslations] stabilize window width |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Maybe a SetExplicitMinSize could be used that stretches the narrower views to the currently widest view's size. Depending on font size. I know, this doesn't consider localization, but it's a step in the right direction. Also, chances are the widest panel in English is often also the widest in locale...
comment:5 by , 9 years ago
That too. And the narrower ones are forced wider than they would naturally be. Ideally they are fored to the widest view and the window doesn't have to be resized at all.
comment:6 by , 9 years ago
The thing is, you never know what the widest view is since a tanslator may create differently-sized views each time the view is requested.
comment:7 by , 9 years ago
It would be enough to force the window to an arbitrary minimum size (computed from the system font size). This way, if a very large translator view is shown, the window will resize up, but in most cases it won't need to. I think this will be good enough.
comment:8 by , 9 years ago
This is very similar to one of the options I gave on the mailing list (https://www.freelists.org/post/haiku-development/Fixed-width-for-the-DataTranslations-preflet). PulkoMandy, what do you think of the third idea?
comment:9 by , 9 years ago
Doing it this way (iterating all translators) as two problems:
- It will slow down startup of the preferences panel
- If a translator returns a very large size (2000px wide, for example), all the translators will work with that huge size.
I would instead decide on a fixed minimal size for the window, maybe at 600px or so (I don't remember what the size constraints for the translators are). This way, if there is one translator needing more space, only that one will have an inconveniently large window, the others will all use the minimal size. And computing the window size that way will need less time than scanning all translators at start.
comment:10 by , 9 years ago
The performance impact was something we thought about too, however I will try that out tonight to check whether it is actually noticeable. Your second point could be addressed by ignoring few translators that are significantly larger than the rest when looking for the "maximum".
comment:12 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
While this certainly would look better, if I understand the code correctly, the Translators API is defined in such a way that you cannot really know what size to pick for the whole window, since the size of the config view for a translator is decided only when it is selected from the list and may differ in subsequent selections (i.e. calls to MakeConfigurationView).