Skip to content

Commit

Permalink
Merge pull request #8 from fenix-hub/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
fenix-hub authored Aug 2, 2021
2 parents 9455121 + a14f275 commit 6e55c67
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 38 deletions.
17 changes: 9 additions & 8 deletions supabase-ui/basic/button/default/default_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,15 @@ func set_font_size(_size : int) -> void:
func _gui_input(event : InputEvent):
if disabled: return
if event is InputEventMouseButton:
if event.pressed:
pressing = true
_pressed()
emit_signal("pressed")
else:
pressing = false
_released()
emit_signal("released")
if event.get_button_index() == 1:
if event.pressed:
pressing = true
_pressed()
emit_signal("pressed")
else:
pressing = false
_released()
emit_signal("released")

func _pressed() -> void:
$Tween.stop_all()
Expand Down
4 changes: 2 additions & 2 deletions supabase-ui/basic/button/text/TextButton.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ size = 17
font_data = ExtResource( 2 )

[node name="TextButton" type="PanelContainer"]
margin_right = 26.0
margin_bottom = 18.0
margin_right = 101.0
margin_bottom = 31.0
mouse_default_cursor_shape = 2
custom_styles/panel = ExtResource( 3 )
script = ExtResource( 1 )
Expand Down
4 changes: 2 additions & 2 deletions supabase-ui/basic/containers/panel/Panel.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://supabase-ui/basic/containers/panel/panel.gd" type="Script" id=9]
[ext_resource path="res://supabase-ui/basic/containers/panel/panel.gd" type="Script" id=1]

[sub_resource type="StyleBoxFlat" id=1]
resource_local_to_scene = true
Expand All @@ -26,7 +26,7 @@ mouse_filter = 2
size_flags_horizontal = 0
size_flags_vertical = 0
custom_styles/panel = SubResource( 1 )
script = ExtResource( 9 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
5 changes: 3 additions & 2 deletions supabase-ui/basic/containers/panel/_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ func _force_resize() :


func _on_Panel_gui_input(event):
if event.is_pressed():
emit_signal("pressed")
if event is InputEventMouseButton:
if event.get_button_index() == 1 and event.is_pressed():
emit_signal("pressed")
14 changes: 0 additions & 14 deletions supabase-ui/basic/containers/panel/panel.gd
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
extends SPanel


# Declare member variables here. Examples:
# var a = 2
# var b = "text"


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

29 changes: 29 additions & 0 deletions supabase-ui/basic/containers/popup/Popup.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://supabase-ui/basic/containers/popup/popup.gd" type="Script" id=1]

[sub_resource type="StyleBoxFlat" id=1]
resource_local_to_scene = true
content_margin_left = 20.0
content_margin_right = 20.0
content_margin_top = 20.0
content_margin_bottom = 20.0
bg_color = Color( 0.164706, 0.164706, 0.164706, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
corner_detail = 20

[node name="Popup" type="PopupPanel"]
margin_right = 40.0
margin_bottom = 40.0
mouse_filter = 2
size_flags_horizontal = 0
size_flags_vertical = 0
custom_styles/panel = SubResource( 1 )
script = ExtResource( 1 )
28 changes: 28 additions & 0 deletions supabase-ui/basic/containers/popup/_popup.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
tool
class_name SPopup
extends PopupPanel

signal pressed()

const colors : Dictionary = {
"panel" : [Color.white, Color("#2a2a2a")]
}

export (int, "Light Mode", "Dark Mode") var mode : int = 0 setget set_mode

func _ready():
add_to_group("supabase_components")

func set_mode(_mode : int) :
mode = _mode
get("custom_styles/panel").set("bg_color", colors.panel[mode])

func _force_resize() :
hide()
show()


func _on_Panel_gui_input(event):
if event is InputEventMouseButton:
if event.get_button_index() == 1 and event.is_pressed():
emit_signal("pressed")
1 change: 1 addition & 0 deletions supabase-ui/basic/containers/popup/popup.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends SPopup
7 changes: 4 additions & 3 deletions supabase-ui/components/auth/Auth.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ margin_right = 146.0
margin_bottom = 31.0
size_flags_horizontal = 6
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0.121569, 0.121569, 0.121569, 1 )
level = 2
font_size = 25
Expand All @@ -274,7 +275,7 @@ icon_enabled = true
texture = ExtResource( 2 )
expand = null
size = Vector2( 24, 24 )
text = "user+supaadmin@user.mail"
text = ""
placeholder = ""
secret = false
show_name = true
Expand Down Expand Up @@ -343,7 +344,6 @@ custom_styles/normal = SubResource( 10 )
custom_colors/selection_color = Color( 0.145098, 0.376471, 1, 1 )
custom_colors/font_color_selected = Color( 1, 1, 1, 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "user+supaadmin@user.mail"
[node name="Description" type="Label" parent="Container/SignIn/EmailAddress/Container"]
visible = false
Expand All @@ -365,7 +365,6 @@ theme = SubResource( 11 )
custom_styles/panel = SubResource( 12 )
icon_enabled = true
texture = ExtResource( 3 )
text = "usermail"
secret = true
input_name = "Password"
Expand All @@ -378,6 +377,7 @@ margin_bottom = 248.0
margin_right = 131.0
theme = SubResource( 14 )
text = "Remember Me"
pressed = false
[node name="ForgotPassword" parent="Container/SignIn/HBoxContainer" instance=ExtResource( 5 )]
margin_left = 135.0
Expand Down Expand Up @@ -522,6 +522,7 @@ margin_bottom = 264.0
margin_right = 131.0
theme = SubResource( 22 )
text = "Remember Me"
pressed = false
[node name="HSeparator" type="HSeparator" parent="Container/SignUp"]
margin_top = 274.0
Expand Down
7 changes: 4 additions & 3 deletions supabase-ui/components/auth/auth.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ export (int, "Light Mode", "Dark Mode") var mode : int = 0 setget set_mode
var remember_me : bool = false

func _load_boxes():

sign_in_box.show()
sign_up_box.hide()
forgot_password_box.hide()
with_magic_link_box.hide()

func load_user() -> void:
if Engine.editor_hint: return
var file : File = File.new()
var err := file.open_encrypted_with_pass("user://user.data", File.READ, OS.get_unique_id())
if err != OK:
Expand All @@ -47,8 +49,7 @@ func load_user() -> void:
file.close()

func save_user() -> void:
if not remember_me:
return
if not remember_me: return
var file : File = File.new()
var err := file.open_encrypted_with_pass("user://user.data", File.WRITE, OS.get_unique_id())
if err != OK:
Expand All @@ -64,7 +65,7 @@ func save_user() -> void:

func _ready():
add_to_group("supabase_components")
_load_boxes()
_load_boxes()
load_user()
yield(Supabase, "ready")
Supabase.auth.connect("error", self, "_on_auth_error")
Expand Down
14 changes: 12 additions & 2 deletions supabase-ui/data_input/checkbox/checkbox.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var font_size : int = 15 setget set_font_size
var text : String = "" setget set_text
var description : String = "Description" setget set_description
var show_description : bool = false setget set_show_description

var pressed : bool = false setget set_pressed
var pressing : bool = false

var property_list : Array = [
Expand All @@ -42,6 +42,11 @@ var property_list : Array = [
"name": "text",
"type": TYPE_STRING
},
{
"usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
"name": "pressed",
"type": TYPE_BOOL
},
{
"usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
"name": "show_description",
Expand Down Expand Up @@ -77,14 +82,19 @@ func _ready():
_load_defaults()
set_mode(mode)
set_text(text)

set_pressed(pressed)
add_to_group("supabase_components")

func set_text(_text : String) -> void:
text = _text
if has_node("CheckboxContainer/Text"):
get_node("CheckboxContainer/Text").set_text(_text)

func set_pressed(_pressed : bool) -> void:
pressed = _pressed
if has_node("CheckboxContainer/CheckBox"):
get_node("CheckboxContainer/CheckBox").pressed = pressed

func get_text() -> String:
return $CheckboxContainer/Text.get_text()

Expand Down
5 changes: 3 additions & 2 deletions supabase-ui/data_input/input/input.gd
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,6 @@ func clear():


func _on_Text_gui_input(event):
if event.is_pressed():
emit_signal("pressed")
if event is InputEventMouseButton:
if event.get_button_index() == 1 and event.is_pressed():
emit_signal("pressed")

0 comments on commit 6e55c67

Please sign in to comment.