Skip to content

Commit 5f90e62

Browse files
wjtwnbaum
authored andcommitted
Reinstate stylebox overrides
This partially reverts commit 1b6d64b (“Don't recreate resources when editing plugin scenes”). I incorrectly believed that these were being fully recreated every time the scene is instantiated based on another element's stylebox, but in fact they are being used as a template and it is only the colour that is being adjusted. See discussion at #138 (comment).
1 parent ecba986 commit 5f90e62

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

addons/block_code/ui/blocks/parameter_block/parameter_block.tscn

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
[gd_scene load_steps=3 format=3 uid="uid://clipm2dd28jde"]
1+
[gd_scene load_steps=4 format=3 uid="uid://clipm2dd28jde"]
22

33
[ext_resource type="Script" path="res://addons/block_code/ui/blocks/parameter_block/parameter_block.gd" id="1_0hajy"]
44
[ext_resource type="PackedScene" uid="uid://c7puyxpqcq6xo" path="res://addons/block_code/ui/blocks/utilities/drag_drop_area/drag_drop_area.tscn" id="2_gy5co"]
55

6+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dbera"]
7+
bg_color = Color(1, 1, 1, 1)
8+
border_width_left = 3
9+
border_width_top = 3
10+
border_width_right = 3
11+
border_width_bottom = 3
12+
corner_radius_top_left = 16
13+
corner_radius_top_right = 16
14+
corner_radius_bottom_right = 16
15+
corner_radius_bottom_left = 16
16+
617
[node name="ParameterBlock" type="MarginContainer"]
718
offset_right = 16.0
819
offset_bottom = 8.0
@@ -16,6 +27,7 @@ block_type = 3
1627
[node name="Panel" type="Panel" parent="."]
1728
unique_name_in_owner = true
1829
layout_mode = 2
30+
theme_override_styles/panel = SubResource("StyleBoxFlat_dbera")
1931

2032
[node name="DragDropArea" parent="." instance=ExtResource("2_gy5co")]
2133
layout_mode = 2

addons/block_code/ui/picker/categories/block_category_button.tscn

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
[gd_scene load_steps=6 format=3 uid="uid://bdtetj0gs45hv"]
1+
[gd_scene load_steps=7 format=3 uid="uid://bdtetj0gs45hv"]
22

33
[ext_resource type="Script" path="res://addons/block_code/ui/picker/categories/block_category_button.gd" id="1_pxxnl"]
44

5+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eogpc"]
6+
bg_color = Color(1, 0, 0, 1)
7+
corner_radius_top_left = 100
8+
corner_radius_top_right = 100
9+
corner_radius_bottom_right = 100
10+
corner_radius_bottom_left = 100
11+
512
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ousiv"]
613

714
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fyk0j"]
@@ -32,6 +39,7 @@ theme_override_constants/margin_bottom = 8
3239
[node name="Panel" type="Panel" parent="HBoxContainer/MarginContainer"]
3340
unique_name_in_owner = true
3441
layout_mode = 2
42+
theme_override_styles/panel = SubResource("StyleBoxFlat_eogpc")
3543

3644
[node name="Label" type="Label" parent="HBoxContainer"]
3745
unique_name_in_owner = true

0 commit comments

Comments
 (0)