summaryrefslogtreecommitdiff
path: root/tools/editor/project_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/project_manager.cpp')
-rw-r--r--tools/editor/project_manager.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index dc1d6ec0f9..1c99982155 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -142,6 +142,7 @@ private:
String sp = p.simplify_path();
project_path->set_text(sp);
_path_text_changed(p);
+ get_ok()->call_deferred("grab_focus");
}
void _path_selected(const String& p_path) {
@@ -150,7 +151,7 @@ private:
String sp = p.simplify_path();
project_path->set_text(sp);
_path_text_changed(p);
-
+ get_ok()->call_deferred("grab_focus");
}
void _browse_path() {
@@ -506,7 +507,7 @@ void ProjectManager::_panel_draw(Node *p_hb) {
hb->draw_line(Point2(0,hb->get_size().y+1),Point2(hb->get_size().x-10,hb->get_size().y+1),get_color("guide_color","Tree"));
if (selected_list.has(hb->get_meta("name"))) {
- hb->draw_style_box(get_stylebox("selected","Tree"),Rect2(Point2(),hb->get_size()-Size2(10,0)));
+ hb->draw_style_box( gui_base->get_stylebox("selected","Tree"),Rect2(Point2(),hb->get_size()-Size2(10,0)));
}
}
@@ -753,7 +754,7 @@ void ProjectManager::_load_recent_projects() {
List<PropertyInfo> properties;
EditorSettings::get_singleton()->get_property_list(&properties);
- Color font_color = get_color("font_color","Tree");
+ Color font_color = gui_base->get_color("font_color","Tree");
List<ProjectItem> projects;
List<ProjectItem> favorite_projects;
@@ -864,6 +865,7 @@ void ProjectManager::_load_recent_projects() {
hb->set_meta("favorite",is_favorite);
hb->connect("draw",this,"_panel_draw",varray(hb));
hb->connect("input_event",this,"_panel_input",varray(hb));
+ hb->add_constant_override("separation",10*EDSCALE);
VBoxContainer *favorite_box = memnew( VBoxContainer );
TextureButton *favorite = memnew( TextureButton );
@@ -885,7 +887,7 @@ void ProjectManager::_load_recent_projects() {
ec->set_custom_minimum_size(Size2(0,1));
vb->add_child(ec);
Label *title = memnew( Label(project_name) );
- title->add_font_override("font",get_font("large","Fonts"));
+ title->add_font_override("font", gui_base->get_font("large","Fonts"));
title->add_color_override("font_color",font_color);
vb->add_child(title);
Label *fpath = memnew( Label(path) );
@@ -1185,25 +1187,27 @@ ProjectManager::ProjectManager() {
{
int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode");
if (dpi_mode==0) {
- editor_set_hidpi( OS::get_singleton()->get_screen_dpi(0) > 150 );
+ editor_set_scale( OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x>2000 ? 2.0 : 1.0 );
+ } else if (dpi_mode==1) {
+ editor_set_scale(0.75);
} else if (dpi_mode==2) {
- editor_set_hidpi(true);
- } else {
- editor_set_hidpi(false);
+ editor_set_scale(1.0);
+ } else if (dpi_mode==3) {
+ editor_set_scale(1.5);
+ } else if (dpi_mode==4) {
+ editor_set_scale(2.0);
}
}
FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"));
set_area_as_parent_rect();
+ set_theme(create_editor_theme());
gui_base = memnew( Control );
add_child(gui_base);
gui_base->set_area_as_parent_rect();
-
- set_theme(create_default_theme());
- Ref<Theme> theme = create_editor_theme();
- gui_base->set_theme(theme);
+ gui_base->set_theme(create_custom_theme());
Panel *panel = memnew( Panel );
gui_base->add_child(panel);
@@ -1226,7 +1230,7 @@ ProjectManager::ProjectManager() {
CenterContainer *ccl = memnew( CenterContainer );
Label *l = memnew( Label );
l->set_text(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager"));
- l->add_font_override("font",get_font("doc","EditorFonts"));
+ l->add_font_override("font", gui_base->get_font("doc","EditorFonts"));
ccl->add_child(l);
top_hb->add_child(ccl);
top_hb->add_spacer();
@@ -1262,7 +1266,7 @@ ProjectManager::ProjectManager() {
search_tree_vb->add_child(search_box);
PanelContainer *pc = memnew( PanelContainer);
- pc->add_style_override("panel",get_stylebox("bg","Tree"));
+ pc->add_style_override("panel", gui_base->get_stylebox("bg","Tree"));
search_tree_vb->add_child(pc);
pc->set_v_size_flags(SIZE_EXPAND_FILL);