Disable file explorer popups for commits

Our beta testers seemed to be confused by this and recommended removing
it.
This commit is contained in:
blinry 2020-10-30 19:41:15 +01:00
parent af78043251
commit 53f60247f3
3 changed files with 3 additions and 35 deletions

View file

@ -6,13 +6,11 @@ var type setget type_set
var repository: Control
onready var content_label = $Content/ContentLabel
onready var file_browser = $OnTop/FileBrowser
var children = {} setget children_set
var id_always_visible = false
var held = false
var hovered = false
var start_pos = null
var arrow = preload("res://scenes/arrow.tscn")
@ -67,9 +65,6 @@ func content_set(new_content):
func type_set(new_type):
type = new_type
if type == "commit" and file_browser:
file_browser.commit = self
file_browser.title = "Commit " + id
if type != "ref":
$ID.text = $ID.text.substr(0,8)
z_index = -1
@ -113,8 +108,7 @@ func children_set(new_children):
func _on_hover():
hovered = true
if not id_always_visible and type != "head":
if not file_browser.visible:
content_label.visible = true
content_label.visible = true
#$ID.visible = true
func _on_unhover():
@ -126,7 +120,6 @@ func _on_unhover():
func _input(event):
if hovered:
if event.is_action_pressed("click") and type != "head":
start_pos = get_viewport().get_mouse_position()
held = true
elif event.is_action_pressed("right_click"):
var input = get_tree().get_current_scene().find_node("Input")
@ -134,13 +127,3 @@ func _input(event):
input.caret_position = input.text.length()
if event.is_action_released("click"):
held = false
if type == "commit":
if start_pos:
var dist = get_viewport().get_mouse_position() - start_pos
if dist.length() < 3:
var state = file_browser.visible
repository.close_all_file_browsers()
file_browser.visible = not state
content_label.visible = state
start_pos = null

View file

@ -1,9 +1,8 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://fonts/default.tres" type="DynamicFont" id=1]
[ext_resource path="res://scenes/node.gd" type="Script" id=2]
[ext_resource path="res://nodes/blob.svg" type="Texture" id=3]
[ext_resource path="res://scenes/file_browser.tscn" type="PackedScene" id=4]
[ext_resource path="res://nodes/pop.wav" type="AudioStream" id=5]
[ext_resource path="res://scenes/drop_area.tscn" type="PackedScene" id=6]
@ -81,20 +80,6 @@ custom_colors/font_color = Color( 1, 1, 1, 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="OnTop" type="Node2D" parent="."]
z_index = 2
[node name="FileBrowser" parent="OnTop" instance=ExtResource( 4 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -23.0
margin_top = 31.0
margin_right = 574.0
margin_bottom = 231.0
mouse_filter = 1
mode = 1
[connection signal="mouse_entered" from="Rect" to="." method="_on_hover"]
[connection signal="mouse_exited" from="Rect" to="." method="_on_unhover"]
[connection signal="mouse_entered" from="Area2D" to="." method="_on_hover"]