[#2771] Implement GuiScrollContainer, a scrolling GuiContainer#2775
Open
oznogon wants to merge 4 commits intodaid:masterfrom
Open
[#2771] Implement GuiScrollContainer, a scrolling GuiContainer#2775oznogon wants to merge 4 commits intodaid:masterfrom
oznogon wants to merge 4 commits intodaid:masterfrom
Conversation
Contributor
Author
|
I've been using this implementation for a while in a branch focused on expanding ECS GM tweaks. This also has implications for the HotkeyMenu, and I've also tested replacing the bespoke scrolling and text/image clipping code in GuiListbox by using GuiScrollContainer as a parent. This can likely also be applied to the scrolling and clipping code in text boxes. Will file additional PRs for the HotkeyMenu and GuiListbox (#2777) to demonstrate the behavior. |
5659439 to
7dec195
Compare
This was referenced Mar 10, 2026
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.
- Use pragma once guard - Internal consistency in formatting - Expand terse varnames - Remove redundant public/protected sections in the header
Increase the default scrollbar click_change on GuiScrollContainer to 50, matching mousewheel scroll increments.
f0cb26d to
8b62ab9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #2771. Requires daid/SeriousProton#300.
Add
GuiScrollContainer, a subclass ofGuiElementthat further modifies its drawing functions to support clipping and vertical scrolling.GuiContainermembers related to this purpose (ownership, hover/focus, drawing, clicking, and scroll behavior).GuiContainerstyle and formatting for consistency.GuiScrollContainersubclass ofGuiElement.GuiContainermembers.This also modifies
GuiSelectorto apply scroll translation to the popup generated byGuiSelector, which is created outside of the tree.