Giter VIP home page Giter VIP logo

Comments (2)

io7m avatar io7m commented on May 31, 2024

It may be worth strengthening the semanics of component selection a bit more. At least, it'd mean that the fix to this is a single line change.

Essentially, what happens now is that when the cursor overlaps a component, each child of that component is checked in turn to see if the cursor overlaps any of them. The idea being that the most specific child components (ie. the leaves of the tree) should receive events first and then pass them back up the tree if they don't handle them. Right now, for a given component c, the algorithm checks each direct child of c, stopping at the first child that matches. The current window implementation attaches components to the root window in this order: frame, titlebar, contentPane. This means that if the frame overlaps something, the frame wins.

    WindowRoot(final String in_text)
    {
      this.setWindow(Optional.of(SyWindowAbstract.this));
      this.setSelectable(false);

      this.titlebar = new Titlebar(in_text);
      this.frame = new Frame();
      this.content_pane = new ContentPane();

      final JOTreeNodeType<SyComponentType> node = this.node();
      node.childAdd(this.frame.node());
      node.childAdd(this.titlebar.node());
      node.childAdd(this.content_pane.node());
    }

The "fix" (read: workaround that depends on undeclared semantics) is to add the titlebar first.

from jsycamore.

io7m avatar io7m commented on May 31, 2024

It feels like the most recently added component should take priority. It has nicer properties such as being able to make a component take priority by simply detaching and re-adding it. If the first component takes priority, then either an extra API needs to be added (via jorchard) to add a component as the first child of a tree node, or all components must be removed and re-added to change the priority.

Unfortunately, this means that the way jorchard presents child nodes needs to be updated...

from jsycamore.

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.