[GSOC]Use Widget Layout for the Start Center Weekly Update 07

Jan Holesovsky kendy at suse.cz
Mon Aug 26 09:00:57 PDT 2013


Hi Krisztian,

Sorry for my late reply :-(

Krisztian Pinter píše v St 21. 08. 2013 v 21:08 +0200:

> I'm also working on adding a toggle button to switch between recent
> docs and templates, but I encountered a problem.
> Here's a patch with a non-functioning test
> version: https://gerrit.libreoffice.org/#/c/5543/
> I have two custom widgets in a grid, one for templates and one for
> recent docs, but they both render as a narrow white strip. (See the
> tab for presentations.) On the last tab, you can see that the custom
> widget for templates is working properly.

This turns out to conflict with the recent addition of more of the
buttons - can you please rebase it on top of the current master?  Will
have a look tomorrow :-)

> I was asked if I could make the scrolling smoother (it always moves
> thumbnails 1 row at once when the scrollbar passes a treshold) in the
> RecentDocsView class I made. RecentDocsView inherits from
> ThumbnailView, which uses Window::HandleScrollCommand for scrolling.
> Is it possible to make it smoother without basically reimplementing
> Window::HandleScrollCommand?

So I believe this is more about how the scrollbar in ThumbnailView is
setup, than the exact handling of HandleScrollCommand.  If I read it
correctly, mpScrBar in sfx2/source/control/thumbnailview.cxx uses things
like

mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols);

and 

mpScrBar->SetThumbPos( (long)mnFirstLine );

ie. is explicitly set so that 1 line is one thumbnail only.

I'd try to make it multiplied by 10 or so, and adjust the drawing offset
& obtaining the current position accordingly - does that make sense?

> In the original Start Center, one could drag and drop files onto it,
> and they would open. I noticed that this only worked if one didn't
> drop the file on a button, but on the background. After converting
> to .ui, it only works if one drops the file on the edge of the window,
> where there aren't any widgets covering the background. Is there a way
> to cover the whole window with the drag&drop functionality?

Hard to say - I'd try to add the drag and drop handler for one of the
buttons to check if you can make it work that way on one of the buttons;
and if that works, go for a broader solution.  And if no broader
solution exists, then either decide that we are not going to support
that any longer, or set all the widgets with the drop functionality ;-)

> I was asked to make the background of RecentDocsView transparent,
> instead of white. I checked, and ThumbnailView::Paint draws a rounded
> rectangle with it's set background color. I set this color to
> COL_TRANSPARENT, and now indeed it seems not to draw this rectangle,
> but the background of the custom widget is still a white rectangle. Is
> this behavior inherited from Window or Control or something? And is it
> possible to change it? The inherited Paint methods don't seem to be
> drawing anything.

I haven't looked deeper, but there is that SetBackground() function; you
might want to use something like

SetBackground(Wallpaper( COL_TRANSPARENT ))

But did not try it myself; if that does not lead anywhere, please poke
me, I'll play with that.

All the best,
Kendy




More information about the LibreOffice mailing list