feat(display): enable borderless fullscreen by default, F11/Alt+Enter toggle, and menu button
checkpoint / checkpoint (push) Failing after 6m3s
checkpoint / checkpoint (push) Failing after 6m3s
This commit is contained in:
@@ -67,6 +67,17 @@ static func _build_label() -> String:
|
||||
return "dev"
|
||||
|
||||
|
||||
static func _update_fs_button(btn: Button) -> void:
|
||||
if DisplayServer.get_name() == "headless":
|
||||
btn.text = "⛶ Fullscreen (F11)"
|
||||
return
|
||||
var m := DisplayServer.window_get_mode()
|
||||
if m == DisplayServer.WINDOW_MODE_FULLSCREEN or m == DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
|
||||
btn.text = "🗗 Windowed (F11)"
|
||||
else:
|
||||
btn.text = "⛶ Fullscreen (F11)"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var v := Label.new()
|
||||
v.text = "build %s" % _build_label()
|
||||
@@ -87,6 +98,20 @@ func _ready() -> void:
|
||||
v.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(v)
|
||||
|
||||
var fs_btn := Button.new()
|
||||
fs_btn.set_anchors_preset(Control.PRESET_TOP_RIGHT)
|
||||
fs_btn.offset_left = -160
|
||||
fs_btn.offset_top = 10
|
||||
fs_btn.offset_right = -10
|
||||
fs_btn.offset_bottom = 38
|
||||
fs_btn.add_theme_font_size_override("font_size", 12)
|
||||
_update_fs_button(fs_btn)
|
||||
fs_btn.pressed.connect(func():
|
||||
Session.toggle_fullscreen()
|
||||
_update_fs_button(fs_btn)
|
||||
)
|
||||
add_child(fs_btn)
|
||||
|
||||
# Cache node references.
|
||||
_auth_buttons_row = $CenterContainer/VBoxContainer/AuthButtonsRow
|
||||
_login_button = $CenterContainer/VBoxContainer/AuthButtonsRow/LoginButton
|
||||
|
||||
Reference in New Issue
Block a user