connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10.01k stars 580 forks source link

toolbar-header is not draggable by default #22

Closed parro-it closed 8 years ago

parro-it commented 8 years ago

When using a frameless-window, only toolbar-footer is draggable, I think we have to add

.toolbar-header {
   -webkit-app-region: drag;
}

By the way, photon is really awesome!

connors commented 8 years ago

I actually wanted to just add this the the base .toolbar class. The problem is that there are tons of conflicts with the default system behavior for dragging when you aren't using a frameless window. So fixing the frameless window breaks non-frameless windows.

Not sure how to fix it up so everything always plays nicely.

developit commented 8 years ago

@connors Just had a thought on this - what about tagging some element higher up the tree with a generic "make draggable things draggable" class? Something like:

<div class="allow-window-drag">
    <header class="toolbar toolbar-header">
        <h1 class="title">Draggable Bar</h1>
    </header>
</app>
parro-it commented 8 years ago

Or otherwise, just add a draggable class:

    <header class="toolbar toolbar-header toolbar-draggable">
        <h1 class="title">Draggable Bar</h1>
    </header>
connors commented 8 years ago

@developit @parro-it I like that solution. I'll create a .draggable utility class so that you can add it as needed.

developit commented 8 years ago

Great, thanks, I'll add <Toolbar draggable /> to preact-photon.

connors commented 8 years ago

Fixed in 3da1898b170cc28222fb0117cc31a8e39c9b8b3f