class StackerBits
{
- bool reverse:1, scrollable:1, flipSpring:1, autoSize:1, endButtons:1;
+ bool reverse:1, scrollable:1, flipSpring:1, autoSize:1, endButtons:1, hoverScroll:1;
// internals
bool holdChildMonitoring:1;
}
get { return bits.endButtons; }
};
+ property bool hoverScroll
+ {
+ set { bits.hoverScroll = value; }
+ get { return bits.hoverScroll; }
+ };
private:
StackerBits bits;
RepButton left
{
nonClient = true, parent = this, visible = false, bevelOver = true, keyRepeat = true, opacity = 0; delay0 = 0.1;
+ clickThrough = true;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
RepButton right
{
nonClient = true, parent = this, visible = false, bevelOver = true, keyRepeat = true, opacity = 0; delay0 = 0.1;
+ clickThrough = true;
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
direction = vertical;
endButtons = true;
+ bool OnMouseMove(int x, int y, Modifiers mods)
+ {
+ int limit = direction == vertical ? size.h : size.w;
+ int length = direction == vertical ? scrollArea.h : scrollArea.w;
+ if(bits.hoverScroll/* && needScrollers*/ && length > limit)
+ {
+ int pos = direction == vertical ? y : x;
+ if(pos > 0)
+ {
+ int endZoneSize = (bits.endButtons ? left.size.w : 0) + 16;
+ //float ratio = (float)pos / (float)limit;
+ float ratio = (float)(Min(Max(endZoneSize, pos), limit - endZoneSize) - endZoneSize) / (float)(limit - endZoneSize * 2);
+ int offset = (int)(ratio * (length - limit));
+ if(direction == vertical)
+ scroll.y = offset;
+ else
+ scroll.x = offset;
+ size = size; // TRIGGER SCROLLING UPDATE (Currently required since we aren't using Window scrollbars)
+ }
+ }
+ return true;
+ }
+
void OnChildAddedOrRemoved(Window child, bool removed)
{
if(!child.nonClient)
{
this, text = $"Configurations: ", anchor = { left = 98, top = 8, right = 54 }; size = { 0, 26 };
opacity = 0;
- direction = horizontal, scrollable = true;
+ direction = horizontal;
+ scrollable = true;
+ endButtons = false;
+ hoverScroll = true;
bool OnKeyDown(Key key, unichar ch)
{
{
this, text = $"Platforms: ", anchor = { left = 64, top = 38, right = 54 }; size = { 0, 26 };
opacity = 0;
- direction = horizontal, scrollable = true;
+ direction = horizontal;
+ scrollable = true;
+ endButtons = false;
+ hoverScroll = true;
bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
{