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 diver, 9 years ago

Summary: [DataTranslations] stabilize window size[DataTranslations] stabilize window width

comment:2 by TwoFx, 9 years ago

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).

comment:3 by humdinger, 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:4 by TwoFx, 9 years ago

So essentially the preflet only gets wider, but not narrower?

comment:5 by humdinger, 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 TwoFx, 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 pulkomandy, 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 TwoFx, 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 pulkomandy, 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 TwoFx, 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:11 by jscipione, 8 years ago

DataTranslations window width stabalized in hrev50174

comment:12 by diver, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.