After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754841 - Fixed width diary entries
Fixed width diary entries
Status: RESOLVED FIXED
Product: almanah
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: diary-maint
diary-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-10 15:10 UTC by Álvaro Peña
Modified: 2015-10-12 17:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
UI: Main entry text widget fixed width (2.96 KB, patch)
2015-09-20 19:00 UTC, Álvaro Peña
committed Details | Review
UI: Fixed main text view scroll background (3.53 KB, patch)
2015-10-11 18:34 UTC, Álvaro Peña
none Details | Review
UI: Fixed main text view scroll background (3.34 KB, patch)
2015-10-12 10:57 UTC, Álvaro Peña
committed Details | Review

Description Álvaro Peña 2015-09-10 15:10:59 UTC
When the user maximizes the Almanah Diary main window, all the text for the current entry spreads along the width, which turns it really difficult to read the content.

Following design guidelines for GNOME Notes[1] and in concrete #751442, limit the entry content to a maximum width (not the window, just the text content). Allan Day suggests that "more than 12 words long [the text] become difficult to read".

1. https://blogs.gnome.org/aday/2015/06/24/notes-future-plans/
Comment 1 Philip Withnall 2015-09-10 15:54:11 UTC
Alternatively, render into fixed-width columns, like a newspaper:
http://arneberg.com/columns/ch/2012/0729.bike_dells/pics/2012.0729.bike_dells.jpg

(This should probably be discussed with a designer if you want to implement it.)
Comment 2 Álvaro Peña 2015-09-20 19:00:00 UTC
Created attachment 311718 [details] [review]
UI: Main entry text widget fixed width

The GtkTextView has been centered into a GtkEventBox, which allow us to
draw the background with the same color of the GtkTextView, so the space
around the GtkTextView looks like paper.
Comment 3 Álvaro Peña 2015-09-20 19:04:13 UTC
(In reply to Philip Withnall from comment #1)
> Alternatively, render into fixed-width columns, like a newspaper:
> http://arneberg.com/columns/ch/2012/0729.bike_dells/pics/2012.0729.
> bike_dells.jpg
> 
> (This should probably be discussed with a designer if you want to implement
> it.)

Looks interesting. Something like that requires a new TextView, don't you think?
Comment 4 Philip Withnall 2015-09-22 13:53:12 UTC
(In reply to Álvaro Peña from comment #3)
> (In reply to Philip Withnall from comment #1)
> > Alternatively, render into fixed-width columns, like a newspaper:
> > http://arneberg.com/columns/ch/2012/0729.bike_dells/pics/2012.0729.
> > bike_dells.jpg
> > 
> > (This should probably be discussed with a designer if you want to implement
> > it.)
> 
> Looks interesting. Something like that requires a new TextView, don't you
> think?

Probably. It would probably be very complex to implement. Perhaps best left for the future. :-)
Comment 5 Philip Withnall 2015-09-22 13:55:25 UTC
Review of attachment 311718 [details] [review]:

If I enter a very long line of ‘dddddddddddd’ (for example), this still results in a horizontal scroll bar appearing and no line wrapping taking place. Is that what you intended?
Comment 6 Philip Withnall 2015-09-22 14:10:38 UTC
Oh bother, I just accidentally pushed this as 7f79c8df0f387d073556ada0bfe3d5eeb4b5665f. Sorry.

Any changes to it will have to happen as follow-up commits.
Comment 7 Álvaro Peña 2015-09-23 12:18:33 UTC
(In reply to Philip Withnall from comment #5)
> Review of attachment 311718 [details] [review] [review]:
> 
> If I enter a very long line of ‘dddddddddddd’ (for example), this still
> results in a horizontal scroll bar appearing and no line wrapping taking
> place. Is that what you intended?

Nop, looks like I have selected the wrong "wrap-mode" for the GtkTextView, thanks for pointing.
Comment 8 Álvaro Peña 2015-09-25 11:31:41 UTC
(In reply to Philip Withnall from comment #6)
> Oh bother, I just accidentally pushed this as
> 7f79c8df0f387d073556ada0bfe3d5eeb4b5665f. Sorry.
> 
> Any changes to it will have to happen as follow-up commits.

Don't worry Philip.

At the moment there are two problems right now (plus the wrap-mode):

1. the GtkTextView doesn't scrolls the scrolled window when the user moves the text pointer to an off-screen place.
2. The main window width can be less than the GtkTextView width, so a horizontal scroll bar appear. The main window can't be less than the GtkTextView width.
Comment 9 Álvaro Peña 2015-10-11 18:34:09 UTC
Created attachment 313072 [details] [review]
UI: Fixed main text view scroll background

Just adding the "view" class to the ScrolledWindow has been enough to
turn the background into white, and no intermediated widgets has been
neccesary.

Thanks to Florian Müllner for pointing me to this solutions!
Comment 10 Álvaro Peña 2015-10-12 10:57:07 UTC
Created attachment 313113 [details] [review]
UI: Fixed main text view scroll background

Just adding the "view" class to the ScrolledWindow has been enough to
turn the background into white, and no intermediated widgets has been
neccesary.

Thanks to Florian Müllner for pointing me to this solutions!
Comment 11 Álvaro Peña 2015-10-12 10:57:51 UTC
Review of attachment 311718 [details] [review]:

Commited.
Comment 12 Álvaro Peña 2015-10-12 10:59:05 UTC
Comment on attachment 313113 [details] [review]
UI: Fixed main text view scroll background

Attachment 313113 [details] pushed as e2b11c5 - UI: Fixed main text view scroll background
Comment 13 Álvaro Peña 2015-10-12 11:01:18 UTC
So now just remains one thing:

The fixed width of the GtkTextView depends on the current font size, so at start time, and every time that the default font changes, calculate the required size for a sample sentence with at least 12 words.
Comment 14 Álvaro Peña 2015-10-12 17:13:18 UTC
(In reply to Álvaro Peña from comment #13)
> So now just remains one thing:
> 
> The fixed width of the GtkTextView depends on the current font size, so at
> start time, and every time that the default font changes, calculate the
> required size for a sample sentence with at least 12 words.

Nop, I'm going to finish this thing in https://bugzilla.gnome.org/show_bug.cgi?id=754842