Improve fonts and colors

This commit is contained in:
Sebastian Morr 2020-09-05 10:47:38 +02:00
parent 02a0428d1c
commit 5a291685fa
5 changed files with 41 additions and 25 deletions

7
fonts/big.tres Normal file
View file

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/iosevka-regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 40
font_data = ExtResource( 1 )

View file

@ -32,6 +32,8 @@ margin_top = 484.0
margin_right = 1907.0
margin_bottom = 1068.0
custom_fonts/font = ExtResource( 5 )
custom_colors/background_color = Color( 0, 0, 0, 1 )
syntax_highlighting = true
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://repository.gd" type="Script" id=1]
[ext_resource path="res://fonts/default.tres" type="DynamicFont" id=2]
[ext_resource path="res://fonts/big.tres" type="DynamicFont" id=3]
[node name="Repository" type="Container"]
anchor_right = 1.0
@ -17,6 +18,7 @@ __meta__ = {
}
[node name="Index" type="Label" parent="."]
visible = false
margin_left = 32.0
margin_top = 80.0
margin_right = 375.079
@ -29,6 +31,7 @@ __meta__ = {
}
[node name="IndexLabel" type="Label" parent="."]
visible = false
margin_left = 21.0
margin_top = 65.0
margin_right = 377.0
@ -52,6 +55,6 @@ __meta__ = {
[node name="Label" type="Label" parent="."]
margin_left = 20.0
margin_top = 20.0
custom_fonts/font = ExtResource( 2 )
custom_fonts/font = ExtResource( 3 )
text = "Repo name"
[connection signal="pressed" from="Button" to="." method="update_everything"]

View file

@ -11,22 +11,22 @@ onready var output = $Control/Output
func _input(event):
if history.size() > 0:
if event.is_action_pressed("ui_up"):
history_position -= 1
history_position %= history.size()
input.text = history[history_position]
input.caret_position = input.text.length()
if history_position > 0:
history_position -= 1
input.text = history[history_position]
input.caret_position = input.text.length()
# This prevents the Input taking the arrow as a "skip to beginning" command.
get_tree().set_input_as_handled()
if event.is_action_pressed("ui_down"):
history_position += 1
history_position %= history.size()
input.text = history[history_position]
input.caret_position = input.text.length()
if history_position < history.size()-1:
history_position += 1
input.text = history[history_position]
input.caret_position = input.text.length()
get_tree().set_input_as_handled()
func send_command(command):
history.push_back(command)
history_position += 1
history_position = history.size()
thread = Thread.new()
thread.start(self, "run_command_in_a_thread", command)
@ -36,5 +36,5 @@ func run_command_in_a_thread(command):
input.text = ""
output.text = output.text + "$ " + command + "\n" + o
output.scroll_vertical = 999999
#output.scroll_vertical = 999999
$"../Repositories/ActiveRepository".update_everything() # FIXME

View file

@ -4,10 +4,18 @@
[ext_resource path="res://terminal.gd" type="Script" id=2]
[ext_resource path="res://command_button.tscn" type="PackedScene" id=4]
[sub_resource type="StyleBoxFlat" id=1]
[sub_resource type="StyleBoxFlat" id=2]
content_margin_left = 10.0
content_margin_right = 10.0
content_margin_top = 10.0
content_margin_bottom = 10.0
bg_color = Color( 0, 0, 0, 1 )
[sub_resource type="StyleBoxFlat" id=2]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 10.0
content_margin_right = 10.0
content_margin_top = 10.0
content_margin_bottom = 5.0
bg_color = Color( 0, 0, 0, 1 )
[node name="Terminal" type="Container"]
@ -26,17 +34,13 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Output" type="TextEdit" parent="Control"]
[node name="Output" type="RichTextLabel" parent="Control"]
margin_right = 1920.0
margin_bottom = 1054.0
focus_mode = 0
margin_bottom = 1039.0
size_flags_vertical = 3
custom_styles/read_only = SubResource( 1 )
custom_fonts/font = ExtResource( 1 )
readonly = true
__meta__ = {
"_edit_use_anchors_": false
}
custom_styles/normal = SubResource( 2 )
custom_fonts/normal_font = ExtResource( 1 )
scroll_following = true
[node name="Button" parent="Control" instance=ExtResource( 4 )]
visible = false
@ -62,10 +66,10 @@ text = "git checkout HEAD^"
align = 0
[node name="Input" type="LineEdit" parent="Control"]
margin_top = 1054.0
margin_top = 1039.0
margin_right = 1920.0
margin_bottom = 1080.0
custom_styles/normal = SubResource( 2 )
custom_styles/normal = SubResource( 1 )
custom_fonts/font = ExtResource( 1 )
caret_blink = true
__meta__ = {