Path: blob/master/editor/project_manager/quick_settings_dialog.h
9896 views
/**************************************************************************/1/* quick_settings_dialog.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "scene/gui/dialogs.h"3334class Button;35class Label;36class MarginContainer;37class OptionButton;38class PanelContainer;39class VBoxContainer;4041class QuickSettingsDialog : public AcceptDialog {42GDCLASS(QuickSettingsDialog, AcceptDialog);4344#ifndef ANDROID_ENABLED45Vector<String> editor_languages;46#endif47Vector<String> editor_themes;48Vector<String> editor_scales;49Vector<String> editor_network_modes;50Vector<String> editor_check_for_updates;51Vector<String> editor_directory_naming_conventions;5253void _fetch_setting_values();54void _update_current_values();5556PanelContainer *settings_list_panel = nullptr;57VBoxContainer *settings_list = nullptr;5859void _add_setting_control(const String &p_text, Control *p_control);6061#ifndef ANDROID_ENABLED62// The language selection dropdown doesn't work on Android (as the setting isn't saved), see GH-60353.63// Also, the dropdown it spawns is very tall and can't be scrolled without a hardware mouse.64OptionButton *language_option_button = nullptr;65#endif66OptionButton *theme_option_button = nullptr;67OptionButton *scale_option_button = nullptr;68OptionButton *network_mode_option_button = nullptr;69OptionButton *check_for_update_button = nullptr;70OptionButton *directory_naming_convention_button = nullptr;7172Label *custom_theme_label = nullptr;7374#ifndef ANDROID_ENABLED75void _language_selected(int p_id);76#endif77void _theme_selected(int p_id);78void _scale_selected(int p_id);79void _network_mode_selected(int p_id);80void _check_for_update_selected(int p_id);81void _directory_naming_convention_selected(int p_id);82void _set_setting_value(const String &p_setting, const Variant &p_value, bool p_restart_required = false);8384Label *restart_required_label = nullptr;85Button *restart_required_button = nullptr;8687void _request_restart();8889protected:90void _notification(int p_what);91static void _bind_methods();9293public:94void update_size_limits(const Size2 &p_max_popup_size);9596QuickSettingsDialog();97};9899100