Redesign exam and CCS experiences
This commit is contained in:
@@ -21,6 +21,7 @@ var reset_view: VBoxContainer
|
||||
var steam_view: VBoxContainer
|
||||
var login_input: LineEdit
|
||||
var password_input: LineEdit
|
||||
var password_reveal_button: Button
|
||||
var registration_username_input: LineEdit
|
||||
var registration_email_input: LineEdit
|
||||
var registration_password_input: LineEdit
|
||||
@@ -335,20 +336,32 @@ func _add_show_password(parent: VBoxContainer, targets: Array) -> void:
|
||||
|
||||
func _add_password_reveal(input: LineEdit) -> void:
|
||||
var reveal := Button.new()
|
||||
reveal.text = "\u25c9"
|
||||
password_reveal_button = reveal
|
||||
reveal.text = ""
|
||||
reveal.tooltip_text = "Show password"
|
||||
reveal.flat = true
|
||||
reveal.focus_mode = Control.FOCUS_NONE
|
||||
reveal.custom_minimum_size = Vector2(52, 52)
|
||||
reveal.set_anchors_preset(Control.PRESET_CENTER_RIGHT)
|
||||
reveal.position = Vector2(-60, -26)
|
||||
_refresh_password_reveal(input, reveal)
|
||||
reveal.pressed.connect(func():
|
||||
input.secret = not input.secret
|
||||
reveal.tooltip_text = "Show password" if input.secret else "Hide password"
|
||||
_refresh_password_reveal(input, reveal)
|
||||
)
|
||||
input.add_child(reveal)
|
||||
|
||||
|
||||
func _refresh_password_reveal(input: LineEdit, reveal: Button) -> void:
|
||||
reveal.icon = preload("res://assets/icons/lucide/eye.svg") if input.secret else preload("res://assets/icons/lucide/eye-off.svg")
|
||||
reveal.expand_icon = false
|
||||
reveal.add_theme_constant_override("icon_max_width", 24)
|
||||
var icon_color := Brand.muted_color(UIThemeService.is_dark_mode())
|
||||
for color_name in ["icon_normal_color", "icon_hover_color", "icon_pressed_color", "icon_focus_color"]:
|
||||
reveal.add_theme_color_override(color_name, icon_color)
|
||||
|
||||
|
||||
func _add_primary_button(parent: VBoxContainer, text_value: String, callback: Callable) -> Button:
|
||||
var button := Button.new()
|
||||
button.text = text_value
|
||||
@@ -442,7 +455,7 @@ func _apply_theme() -> void:
|
||||
background.color = Brand.background_color(dark)
|
||||
background.material = Brand.background_material(dark)
|
||||
auth_panel.add_theme_stylebox_override("panel", Brand.panel_box(dark))
|
||||
theme_button.text = "☀" if dark else "☾"
|
||||
Brand.set_theme_toggle_icon(theme_button, dark)
|
||||
theme_button.tooltip_text = "Use light theme" if dark else "Use dark theme"
|
||||
theme_button.add_theme_font_override("font", Brand.font)
|
||||
for node in find_children("*", "Label", true, false):
|
||||
@@ -475,6 +488,8 @@ func _apply_theme() -> void:
|
||||
theme_button.add_theme_stylebox_override("normal", theme_normal)
|
||||
theme_button.add_theme_stylebox_override("hover", theme_normal)
|
||||
theme_button.add_theme_color_override("font_color", Brand.AMBER)
|
||||
if password_reveal_button != null:
|
||||
_refresh_password_reveal(password_input, password_reveal_button)
|
||||
subheading.add_theme_color_override("font_color", Brand.muted_color(dark))
|
||||
message_label.add_theme_color_override("font_color", Brand.muted_color(dark))
|
||||
if brand_tagline != null:
|
||||
|
||||
Reference in New Issue
Block a user