raiguard / TaskList

A simple and unobtrusive todo list for Factorio.
https://mods.factorio.com/mod/TaskList
MIT License
10 stars 9 forks source link

Can't see full list even with one task (expanded) #6

Closed dgattey closed 1 year ago

dgattey commented 2 years ago

Describe the Bug

One more little thing - even with just one task, I can't see the full list if the task is expanded. If it's collapsed, there's no scroll bar that appears till I have a bunch of tasks. But if I expand that single task, suddenly the scroll bar appears (and feels unnecessary):

Task collapsed, looking good: image

Task expanded, requiring unnecessary scrolling

image image

To Reproduce

Steps to reproduce the behavior:

  1. Add one single task to the task list
  2. Open all tasks window
  3. Expand the single task, observing the scroll bar
raiguard commented 2 years ago

Unfortunately this is actually a bug with Factorio itself that I cannot fix. This happens when your description wraps to a new line. I'm working on some in-depth testing with a simple test mod so I can report it to the developers.

To avoid this, insert line breaks in your descriptions manually.

dgattey commented 2 years ago

You can't measure the height of the text box and figure out that it's two lines? Shoot, too bad. Hope you can get them on it.

raiguard commented 2 years ago

Mods cannot read GUI element sizes at all. They can change depending on locale, and locale is not part of the deterministic game system so we cannot read it and anything that it directly affects. It can be a major pain.

Measuring number of characters and adding automatic line breaks to work around this is not feasible unless I use a monospace font, which I really don't want to do.

Wrapping strings is one of the only cases that is truly broken. 95% of the time it works fine, but this specific case has issues.

dgattey commented 2 years ago

Thanks for the explanation, weird that the awesome mod support doesn't allow for locale usage.

raiguard commented 2 years ago

Bug report: https://forums.factorio.com/100896

raiguard commented 2 years ago

Sourcehut ticket: https://todo.sr.ht/~raiguard/factorio-mods/14

raiguard commented 1 year ago

The width issue was fixed recently, but the scroll pane height issue remains.

SGZ-Creations commented 1 year ago

So how did this get fixed Factorio updating or just figured it out?

raiguard commented 1 year ago

I put in some really ugly code to work around it.