From ea2c731cd34adb07b0b7380962e1f4b8b2e0eb3d Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 27 Oct 2020 18:21:57 +0100 Subject: [PATCH] File explorer document icon --- nodes/document.svg | 77 ++++++++++++++++++++++++++++++++ nodes/document.svg.import | 34 ++++++++++++++ scenes/cardgame.tscn | 64 -------------------------- scenes/{cardgame.gd => cards.gd} | 0 scenes/cards.tscn | 3 +- scenes/file_browser.tscn | 1 + scenes/file_browser_item.tscn | 48 ++++++++++++-------- scenes/node.tscn | 2 +- scenes/repository.gd | 2 + scenes/text_editor.tscn | 2 +- 10 files changed, 148 insertions(+), 85 deletions(-) create mode 100644 nodes/document.svg create mode 100644 nodes/document.svg.import delete mode 100644 scenes/cardgame.tscn rename scenes/{cardgame.gd => cards.gd} (100%) diff --git a/nodes/document.svg b/nodes/document.svg new file mode 100644 index 0000000..f1ebdbf --- /dev/null +++ b/nodes/document.svg @@ -0,0 +1,77 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/nodes/document.svg.import b/nodes/document.svg.import new file mode 100644 index 0000000..4c5b739 --- /dev/null +++ b/nodes/document.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/document.svg-b9fdc82a659cb4c40c5c95e09b615070.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://nodes/document.svg" +dest_files=[ "res://.import/document.svg-b9fdc82a659cb4c40c5c95e09b615070.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/cardgame.tscn b/scenes/cardgame.tscn deleted file mode 100644 index eaed90f..0000000 --- a/scenes/cardgame.tscn +++ /dev/null @@ -1,64 +0,0 @@ -[gd_scene load_steps=6 format=2] - -[ext_resource path="res://fonts/default.tres" type="DynamicFont" id=1] -[ext_resource path="res://scenes/repository.tscn" type="PackedScene" id=3] -[ext_resource path="res://scenes/cardgame.gd" type="Script" id=4] -[ext_resource path="res://scenes/terminal.tscn" type="PackedScene" id=5] -[ext_resource path="res://fonts/big.tres" type="DynamicFont" id=6] - -[node name="Cardgame" type="Node2D"] -script = ExtResource( 4 ) - -[node name="ColorRect" type="ColorRect" parent="."] -margin_right = 1922.0 -margin_bottom = 1083.0 -mouse_filter = 2 -color = Color( 0.0823529, 0.0823529, 0.0823529, 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="RepositoryRemote" parent="." instance=ExtResource( 3 )] -margin_right = 748.0 -margin_bottom = 746.0 -label = "remote" -simplified_view = true - -[node name="Repository" parent="." instance=ExtResource( 3 )] -margin_left = 762.0 -margin_right = 1481.0 -margin_bottom = 744.0 -label = "yours" -simplified_view = true - -[node name="Terminal" parent="." instance=ExtResource( 5 )] -margin_left = 1488.0 -margin_top = 5.0 -margin_right = 1914.0 -margin_bottom = 745.0 - -[node name="Button" type="Button" parent="."] -margin_left = 1719.41 -margin_top = 814.594 -margin_right = 1892.41 -margin_bottom = 856.594 -custom_fonts/font = ExtResource( 1 ) -text = "Draw new cards" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Energy" type="Label" parent="."] -modulate = Color( 0.431373, 0.792157, 0.423529, 1 ) -margin_left = 35.3364 -margin_top = 796.429 -margin_right = 75.3364 -margin_bottom = 845.429 -rect_scale = Vector2( 2, 2 ) -custom_fonts/font = ExtResource( 6 ) -text = "3" -__meta__ = { -"_edit_use_anchors_": false -} -[connection signal="command_done" from="Terminal" to="." method="_update_repo"] -[connection signal="pressed" from="Button" to="." method="redraw_all_cards"] diff --git a/scenes/cardgame.gd b/scenes/cards.gd similarity index 100% rename from scenes/cardgame.gd rename to scenes/cards.gd diff --git a/scenes/cards.tscn b/scenes/cards.tscn index b471bf5..3959b10 100644 --- a/scenes/cards.tscn +++ b/scenes/cards.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/big.tres" type="DynamicFont" id=2] -[ext_resource path="res://scenes/cardgame.gd" type="Script" id=3] +[ext_resource path="res://scenes/cards.gd" type="Script" id=3] [node name="Cards" type="Control"] anchor_right = 1.0 @@ -14,6 +14,7 @@ __meta__ = { } [node name="Button" type="Button" parent="."] +visible = false anchor_left = 1.0 anchor_right = 1.0 margin_left = -172.0 diff --git a/scenes/file_browser.tscn b/scenes/file_browser.tscn index 302ac7a..2c0c196 100644 --- a/scenes/file_browser.tscn +++ b/scenes/file_browser.tscn @@ -89,6 +89,7 @@ __meta__ = { visible = false anchor_right = 1.0 anchor_bottom = 1.0 +wrap_enabled = true __meta__ = { "_edit_use_anchors_": false } diff --git a/scenes/file_browser_item.tscn b/scenes/file_browser_item.tscn index 5991c1e..bd6f09d 100644 --- a/scenes/file_browser_item.tscn +++ b/scenes/file_browser_item.tscn @@ -1,15 +1,15 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://scenes/file_browser_item.gd" type="Script" id=1] [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=2] - +[ext_resource path="res://nodes/document.svg" type="Texture" id=3] [node name="Control" type="Control"] -anchor_right = 0.052 -anchor_bottom = 0.093 -margin_right = 100.16 -margin_bottom = -0.439995 -rect_min_size = Vector2( 150, 100 ) +anchor_right = 0.104 +anchor_bottom = 0.126 +margin_right = 0.319992 +margin_bottom = -0.0800018 +rect_min_size = Vector2( 175, 150 ) script = ExtResource( 1 ) __meta__ = { "_edit_use_anchors_": false @@ -25,29 +25,41 @@ __meta__ = { [node name="Control" type="Control" parent="VBoxContainer"] margin_right = 200.0 -margin_bottom = 71.0 +margin_bottom = 94.0 mouse_filter = 2 size_flags_vertical = 3 [node name="ColorRect" type="ColorRect" parent="VBoxContainer/Control"] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -25.0 -margin_top = -25.0 -margin_right = 25.0 -margin_bottom = 25.0 +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 mouse_filter = 2 color = Color( 0.203922, 0.721569, 0.501961, 1 ) __meta__ = { "_edit_use_anchors_": false } +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 8.0 +margin_top = 8.0 +margin_right = -8.0 +margin_bottom = -8.0 +texture = ExtResource( 3 ) +expand = true +stretch_mode = 6 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Label" type="Label" parent="VBoxContainer"] -margin_top = 75.0 +margin_top = 98.0 margin_right = 200.0 -margin_bottom = 100.0 +margin_bottom = 150.0 +size_flags_vertical = 7 +size_flags_stretch_ratio = 0.55 custom_fonts/font = ExtResource( 2 ) text = "filename" align = 1 +autowrap = true diff --git a/scenes/node.tscn b/scenes/node.tscn index d2eba9f..0942fcc 100644 --- a/scenes/node.tscn +++ b/scenes/node.tscn @@ -91,7 +91,7 @@ anchor_bottom = 0.0 margin_left = -23.0 margin_top = 31.0 margin_right = 574.0 -margin_bottom = 188.0 +margin_bottom = 231.0 mouse_filter = 1 mode = 1 [connection signal="mouse_entered" from="Rect" to="." method="_on_hover"] diff --git a/scenes/repository.gd b/scenes/repository.gd index dba0c71..ab8b6c6 100644 --- a/scenes/repository.gd +++ b/scenes/repository.gd @@ -326,5 +326,7 @@ func close_all_file_browsers(): for o in objects.values(): if o.type == "commit": + o.file_browser.close() o.file_browser.visible = false + diff --git a/scenes/text_editor.tscn b/scenes/text_editor.tscn index d94a5b4..f134f1d 100644 --- a/scenes/text_editor.tscn +++ b/scenes/text_editor.tscn @@ -3,13 +3,13 @@ [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=1] [ext_resource path="res://scenes/text_editor.gd" type="Script" id=2] - [node name="TextEditor" type="TextEdit"] anchor_right = 1.0 anchor_bottom = 1.0 custom_colors/background_color = Color( 0, 0, 0, 1 ) text = "Text here" syntax_highlighting = true +wrap_enabled = true script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false