/*File made by @CrisXolt.
//(c) Don't use any code design without permission!*/
{
  "namespace": "common_scroll_dx",

  "scrolling_panel@common.scrolling_panel": {
    "$scroll_track_offset": [ 0, 0 ],
    "$scroll_track_image_control": "common.empty_panel",
    "$scroll_box_mouse_image_control": "$scroll_box_image_control",
    "$scroll_box_touch_image_control": "$scroll_box_image_control",
    "controls": [
      {
        "scroll_base@common_scroll_dx.scrolling_panel_base": {
          "size": "$scrolling_pane_size",
          "offset": "$scrolling_pane_offset"
        }
      }
    ]
  },
  
  "scrolling_panel_base@common.scrolling_panel_base": {
    "controls": [
      { 
        "$scroll_view_name@common.scroll_view_control": {
          "controls": [
            {
              "panel": {
                "type": "panel",
                "anchor_to": "top_left",
                "anchor_from": "top_left",
                "$view_port_size|default": [ "100%", "100%" ],
                "clips_children": true,
                "controls": [
                  { "viewport@common_scroll_dx.viewport": {} },
                  { "bar_and_track@common_scroll_dx.bar_and_track": {} }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "viewport@common.scroll_background_and_viewport": {
    "controls": [
      {
        "scrolling_view_port": {
          "layer": 1,
          "type": "panel",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "clips_children": true,
          "offset": "$scroll_view_port_offset",
          "size": "$scroll_view_port_size",
          "controls": [
            {
              "scrolling_content@$scrolling_content": {
                "layer": 2,
                "$scrolling_content_anchor_from|default": "top_left",
                "$scrolling_content_anchor_to|default": "top_left",
                "anchor_from": "$scrolling_content_anchor_from",
                "anchor_to": "$scrolling_content_anchor_to"
              }
            }
          ]
        }
      }
    ]
  },

  "bar_and_track@common.scroll_bar_and_track": {
    "size": "$scrolling_pane_size",
    "anchor_from": "center",
    "anchor_to": "center",
    "controls": [
      {
        "centered_panel": {
          "type": "panel",
          "size": "$scroll_size",
          "anchor_from": "$bar_and_track_anchor_from",
          "anchor_to": "$bar_and_track_anchor_to",
          "$bar_side|default": "scroll_right",
          "offset": "$scroll_track_offset",
          "variables": [
            {
              "requires": "($bar_side = scroll_left)",
              "$bar_and_track_anchor_from": "top_left",
              "$bar_and_track_anchor_to": "top_left"
            },
            {
              "requires": "($bar_side = scroll_right)",
              "$bar_and_track_anchor_from": "top_right",
              "$bar_and_track_anchor_to": "top_right"
            }
          ],
          "controls": [
            {
              "track@common.scrollbar_track": {
                "layer": 20,
                "anchor_from": "center",
                "anchor_to": "center"
              }
            },
            {
              "scroll_box@common.scroll_box": {
                "layer": 25,
                "anchor_from": "center",
                "anchor_to": "center"
              }
            }
          ]
        }
      }
    ]
  }
}