Add dropdowns and a popup color picker
Popup draws one element above the rest of the screen and gets mouse events first; clicking or scrolling outside closes it. ElementContext now carries each element's position on screen so an input inside a scroll can open a popup beside itself. Select is a dropdown: the current value opens an OptionList with the current option ticked, scrolling for long lists and opening upward when there's no room below. The color picker moved out of ColorInput into a ColorPicker popup, so scroll areas no longer clip it and later rows no longer draw over it, and all three of its parts can be dragged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -2,13 +2,17 @@ package org.saturnclient.ui;
|
||||
|
||||
public class ElementContext {
|
||||
public int mouseX, mouseY;
|
||||
/** The element's top-left corner on the screen, for placing popups next to it */
|
||||
public int originX, originY;
|
||||
public int elementWidth, elementHeight;
|
||||
public float elementScale;
|
||||
public long elapsed;
|
||||
|
||||
public ElementContext(long elapsed, int mouseX, int mouseY, Element e) {
|
||||
public ElementContext(long elapsed, int mouseX, int mouseY, int parentX, int parentY, Element e) {
|
||||
this.mouseX = mouseX - e.x;
|
||||
this.mouseY = mouseY - e.y;
|
||||
this.originX = parentX + e.x;
|
||||
this.originY = parentY + e.y;
|
||||
this.elementWidth = e.width;
|
||||
this.elementHeight = e.height;
|
||||
this.elementScale = e.scale;
|
||||
|
||||
Reference in New Issue
Block a user