From 416a1b7b15ea883b35cecbccf7f22935490a02d6 Mon Sep 17 00:00:00 2001 From: Mary Lewis Date: Sun, 1 Feb 2026 13:40:47 -0500 Subject: [PATCH 1/2] Add "margins" method to match expand_margins, etc --- README.md | 1 + addons/theme_gen/programmatic_theme.gd | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 16f7bbc..76cec28 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,7 @@ Besides this method, there are also the following shortcut methods for repetitiv - `expand_margins(...)` - `content_margins(...)` - `texture_margins(...)` +- `margins(...)` ### Creating Custom Style Variations diff --git a/addons/theme_gen/programmatic_theme.gd b/addons/theme_gen/programmatic_theme.gd index eeb5e7c..58df534 100644 --- a/addons/theme_gen/programmatic_theme.gd +++ b/addons/theme_gen/programmatic_theme.gd @@ -483,3 +483,15 @@ func texture_margins(left: int, top = null, right = null, bottom = null): "texture_margin_right": right, "texture_margin_bottom": bottom } + +func margins(left: int, top = null, right = null, bottom = null): + if top == null: top = left + if right == null: right = left + if bottom == null: bottom = top + + return { + "margin_left": left, + "margin_top": top, + "margin_right": right, + "margin_bottom": bottom + } From 4c0fb4eef23d15a2b73dbed0cc04d6d6f84e260d Mon Sep 17 00:00:00 2001 From: Mary Lewis Date: Sun, 1 Feb 2026 13:41:16 -0500 Subject: [PATCH 2/2] Correct "define_variant_style" function name in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76cec28..a5e6684 100644 --- a/README.md +++ b/README.md @@ -309,7 +309,7 @@ Besides this method, there are also the following shortcut methods for repetitiv ### Creating Custom Style Variations The Godot theming system also allows you to create multiple styles for the same node, by defining *variations*. Variations can inherit from the base style of a node or from another variation (https://docs.godotengine.org/en/stable/tutorials/ui/gui_theme_type_variations.html). -To create one in code, use the `define_style_variant(name, base_name, style)` method. +To create one in code, use the `define_variant_style(name, base_name, style)` method. ```gdscript var title_font_size = 20