[haiku-development] Re: Deskbar feature patch

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Wed, 29 Jan 2014 18:13:24 -0500

On Wed, Jan 29, 2014 at 5:27 PM, looncraz <looncraz@xxxxxxxxxxx> wrote:
> On 1/29/2014 14:03, John Scipione wrote:
>>
>> I've really tried to make Deskbar not rebuild the entire interface
>> after each action in most cases for performance reasons, it's just too
>> slow. Instead I try as hard as possible to inform each view what it
>> needs to do to move to the right place... there's a couple of
>> instances where I'm still rebuilding objects though. I've got a branch
>> where I've fixed this, I'd like to finish this up at some point.
>
> I'd prefer for no rebuilding at all :p  But considering where we started...
> I'd love to see the code!
> I have about a week before my focus is shifted again...

I've push the branch to my github so you can see it.

https://github.com/jscipione/haiku/tree/deskbar_persist_expando

I rebased this on top of the current master so it is up to date. If
you checkout and build I think it should pretty much work.

>> Agreed these classes have an unnecessarily complex relationship with each
>> other. At one point I tried to clean this up by creating three
>> BGroupLayouts, one for vertical expando mode, one for vertical mini-mode,
>> and one for horizontal mode, since the layout of the pieces is different in
>> each of these modes, and then call SetLayout on the window to choose the one
>> you want for the mode you're in as you drag the window around. I never quite
>> got it to work though, it would crash, but, I think that's ultimately the
>> way to go if you are up for the necessary layout-fu.
>
> I haven't played much with the layout kit, but I'm a quick study. Pass the
> code along!!

https://github.com/jscipione/haiku/commits/deskbar_layout

Okay, this branch is quite old and not rebased on top of the latest
code so use the code for educational purposes only. Don't build on top
of this branch, build on top of your own branch off of master and just
pull in code from this branch that you need.

Looking at the branch, it's so old and so much has changed I'm not
sure how much it's worth though.

I may take another stab at it and publish the result if you think it
might help you. A week is a bit tough to ask though, not sure when
I'll get around to it. Maybe we can push this off into the nebulous
land of later and get something a bit simpler working first.

The following branch might also interest you:

https://github.com/jscipione/haiku/commits/deskbar_width

It is my attempt to maintain a create a variable width Deskbar
respecting the width setting. I've rebased it on top of the latest
master

> anyway (so odd moving and reshaping will seem natural).
>
>> That's a decent idea. BWindow has a ScreenChanged() method you can
>> hook into to recalculate the width and redraw when the resolution
>> changes.
>
> Or we could just do it the quick'n'dirty way ;-)
>
> For myself, I just multiplied kMinimumWindowWidth by 1.5... but you wouldn't
> want that for a 4:3 screen...

You can get BScreen and calculate the dimensions of the screen and set
the minimum window width accordingly. Obviously you're gonna want to
recalculate when the screen resolution changes though, so you should
call your function in BWindow::ScreenChanged() to reset the min window
width. A bit more work but worthwhile IMHO.

Other related posts: