[PATCH] Switch some columns to right alignment in divelist

Anton Lundin glance at acc.umu.se
Wed Sep 3 14:12:43 PDT 2014


On 03 September, 2014 - Tomaz Canabrava wrote:

> Em 03/09/2014 17:34, "Anton Lundin" <glance at acc.umu.se> escreveu:
> >
> > On 03 September, 2014 - Tomaz Canabrava wrote:
> >
> > > Em 03/09/2014 17:24, "Anton Lundin" <glance at acc.umu.se> escreveu:
> > > >
> > > > Some columns in the dive list makes more sense to have right aligned
> > > > than left aligned. This switches the numeric columns to right
> alignment
> > > > so they is more easily compared visually.
> > > >
> > > > Signed-off-by: Anton Lundin <glance at acc.umu.se>
> > > > ---
> > > >  qt-ui/models.cpp | 21 ++++++++++++++++++++-
> > > >  1 file changed, 20 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
> > > > index 5266130..872f395 100644
> > > > --- a/qt-ui/models.cpp
> > > > +++ b/qt-ui/models.cpp
> > > > @@ -1070,7 +1070,26 @@ QVariant DiveItem::data(int column, int role)
> const
> > > >
> > > >         switch (role) {
> > > >         case Qt::TextAlignmentRole:
> > > > -               retVal = int(Qt::AlignLeft | Qt::AlignVCenter);
> > > > +               switch (column) {
> > > > +               case NR:
> > > > +               case DEPTH:
> > > > +               case DURATION:
> > > > +               case TEMPERATURE:
> > > > +               case TOTALWEIGHT:
> > > > +               case SAC:
> > > > +               case OTU:
> > > > +               case MAXCNS:
> > > > +                       retVal = int(Qt::AlignRight |
> Qt::AlignVCenter);
> > > > +                       break;
> > > > +               case DATE:
> > > > +               case RATING:
> > > > +               case SUIT:
> > > > +               case CYLINDER:
> > > > +               case GAS:
> > > > +               case LOCATION:
> > > > +                       retVal = int(Qt::AlignLeft |
> Qt::AlignVCenter);
> > > > +                       break;
> > > > +               }
> > > >                 break;
> > > >         case DiveTripModel::SORT_ROLE:
> > > >                 Q_ASSERT(dive != NULL);
> > > > --
> > > > 1.9.1
> > > >
> > > >
> > >
> > > Nope.
> > > NR is one of the columns that this doesn't works because of the way that
> > > the treeview works. There is actually a commit from me reverting this a
> > > while ago.
> > >
> >
> > On my system i have a visual tab on all the trip-child-dives, and
> > right-aligning the NR column makes the non-trip-dive-numbers align with
> > the trip-dive-numbers.
> >
> > I would prefer if we could get rid of that implicit tab on trip dives.
> > It just makes things look inconsistent if you lower the with for the NR
> > column.
> 
> Can you send a picture só I can better visualize this?
> 
> The issue on changing the NR to right Align is that its hard to say whats
> on a trip and whats not.

Here is two pictures that show what i mean.

For example, look at the alignment of the duration column. When you have
two dives besides each other where one is above 1h and one below, it
looks really wierd:
35:50
1:03:20

I say it looks way better right aligned:
  35:50
1:03:20

The other one is that the initial tab in the trip-number-column doesn't
fold away, so if you lowers that column to the with of non-trip-numbers
the trip numbers gets folded away.

//Anton

-- 
Anton Lundin	+46702-161604
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wierd-divelist.png
Type: image/png
Size: 15572 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140903/3647b147/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wierd-divelist2.png
Type: image/png
Size: 13250 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140903/3647b147/attachment-0003.png>


More information about the subsurface mailing list