From e298f931a614af94335069dc97878c09a986a478 Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Sun, 3 Sep 2017 01:49:31 -0500 Subject: Fixed some metrics (some issues caused by the new Noto Sans font). plus other minor fixes --- editor/editor_fonts.cpp | 13 ++++++++----- editor/editor_themes.cpp | 4 ++-- editor/filesystem_dock.cpp | 2 +- scene/gui/line_edit.cpp | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 22a9c84d21..3ab3f05906 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -72,11 +72,14 @@ static Ref make_font(int p_height, int p_ascent, int p_valign, int p m_name->add_fallback(FontJapanese); \ m_name->add_fallback(FontFallback); -#define MAKE_DEFAULT_FONT(m_name, m_size) \ - Ref m_name; \ - m_name.instance(); \ - m_name->set_size(m_size); \ - m_name->set_font_data(DefaultFont); \ +// the custom spacings might only work with Noto Sans +#define MAKE_DEFAULT_FONT(m_name, m_size) \ + Ref m_name; \ + m_name.instance(); \ + m_name->set_size(m_size); \ + m_name->set_font_data(DefaultFont); \ + m_name->set_spacing(DynamicFont::SPACING_TOP, -1); \ + m_name->set_spacing(DynamicFont::SPACING_BOTTOM, -1); \ MAKE_FALLBACKS(m_name); void editor_register_fonts(Ref p_theme) { diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 8943d5f0dc..968ad50a73 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -333,10 +333,10 @@ Ref create_editor_theme(const Ref p_theme) { theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border); // Content of each tab - Ref style_content_panel = make_flat_stylebox(base_color, 4, 5, 4, 4); + Ref style_content_panel = make_flat_stylebox(base_color, 4, 4, 4, 4); style_content_panel->set_border_color_all(base_color); style_content_panel->set_border_width_all(border_width); - Ref style_content_panel_vp = make_flat_stylebox(base_color, border_width, 5, border_width, border_width); + Ref style_content_panel_vp = make_flat_stylebox(base_color, border_width, 4, border_width, border_width); style_content_panel_vp->set_border_color_all(base_color); style_content_panel_vp->set_border_width_all(border_width); theme->set_stylebox("panel", "TabContainer", style_content_panel); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 04036f410a..a66d1724a1 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1839,7 +1839,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { path = "res://"; - add_constant_override("separation", 3); + add_constant_override("separation", 4); } FileSystemDock::~FileSystemDock() { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 66b4e6cec1..6a5f56c78c 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -631,7 +631,7 @@ void LineEdit::_notification(int p_what) { if (has_icon("right_icon")) { Ref r_icon = Control::get_icon("right_icon"); ofs_max -= r_icon->get_width(); - r_icon->draw(ci, Point2(width - r_icon->get_width() - x_ofs, y_ofs), Color(1, 1, 1, disabled_alpha * .9)); + r_icon->draw(ci, Point2(width - r_icon->get_width() - x_ofs, height / 2 - r_icon->get_height() / 2), Color(1, 1, 1, disabled_alpha * .9)); } int caret_height = font->get_height() > y_area ? y_area : font->get_height(); -- cgit v1.2.3