Yes, Suse “Hackweek” ( where you can scratch an itch on work time ) has just been and gone. This time I wanted to work on and tackle an aspect of usability ( to do with cell styles in Calc ) that really pisses me off, e.g. when you have some cell style and you want to see what that style will look like you more or less have to apply the style. Ok, if you are really sadistic you could open the Styles dialog ( F11 ), select the style and edit it ( and they you can access format dialog which describes ( but still doesn’t really show ) all the individual elements of the style ). Excel ( in later versions at least ) does a wonderful job with this by allowing you to preview the style in-place, in other words when selecting a style whatever cells are currently selected get that style temporarily applied. Excel also does the same thing for Font selection.
First I actually decided to try and implement a simple Font preview, it’s not quite what I wanted but it seemed maybe a simpler version of what I wanted to achieve and would provide the basic knowledge to be able to tackle the styles. After far more effort that I thought I managed to get a quite passable implementation of the Font preview working despite some unexpected challenges ( e.g. the listbox implementation doesn’t easily allow you to know about the currently highlighted element in the listbox which required some poking around in vcl ) Anyway in the end and after a couple of days a much smaller patch ( that the effort would have suggested ) appeared. It’s even in master right now with this commit
Next I started tackling the Styles preview, things initially seemed to go well, the cell previewed at least all of the font related information from the selected element in the Style dialog and after realising I was missing things like Rotation etc. I managed to get that stuff working too. Then of course I noticed things like cell background or border attributes weren’t being displayed, it took me quite some time to figure out in the drawing layer where this was happening and ( I wont say understand ) but find where to modify the code to do this. At this point I ran out of time
A quick screencast shows what works currently. I really wish I had more time to tackle the style dialog itself ( or perhaps create a slimmed down version ) that would additionally in the control itself show some sort of preview of the style ( at least in terms of the font, background etc ) that could be shown on the toolbar. Also the existing dialog doesn’t track the mouse moves and highlight the element you hover over ( it’s not immediately obvious but the Styles dialog uses a Tree like widget ( although most of the time it displays like a listbox ) ) Another annoyance ( quite obvious in the screencast ) is the fact that the selection area is highlighted when previewing which has the irritating effect of changing the background colour.
The full set of patches ( based of libreoffice-4-0 ) for the hackweek work can be found here A squashed version is available here
Again note the Font preview part has been extracted from the above patches and already applied to master. There are still some issues with the CellStyle Preview that I would like to iron out before applying it.