Comments (2)
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.
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)
- Modal windows
- Make it possible to turn off window decorations HOT 1
- Gradient fills
- Embossed outlining HOT 1
- Switch to jboxes HOT 1
- Vulkan compositor HOT 1
- Switch to jregions
- Switch to jaffirm
- Adopt 2017 conventions and primogenitor
- Fix deprecation warnings
- Make OSGi bundles
- OSGi Provide-Capability fields are wrong HOT 1
- Convert match methods to sealed interfaces HOT 1
- Component queries are not really correct HOT 1
- Window scaling is erratic when snapping
- Make window layers into big integers HOT 1
- Clarify event model HOT 1
- Split component layout function
- Move line numbers out of measured lines HOT 1
- Keyboard and focus handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsycamore.