manatools / dnfdragora

dnfdragora is a dnf frontend based on libyui abstraction
GNU General Public License v3.0
137 stars 41 forks source link

GTK interface: eliminate horizontal scrolling in the package listview (ellipsize the "Summary" column's text, make other columns non-resizeable?) #174

Open nekohayo opened 4 years ago

nekohayo commented 4 years ago

When I first launched DNFDragora's GTK gui, maybe due to the default/unset width of the columns, even my 2560 pixels ultrawide screen couldn't fit the package listing contents without horizontal scrolling:

Screenshot from 2020-11-17 14-00-05

Horizontal scrolling should be avoided as much as possible. Would be nice if it could just automagically figure out the correct column widths based on the width of the window?

I'm guessing that a way to tackle the problem could be:

  1. to let the "Summary" column be ellipsizeable by pango (so the text automatically gets truncated by "..." when space is insufficient), because Summary is the one thing that is less important than the rest and that we, as users, can expect to see truncated if needed, and we can see it in the details pane anyway. And you could even make it so that a GtkTooltip shows on mouseover with the truncated details if needed.
  2. let the other columns, particularly version, release, size and status, be non-resizeable so that they fit the exact (and minimum) width they require. Basically let the "Summary" column's width be the wildcard that adjusts based on everything else.
anaselli commented 4 years ago

Unfortunately that is not doable in dnfdragora code.

The idea of changing YMGA_CBTable to implement different column behavior could be one to follow. Remember though that all starts from YTable becuase i took most of the code from there and added the checkbox. I tried to change Gtk implementation of YMGA_CBTable to get rid of that at least a bit without luck, If you have the skill we are really happy to get helped. We, as manatools team, sometimes also fix libyui-gtk when we can since upstream don't, and that to give users Gtk implementation of our tools.