-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI styling revision #100
Merged
Merged
UI styling revision #100
Conversation
This file contains 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
…PU must be done with drawing before we tear down the surface)
…d passing style to them, now that we infer common drawing from the style
…kground, text, ...) but 0 is _enabled_ and 1 is disabled. This allows using style struct to pass colors etc to draw proc but selectively disable default drawing
…es space in the layout flow of the parent, and extends _around_ box's content (as defined by OC_UI_WIDTH/OC_UI_HEIGHT attributes)
4e89e10
to
f4daeff
Compare
There's a couple other things I'd also like to cleanup in the rest of the UI:
But this can probably be left to a subsequent PR |
- Boxes can cache additional status/state and get it back next frame - Added focus status used for text input
Skytrias
reviewed
Feb 13, 2025
Skytrias
reviewed
Feb 13, 2025
Skytrias
approved these changes
Feb 13, 2025
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.
This simplifies the UI styling system and its API:
oc_ui_box_begin()
/oc_ui_box_end()
(or theoc_ui_box()
) macrooc_ui_style_set_xxx()
functions, egoc_ui_style_set_i32()
for integer attributes or flags,oc_ui_style_set_color()
for color attributes, etc.oc_ui_tag()
.oc_ui_style_rule_begin()
/oc_ui_style_rule_end()
(or theoc_ui_style_rule()
) macro. Rule patterns are now passed as strings and parsed by the UI system, without needing to setup the pattern structs. E.g. you can target box "A" with tags "x" and "y" with the pattern"A.x.y"
, or descendant B of A with "A B". Hover and active statuses are also tags, so for example you can target "A.hover".oc_ui_style_set_xxx()
functions to set the rule's style.oc_ui_var_set_xxx()
functions (which create/overwrite variables) oroc_ui_var_default_xxx()
(which only creates the variable if isn't already declared upstream).oc_ui_style_set_var()
.