Giter Site home page Giter Site logo

DockPanel inside a DockPanel about lumino HOT 8 CLOSED

jtpio avatar jtpio commented on June 19, 2024
DockPanel inside a DockPanel

from lumino.

Comments (8)

jasongrout avatar jasongrout commented on June 19, 2024

I think this is tricky because the mimetypes from the inner dockpanel match the accepted drops for the outer dockpanel. Perhaps there is a way to override those mimetypes for one or the other to make the inner and outer dockpanels incompatible with each other.

from lumino.

jasongrout avatar jasongrout commented on June 19, 2024

Yeah, this is the mimetype it is setting and accepting. If you customized that to be different for the inner and outer dockpanels, things might work:

if (event.mimeData.hasData('application/vnd.lumino.widget-factory')) {

mimeData.setData('application/vnd.lumino.widget-factory', factory);

from lumino.

jasongrout avatar jasongrout commented on June 19, 2024

Perhaps that string should be a class parameter that can be changed for these sorts of issues? It probably ought to be at least a variable so it can be referenced instead of typed out exactly three different places.

from lumino.

jtpio avatar jtpio commented on June 19, 2024

Yes that's a good point.

It should be possible to try a quick and dirty solution, for example by appending the DockPanel id to the mime data, which would prevent drops to a widget with a different id.

Perhaps that string should be a class parameter that can be changed for these sorts of issues? It probably ought to be at least a variable so it can be referenced instead of typed out exactly three different places.

Or by adding the source to the Drag object here:

this._drag = new Drag({
mimeData, dragImage,
proposedAction: 'move',
supportedActions: 'move',
});

And checking for the source here:

if (event.mimeData.hasData('application/vnd.lumino.widget-factory')) {

from lumino.

afshin avatar afshin commented on June 19, 2024

from lumino.

jtpio avatar jtpio commented on June 19, 2024

Thanks @afshin for the extra context.

Maybe such behavior could still be enabled using an opt-in flag, to let users do something like this if they really want to.

I'll experiment with this and report back, at least to get a feeling of what it looks like in terms of UX.

from lumino.

dhirschfeld avatar dhirschfeld commented on June 19, 2024

This functionality might be useful for e.g. variable viewers for the debugger

(though I'm not sure that is an actual improvement over just adding them to the main DockPanel)

from lumino.

jtpio avatar jtpio commented on June 19, 2024

Reusing the example from above, and implementing the idea from #43 (comment) and using the source field from the Drag object:

dockpanel-source

from lumino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.