Skip to content
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

Stretch mode and expand mode fixes #1103

Merged
merged 15 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Tools/BaseDraw.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
expand_mode = 1
stretch_mode = 6
stretch_mode = 5

[node name="BrushSize" parent="Brush" index="1" instance=ExtResource("1")]
layout_mode = 2
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/DesignTools/Bucket.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
expand_mode = 1
stretch_mode = 6
stretch_mode = 5

[node name="OffsetX" parent="FillPattern" index="1" instance=ExtResource("1")]
layout_mode = 2
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/SelectionTools/PaintSelect.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
expand_mode = 1
stretch_mode = 6
stretch_mode = 5

[node name="BrushSize" parent="Brush" index="1" instance=ExtResource("3")]
layout_mode = 2
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Buttons/BrushButton.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ offset_right = -2.0
offset_bottom = -2.0
pivot_offset = Vector2(16, 16)
expand_mode = 1
stretch_mode = 6
stretch_mode = 5

[node name="TransparentChecker" parent="BrushTexture" instance=ExtResource("1")]
show_behind_parent = true
Expand Down
40 changes: 19 additions & 21 deletions src/UI/Buttons/PatternButton.tscn
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3 uid="uid://bx6xntkb2tstx"]

[ext_resource path="res://src/UI/Buttons/PatternButton.gd" type="Script" id=2]
[ext_resource type="Script" path="res://src/UI/Buttons/PatternButton.gd" id="2"]

[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 1, 1, 1, 1 )
border_color = Color( 1, 1, 1, 1 )
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(1, 1, 1, 1)
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false

[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 1, 1, 1, 1 )
border_color = Color( 1, 1, 1, 1 )
[sub_resource type="StyleBoxFlat" id="2"]
bg_color = Color(1, 1, 1, 1)
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false

[node name="PatternButton" type="Button"]
custom_minimum_size = Vector2(32, 32)
offset_right = 32.0
offset_bottom = 32.0
custom_minimum_size = Vector2( 32, 32 )
theme_override_styles/hover = SubResource( 2 )
theme_override_styles/pressed = SubResource( 2 )
theme_override_styles/focus = SubResource( 1 )
theme_override_styles/disabled = SubResource( 1 )
theme_override_styles/normal = SubResource( 2 )
theme_override_styles/focus = SubResource("1")
theme_override_styles/disabled = SubResource("1")
theme_override_styles/hover = SubResource("2")
theme_override_styles/pressed = SubResource("2")
theme_override_styles/normal = SubResource("2")
button_mask = 7
script = ExtResource( 2 )
script = ExtResource("2")

[node name="PatternTexture" type="TextureRect" parent="."]
custom_minimum_size = Vector2(32, 32)
layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
custom_minimum_size = Vector2( 32, 32 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
expand_mode = 1
stretch_mode = 5

[connection signal="pressed" from="." to="." method="_on_PatternButton_pressed"]
1 change: 1 addition & 0 deletions src/UI/Dialogs/ExportDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func create_preview_container() -> VBoxContainer:

func create_preview_rect() -> TextureRect:
var preview := TextureRect.new()
preview.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
preview.size_flags_horizontal = Control.SIZE_EXPAND_FILL
preview.size_flags_vertical = Control.SIZE_EXPAND_FILL
preview.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
Expand Down
4 changes: 2 additions & 2 deletions src/UI/Dialogs/ImageEffects/ImageEffectParent.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("4")
expand_mode = 1
stretch_mode = 6
stretch_mode = 5

[node name="AspectRatioContainer" type="AspectRatioContainer" parent="VBoxContainer"]
layout_mode = 2
Expand All @@ -45,7 +45,7 @@ size_flags_vertical = 3
custom_minimum_size = Vector2(200, 200)
layout_mode = 2
expand_mode = 1
stretch_mode = 5
stretch_mode = 4

[node name="TransparentChecker" parent="VBoxContainer/AspectRatioContainer/Preview" instance=ExtResource("2")]
show_behind_parent = true
Expand Down
7 changes: 2 additions & 5 deletions src/UI/Dialogs/ImageEffects/ResizeCanvas.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,9 @@ layout_mode = 2
expand_mode = 1
stretch_mode = 5

[node name="TransparentChecker" parent="VBoxContainer/AspectRatioContainer/Preview" instance=ExtResource("1")]
[node name="TransparentChecker" parent="VBoxContainer/AspectRatioContainer" instance=ExtResource("1")]
show_behind_parent = true
layout_mode = 0
anchors_preset = 0
anchor_right = 1.0
anchor_bottom = 1.0
layout_mode = 2

[connection signal="about_to_popup" from="." to="." method="_on_ResizeCanvas_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_ResizeCanvas_confirmed"]
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Dialogs/ImageEffects/ShaderEffect.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ material = SubResource("1")
custom_minimum_size = Vector2(200, 200)
layout_mode = 2
expand_mode = 1
stretch_mode = 5
stretch_mode = 4

[node name="TransparentChecker" parent="VBoxContainer/AspectRatioContainer/Preview" instance=ExtResource("2")]
show_behind_parent = true
Expand Down
6 changes: 3 additions & 3 deletions src/UI/Recorder/Recorder.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ offset_right = 10.0
offset_bottom = 10.5
texture = ExtResource("1")
expand_mode = 1
stretch_mode = 6
stretch_mode = 5

[node name="Settings" type="Button" parent="ScrollContainer/CenterContainer/GridContainer" groups=["UIButtons"]]
unique_name_in_owner = true
Expand All @@ -79,7 +79,7 @@ offset_top = -10.5
offset_right = 10.0
offset_bottom = 10.5
texture = ExtResource("3")
stretch_mode = 6
stretch_mode = 5

[node name="OpenFolder" type="Button" parent="ScrollContainer/CenterContainer/GridContainer"]
custom_minimum_size = Vector2(32, 32)
Expand All @@ -97,7 +97,7 @@ offset_top = 3.0
offset_right = -3.0
offset_bottom = -3.0
texture = ExtResource("4")
stretch_mode = 6
stretch_mode = 5

[node name="OptionsDialog" type="AcceptDialog" parent="."]
position = Vector2i(0, 36)
Expand Down