GNOME Bugzilla – Bug 632156
Colouring expressions
Last modified: 2011-11-28 22:00:07 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)
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.
One should also note that using colours in the formula entry bar invites collision with the theme colours used.
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.
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.
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.
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.
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.
*** Bug 651636 has been marked as a duplicate of this bug. ***
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.
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.