octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminal view alignment at bottom might be better


From: Daniel J Sebald
Subject: Re: Terminal view alignment at bottom might be better
Date: Sun, 23 Jun 2013 20:45:30 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 06/23/2013 11:07 AM, Daniel J Sebald wrote:
On 06/23/2013 03:18 AM, Torsten wrote:
On 23.06.2013 10:06, John W. Eaton wrote:
On 06/22/2013 09:21 PM, Daniel J Sebald wrote:


The code in this file is derived from somewhere else, so I'm not sure
how we handle this situation. Just make edits?

Yes.

I suppose there are two ways to address this:

1) Allow alignment at the top left, but make sure there is no
fractional
line at the bottom. Instead, allow there to be a fractional line of
white space at the bottom.

2) Alignment at the bottom left, which means that the top of the
terminal window is where there will be a fractional line.

I kind of prefer the second behavior for the reasons that the top of
the
window isn't where the user's eyes are drawn when typing and also a
fractional line at the top does give the impression that the text is
scrolling upward and there might be additional lines scrolled past the
top of the window.

I think I would also prefer the second option.

jwe



Maybe the attached patch already would do the trick. The alignment is
still at the top but the number of displayed lines is reduced by 1
leaving a small space under the last line.

Torsten

That change would be similar to the first case. It leaves the
possibility for quite a bit of white space (see attached PNG), although
it is an improvement because one can see the whole line.

I will look at this qRound routine:

- _lines = qMax(1, qRound(_contentHeight / _fontHeight));
+ _lines = qMax(1, qRound(_contentHeight / _fontHeight)-1);

Maybe if a floor-like function were used instead there wouldn't be the
fraction of a line at the bottom. Instead it might be similar to what
you've done but with a more limited amount of possible white space.

That didn't improve things any. The worst-case white space at the bottom was still the same.


I'll also look at what it takes to align with the bottom of the terminal
window.

I put a changeset on Savannah:

http://savannah.gnu.org/patch/?8091

that replaces any use of top,left directly by indirectly computing the top anchored from the bottom (left...left doesn't change, of course). It works pretty well. The very first line with the version number can get chopped at the start (see PNG below). If we want that fixed, I suggest another patch that will use a conditional to compute the top value depending upon whether the overall number of lines extends past the content height. I don't want to change too much at once because these computations work their way through everything and it is easy to get a mess without too much effort.

Dan

PS: This terminal view may have been done easier with the QTextEdit widget. Would still have to somehow compute the text placement over the default, but that might be easier than the complete implementation of the scrolling, drawing, etc... Some other day.

Attachment: Screenshot-Octave-terminal_alignment_topcut.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]