thinkle / gourmet

Gourmet Recipe Manager
GNU General Public License v2.0
339 stars 137 forks source link

Word-wrapping incorrect #326

Open ockham opened 11 years ago

ockham commented 11 years ago

Converted from SourceForge issue 2962324, submitted by SourceForge user beelsr on 2010-03-03 01:49:09 UTC.

Using XP SP3; gourmet-0.15.4-alpha

On the main screen, for example, the recipe "Bourbon And Honey Smoke-Roasted Pork Tenderloin" gets wrapped as "Bourbon And Honey Smoke-Roasted" \n "Pork Tenderloin".

On the edit ingredients screen, for example, " beef, cut into cubes for stewing" gets wrapped as "beef, cut into cubes for" \n "stewing" but displays on a single line in the card view.

expected behavior: word-wrapping should follow the width of the column and not some other arbitrary value.

pounamu commented 10 years ago

I'm going to have a go at working on this.

ockham commented 10 years ago

Great, I'd be happy to welcome you as a contributor! Let me know if you run into any blockers, I'll try to help you work around them. BTW, thx for the triaging help!

pounamu commented 10 years ago

Ok, I've got the title on the index view wrapping to fit the column when it is resized: https://github.com/pounamu/gourmet/tree/word_wrap_bug

However the cell height doesn't change even if the wrapping will make it take up one more row than previously.

I can make the cell height refresh appropriately by clicking on the column heading (to sort the recipes) but I can't figure out how to call that function in the code. And doing this also resets the column width to the default, but it does that after adjusting the height so the height may now not be appropriate for the new width anyway.

Also the really long recipe title I have doesn't get wrapped at all when I start gourmet (it just makes the title column very wide).

ockham commented 10 years ago

Hm. I guess we'll need to put some more work into this, as this is apparently non-trivial.

FWIW, there's a SO question on this, with two possibly helpful links to writing a custom TreeCellRenderer to that effect in one answer.