bugFreeciv - Bugs: bug #21122, Wrap long lines in Messages tab

 
 
Show feedback again

bug #21122: Wrap long lines in Messages tab

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Mon 09 Sep 2013 09:49:01 PM UTC  
 
Category: client-gtk-3.0Severity: 1 - Wish
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: Operating System: Any
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 13 Oct 2013 01:23:07 PM UTC, comment #2:

> I take it you won't particularly like how patch #4165 uses part
> of the messsages window space for icons...

I actually don't think that's a big problem -- I think your icons are pretty small (comparable in size to a single character), no?

Jacob Nevins <jtn>
Project Administrator
Mon 09 Sep 2013 10:01:53 PM UTC, comment #1:

I take it you won't particularly like how patch #4165 uses part of the messsages window space for icons...

Marko Lindqvist <cazfi>
Project Administrator
Mon 09 Sep 2013 09:49:01 PM UTC, original submission:

Currently, a long line in the Messages tab of the Gtk clients will cause a horizontal scrollbar to appear.

This is particularly annoying if the (default) "Arrange widgets for small displays" option is set, and the "Message and Chat reports location" is set to "Separate" or "Split", as this leads to a tall thin Messages window (on the right-hand side), which many quite reasonable messages will not fit in without a scrollbar.

The obvious desire is to enable word-wrap for messages in the Messages window. I can't see any downside to that.

However, it turns out to be surprisingly involved.

  • Gtk2's layout engine doesn't really handle the complex interplay of negotiations necessary to make this do the right thing. I think its GtkCellRendererText "wrap-width" property sets a fixed width to wrap at, you can't say "wrap to fit container".
    • It might be possible to hook up a resize handler to set "wrap-width" for the renderer dynamically according to the widget's size allocation, but I suspect fighting Gtk in this way will cause trouble (the examples I saw had nasty fudge factors). I suspect we might have to give up on Gtk2.
  • Gtk3 has a shiny new layout engine that can handle this properly (search for "height-for-width", GtkSizeRequest). This is reflected in its documentation for GtkCellRendererText "wrap-width", which is now "the minimum width at which the text is wrapped."
    • Unfortunately, GtkTreeView doesn't yet handle this correctly: bug 653108. If you enable this (as in the attached patch) your cells get extra vertical space. The Gtk developers don't seem to be in a hurry to fix this. StackOverflow refers and has some bodges.
Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #18951:  S2_4-messagewin-wrap.patch added by jtn (653B - text/x-patch - S2_4 r23327)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 09 Sep 2013 09:49:01 PM UTCjtnAttached File-=>Added S2_4-messagewin-wrap.patch, #18951
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup