Popups are now windows also (broken!)
This commit is contained in:
@@ -41,14 +41,14 @@ void EditorNetworkProfiler::_bind_methods() {
|
||||
void EditorNetworkProfiler::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
activate->set_icon(get_icon("Play", "EditorIcons"));
|
||||
clear_button->set_icon(get_icon("Clear", "EditorIcons"));
|
||||
incoming_bandwidth_text->set_right_icon(get_icon("ArrowDown", "EditorIcons"));
|
||||
outgoing_bandwidth_text->set_right_icon(get_icon("ArrowUp", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
clear_button->set_icon(get_theme_icon("Clear", "EditorIcons"));
|
||||
incoming_bandwidth_text->set_right_icon(get_theme_icon("ArrowDown", "EditorIcons"));
|
||||
outgoing_bandwidth_text->set_right_icon(get_theme_icon("ArrowUp", "EditorIcons"));
|
||||
|
||||
// This needs to be done here to set the faded color when the profiler is first opened
|
||||
incoming_bandwidth_text->add_color_override("font_color_uneditable", get_color("font_color", "Editor") * Color(1, 1, 1, 0.5));
|
||||
outgoing_bandwidth_text->add_color_override("font_color_uneditable", get_color("font_color", "Editor") * Color(1, 1, 1, 0.5));
|
||||
incoming_bandwidth_text->add_theme_color_override("font_color_uneditable", get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.5));
|
||||
outgoing_bandwidth_text->add_theme_color_override("font_color_uneditable", get_theme_color("font_color", "Editor") * Color(1, 1, 1, 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ void EditorNetworkProfiler::_update_frame() {
|
||||
void EditorNetworkProfiler::_activate_pressed() {
|
||||
|
||||
if (activate->is_pressed()) {
|
||||
activate->set_icon(get_icon("Stop", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon("Stop", "EditorIcons"));
|
||||
activate->set_text(TTR("Stop"));
|
||||
} else {
|
||||
activate->set_icon(get_icon("Play", "EditorIcons"));
|
||||
activate->set_icon(get_theme_icon("Play", "EditorIcons"));
|
||||
activate->set_text(TTR("Start"));
|
||||
}
|
||||
emit_signal("enable_profiling", activate->is_pressed());
|
||||
@@ -118,12 +118,12 @@ void EditorNetworkProfiler::set_bandwidth(int p_incoming, int p_outgoing) {
|
||||
outgoing_bandwidth_text->set_text(vformat(TTR("%s/s"), String::humanize_size(p_outgoing)));
|
||||
|
||||
// Make labels more prominent when the bandwidth is greater than 0 to attract user attention
|
||||
incoming_bandwidth_text->add_color_override(
|
||||
incoming_bandwidth_text->add_theme_color_override(
|
||||
"font_color_uneditable",
|
||||
get_color("font_color", "Editor") * Color(1, 1, 1, p_incoming > 0 ? 1 : 0.5));
|
||||
outgoing_bandwidth_text->add_color_override(
|
||||
get_theme_color("font_color", "Editor") * Color(1, 1, 1, p_incoming > 0 ? 1 : 0.5));
|
||||
outgoing_bandwidth_text->add_theme_color_override(
|
||||
"font_color_uneditable",
|
||||
get_color("font_color", "Editor") * Color(1, 1, 1, p_outgoing > 0 ? 1 : 0.5));
|
||||
get_theme_color("font_color", "Editor") * Color(1, 1, 1, p_outgoing > 0 ? 1 : 0.5));
|
||||
}
|
||||
|
||||
bool EditorNetworkProfiler::is_profiling() {
|
||||
@@ -133,7 +133,7 @@ bool EditorNetworkProfiler::is_profiling() {
|
||||
EditorNetworkProfiler::EditorNetworkProfiler() {
|
||||
|
||||
HBoxContainer *hb = memnew(HBoxContainer);
|
||||
hb->add_constant_override("separation", 8 * EDSCALE);
|
||||
hb->add_theme_constant_override("separation", 8 * EDSCALE);
|
||||
add_child(hb);
|
||||
|
||||
activate = memnew(Button);
|
||||
|
||||
Reference in New Issue
Block a user