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 632156 - Colouring expressions
Colouring expressions
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 651636 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-14 16:00 UTC by Guillem Gilabert
Modified: 2011-11-28 22:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Coloured cells example (13.40 KB, image/png)
2010-10-14 16:00 UTC, Guillem Gilabert
Details

Description Guillem Gilabert 2010-10-14 16:00:14 UTC
Created attachment 172363 [details]
Coloured cells example

When I enter an expression in the expressioni entry toolbar like: A1+A2+A3+A4,   I think it would be very usefull if the text A1, A2, A3, and A4 would be coloured like the coloured cells. I think this would help to work with complex expressions involving many cells.

I attach you a picture to explain myself better. You can see that the cells are coloured, but the forula A1+A2+A3+A4 is not coloured according the cells.

Thank you very much for all your effort.

(I'm using gnumeric 1.10.8)
Comment 1 Andreas J. Guelzow 2010-10-14 19:23:24 UTC
Note that the reference that contains the cursor is always marked blue. This provides some of the functionality to see which area belongs to which reference.
Comment 2 Andreas J. Guelzow 2010-10-14 19:26:19 UTC
One should also note that using colours in the formula entry bar invites collision with the theme colours used.
Comment 3 Guillem Gilabert 2010-10-14 20:17:36 UTC
Hi Andreas, thank you very much for replying. Let me say some things about your comments.

(In reply to comment #1)
> Note that the reference that contains the cursor is always marked blue. This
> provides some of the functionality to see which area belongs to which
> reference.

This is true, and in fact is very usefull to know where you are, but, for formulas with a lot of variables it is also very usefull to know rapidly what part of the forumla is represented with wich cell, and I think using colours in the entry bar should be really usefull.

(In reply to comment #2)
> One should also note that using colours in the formula entry bar invites
> collision with the theme colours used.

I think the colision with the systhem theme should be minimal, as the function this colouring does is very specific. Maybe if you prefer, to avoid theme colision, you could implement an option to deactivate colouring, but I really think this sould not be a problem with theme, as many programs rellies in colours for specific purposes.

Thank you again for the great project you are developing. GNUMERIC is my favourite spreadsheet and I recommend its use to everyone.
Comment 4 Jean Bréfort 2010-10-15 05:56:12 UTC
The toolbar entry is based on GtkEntry which use the theme colors for both text and background. There is no API to change the colors, AFAIK.
Comment 5 Guillem Gilabert 2011-01-07 22:16:51 UTC
When you click into a cell containing a formula, you can see this formula in the toolbar entry and also in the cell shown in the spreadsheet. So maybe the formula shown in the spreadsheet could be colored, leaving the formula shonw in the toolbar entry uncolored.

What do you thik? It's the same behaviour that OOCalc implements.
Comment 6 Andreas J. Guelzow 2011-01-08 00:28:58 UTC
I really thin k the colouring should happen in both places (and if in only one then in the formula bar.)

Jean is of course correct in that the entry field is based on GtkEntry which doesn't have the API, but there is really no reason why that could not be changed.
Comment 7 Jean Bréfort 2011-01-08 07:56:05 UTC
Well, changing GtkEntry to somethings else (GtkTextView or something based on GocText) is possible, but perhaps a bit dangerous if we do that before branching. It would also allow rich text display in the formula bar.
Comment 8 Andreas J. Guelzow 2011-06-01 13:29:42 UTC
*** Bug 651636 has been marked as a duplicate of this bug. ***
Comment 9 Andreas J. Guelzow 2011-11-28 19:10:59 UTC
I have tried to use the attribute list of the layout attached to the GtkEntry but GtkEntry frequently deletes its layout. (So in 1.11.0 and 1.11.1 you would see coloured expressions in the GtkEntry but only after typing a backspace.)

In 1.11.2 and later there is no colouring in the expression entry but we do have matching colouring in the in-cell editing box. 

I guess to obtain colouring in the expression entry we really need to use a more elaborate widget.
Comment 10 Andreas J. Guelzow 2011-11-28 22:00:07 UTC
In view of comment #5: "So maybe the formula shown in the spreadsheet could be colored, leaving the formula shown in the toolbar entry uncolored." I consider this bug fixed for now. Since we now do exactly what comment #5 suggests.



This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.