mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Set the min size of the tools to be a bit smaller
This commit is contained in:
parent
d26d1e294b
commit
88578fe260
|
@ -161,17 +161,12 @@ func set_button_size(button_size: int) -> void:
|
||||||
t.get_node("BackgroundLeft").rect_size.x = 12
|
t.get_node("BackgroundLeft").rect_size.x = 12
|
||||||
t.get_node("BackgroundRight").rect_size.x = 12
|
t.get_node("BackgroundRight").rect_size.x = 12
|
||||||
t.get_node("BackgroundRight").rect_position = Vector2(24, 24)
|
t.get_node("BackgroundRight").rect_position = Vector2(24, 24)
|
||||||
_tool_buttons.get_parent().rect_position.x = 9
|
|
||||||
else:
|
else:
|
||||||
for t in _tool_buttons.get_children():
|
for t in _tool_buttons.get_children():
|
||||||
t.rect_min_size = Vector2(32, 32)
|
t.rect_min_size = Vector2(32, 32)
|
||||||
t.get_node("BackgroundLeft").rect_size.x = 16
|
t.get_node("BackgroundLeft").rect_size.x = 16
|
||||||
t.get_node("BackgroundRight").rect_size.x = 16
|
t.get_node("BackgroundRight").rect_size.x = 16
|
||||||
t.get_node("BackgroundRight").rect_position = Vector2(32, 32)
|
t.get_node("BackgroundRight").rect_position = Vector2(32, 32)
|
||||||
_tool_buttons.get_parent().rect_position.x = 6
|
|
||||||
|
|
||||||
# It doesn't actually set the size to zero, it just resets it
|
|
||||||
_tool_buttons.get_parent().rect_size = Vector2.ZERO
|
|
||||||
|
|
||||||
|
|
||||||
func update_tool_buttons() -> void:
|
func update_tool_buttons() -> void:
|
||||||
|
|
|
@ -70,7 +70,10 @@ func _on_Tool_pressed(tool_pressed: BaseButton) -> void:
|
||||||
|
|
||||||
func _on_Tools_resized() -> void:
|
func _on_Tools_resized() -> void:
|
||||||
var tool_panel_size: Vector2 = get_parent().get_parent().rect_size
|
var tool_panel_size: Vector2 = get_parent().get_parent().rect_size
|
||||||
if Global.tool_button_size == Global.ButtonSize.SMALL:
|
var column_n = tool_panel_size.x / 28.5
|
||||||
columns = tool_panel_size.x / 28.5
|
if Global.tool_button_size == Global.ButtonSize.BIG:
|
||||||
else:
|
column_n = tool_panel_size.x / 36.5
|
||||||
columns = tool_panel_size.x / 36.5
|
|
||||||
|
if column_n < 1:
|
||||||
|
column_n = 1
|
||||||
|
columns = column_n
|
||||||
|
|
|
@ -23,7 +23,9 @@
|
||||||
[node name="Tools" type="ScrollContainer"]
|
[node name="Tools" type="ScrollContainer"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
rect_min_size = Vector2( 42, 0 )
|
margin_right = -1242.0
|
||||||
|
margin_bottom = -230.0
|
||||||
|
rect_min_size = Vector2( 36, 0 )
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
|
@ -44,7 +46,7 @@ margin_left = 7.0
|
||||||
margin_top = 7.0
|
margin_top = 7.0
|
||||||
margin_right = 31.0
|
margin_right = 31.0
|
||||||
margin_bottom = 479.0
|
margin_bottom = 479.0
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue