Skip to content

Use GuiScrollContainer on CustomShipFunctions lists#2784

Closed
oznogon wants to merge 12 commits intodaid:masterfrom
oznogon:guiscrollcontainer-customshipfunctions
Closed

Use GuiScrollContainer on CustomShipFunctions lists#2784
oznogon wants to merge 12 commits intodaid:masterfrom
oznogon:guiscrollcontainer-customshipfunctions

Conversation

@oznogon
Copy link
Copy Markdown
Contributor

@oznogon oznogon commented Mar 12, 2026

This draft demonstrates usage of #2775 and stacks on that PR. 2775 requires daid/SeriousProton#300, and CI will fail without SP 300.

Reparent CustomShipFunctions to GuiScrollContainer and tailor the
element height to the default UI on most crew screens.

Examples:

Screenshot_20260312_030439 Screenshot_20260312_030551

@oznogon oznogon changed the title Guiscrollcontainer customshipfunctions Use GuiScrollContainer on CustomShipFunctions lists Mar 12, 2026
oznogon and others added 4 commits March 13, 2026 18:28
Add GuiScrollContainer, a subclass of GuiContainer to support
arbitrary and nested scrolling elements. This relies on changes in
SeriousProton to implement GL_SCISSOR_TEST in RenderTarget.

Child element positions and click/hover handling are translated
relative to the scroll position. These containers can be nested, and
mousewheel and scroll events are passed down the tree.

This container element can also replace the bespoke scrolling behaviors
in other element types, such as GuiListbox.

- Pass focus, text input through GuiScrollContainer.
- Position nested GuiSelector popups relative to scroll translation
- Add scrollToOffset() function to allow other elements to control
  scroll position.
- Handle layout padding in scissor rects.
- Hide scrollbar if ScrollMode is None.
- Use pragma once guard
- Internal consistency in formatting
- Expand terse varnames
- Remove redundant public/protected sections in the header
Reparent CustomShipFunctions to GuiScrollContainer and tailor the
element height to the default UI on most crew screens.
@oznogon oznogon force-pushed the guiscrollcontainer-customshipfunctions branch from fa8df44 to cd5ba46 Compare March 14, 2026 04:21
oznogon and others added 8 commits March 15, 2026 03:29
Add GuiScrollContainer, a subclass of GuiContainer to support
arbitrary and nested scrolling elements. This relies on changes in
SeriousProton to implement GL_SCISSOR_TEST in RenderTarget.

Child element positions and click/hover handling are translated
relative to the scroll position. These containers can be nested, and
mousewheel and scroll events are passed down the tree.

This container element can also replace the bespoke scrolling behaviors
in other element types, such as GuiListbox.

- Pass focus, text input through GuiScrollContainer.
- Position nested GuiSelector popups relative to scroll translation
- Add scrollToOffset() function to allow other elements to control
  scroll position.
- Handle layout padding in scissor rects.
- Hide scrollbar if ScrollMode is None.
- Use pragma once guard
- Internal consistency in formatting
- Expand terse varnames
- Remove redundant public/protected sections in the header
Remove use of SP-based translation/reprojection and implement
scrolling by recursively manipulating descendant rects.

- Add GuiContainer::offsetElementRect() to recursively apply the
  given positional offset.
- Replace SP translation methods in GuiScrollContainer with
  GuiContainer::offsetElementRect().
- Update GuiSelector popup handling.
Remove offsetElementRect() (which recursively loops child elements)
and instead move elements by scroll_offset in updateLayout() (which
already recursively loops child elements).
@oznogon oznogon closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant