Draggable tabs...

ZealAddon

22-04-2010 00:58:33

I need a widget that behaves like a web browser (think google chrome). The current tab widget is close, but I want the ability to drag/drop/reorder the tabs. I am wondering, do you think I would be better off trying to modify the current tabs widget, or am I going to have to create my own widget from the ground up?

Thanks for any advice

ZealAddon

30-04-2010 09:25:30

Well I have decided to use traditional button widgets for the tabs, and just write some custom behavior for the dragging/dropping. Looks like it might work ok. However, there is one other thing my 'web browser' needs...

How can you allow a window widget to be resized by dragging the edges? Currently I can only get a window widget to resize when you click the bottom corners, but I would like my window to be resizable if you drag on ANY edge (like windows in most OS's).

Altren

30-04-2010 12:09:56

You should look at WindowCS skin. There's property for each subwidget that allow to move/resize Window.
<Child type="Button" skin="WindowResizeRight" offset = "57 38 9 9" align = "Right Bottom" name = "Action">
<Property key="Scale" value = "0 0 1 1"/>
</Child>
<Child type="Button" skin="WindowResizeLeft" offset = "0 38 9 9" align = "Left Bottom" name = "Action">
<Property key="Scale" value = "1 0 -1 1"/>
</Child>
So you should replace subskins that cover Window corners with BUttons similar to these and add property Scale.
Property works next way: there's 4 numbers related to position and size: Left Top Width Height. 0 mean that this button doesn't change value, 1 mean that value changes in same direction where you move mouse (right/down -> increase, left/top -> decrease), -1 mean that value changes in opposite direction.
So in 1st case (WindowResizeRight) "0 0 1 1" mean that you can change both width and height, but not position.
In 2bd case (WindowResizeLeft) "1 0 -1 1" mean that you also change left position (because when you move left side position changes) and width is changes in opposite direction (because when you moving to the left width increases).