Use LW_NAME in TreeSearch where appropriate
This commit is contained in:
parent
a31b8b7520
commit
acb2bcc901
|
@ -49,7 +49,7 @@ void TreeSearchPanel::_initialize_controls() {
|
||||||
|
|
||||||
line_edit_search->set_placeholder(TTR("Search tree"));
|
line_edit_search->set_placeholder(TTR("Search tree"));
|
||||||
|
|
||||||
close_button->set_theme_type_variation("FlatButton");
|
close_button->set_theme_type_variation(LW_NAME(FlatButton));
|
||||||
|
|
||||||
// positioning and sizing
|
// positioning and sizing
|
||||||
set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_WIDE);
|
set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_WIDE);
|
||||||
|
@ -222,11 +222,11 @@ void TreeSearch::_draw_highlight_item(TreeItem *p_tree_item, Rect2 p_rect, Calla
|
||||||
Vector2 substring_before_size = font->get_string_size(substring_before, HORIZONTAL_ALIGNMENT_LEFT, -1.f, font_size);
|
Vector2 substring_before_size = font->get_string_size(substring_before, HORIZONTAL_ALIGNMENT_LEFT, -1.f, font_size);
|
||||||
|
|
||||||
// stylebox
|
// stylebox
|
||||||
Ref<StyleBox> stylebox = p_tree_item->get_tree()->get_theme_stylebox("Focus");
|
Ref<StyleBox> stylebox = p_tree_item->get_tree()->get_theme_stylebox(LW_NAME(Focus));
|
||||||
ERR_FAIL_NULL(stylebox);
|
ERR_FAIL_NULL(stylebox);
|
||||||
|
|
||||||
// extract separation
|
// extract separation
|
||||||
float h_sep = p_tree_item->get_tree()->get_theme_constant("h_separation");
|
float h_sep = p_tree_item->get_tree()->get_theme_constant(LW_NAME(h_separation));
|
||||||
|
|
||||||
// compose draw rect
|
// compose draw rect
|
||||||
const Vector2 PADDING = Vector2(4., 2.);
|
const Vector2 PADDING = Vector2(4., 2.);
|
||||||
|
@ -247,9 +247,9 @@ void TreeSearch::_draw_highlight_item(TreeItem *p_tree_item, Rect2 p_rect, Calla
|
||||||
// second part: draw number
|
// second part: draw number
|
||||||
int num_mat = number_matches.has(p_tree_item) ? number_matches.get(p_tree_item) : 0;
|
int num_mat = number_matches.has(p_tree_item) ? number_matches.get(p_tree_item) : 0;
|
||||||
if (num_mat > 0) {
|
if (num_mat > 0) {
|
||||||
float h_sep = p_tree_item->get_tree()->get_theme_constant("h_separation");
|
float h_sep = p_tree_item->get_tree()->get_theme_constant(LW_NAME(h_separation));
|
||||||
Ref<Font> font = tree_reference->get_theme_font("font");
|
Ref<Font> font = tree_reference->get_theme_font(LW_NAME(font));
|
||||||
float font_size = tree_reference->get_theme_font_size("font") * 0.75;
|
float font_size = tree_reference->get_theme_font_size(LW_NAME(font)) * 0.75;
|
||||||
|
|
||||||
String num_string = String::num_int64(num_mat);
|
String num_string = String::num_int64(num_mat);
|
||||||
Vector2 string_size = font->get_string_size(num_string, HORIZONTAL_ALIGNMENT_CENTER, -1, font_size);
|
Vector2 string_size = font->get_string_size(num_string, HORIZONTAL_ALIGNMENT_CENTER, -1, font_size);
|
||||||
|
|
|
@ -67,6 +67,8 @@ LimboStringNames::LimboStringNames() {
|
||||||
exited = SN("exited");
|
exited = SN("exited");
|
||||||
favorite_tasks_changed = SN("favorite_tasks_changed");
|
favorite_tasks_changed = SN("favorite_tasks_changed");
|
||||||
Favorites = SN("Favorites");
|
Favorites = SN("Favorites");
|
||||||
|
FlatButton = SN("FlatButton");
|
||||||
|
Focus = SN("Focus");
|
||||||
focus_exited = SN("focus_exited");
|
focus_exited = SN("focus_exited");
|
||||||
font = SN("font");
|
font = SN("font");
|
||||||
font_color = SN("font_color");
|
font_color = SN("font_color");
|
||||||
|
@ -78,6 +80,7 @@ LimboStringNames::LimboStringNames() {
|
||||||
GuiTreeArrowRight = SN("GuiTreeArrowRight");
|
GuiTreeArrowRight = SN("GuiTreeArrowRight");
|
||||||
HeaderSmall = SN("HeaderSmall");
|
HeaderSmall = SN("HeaderSmall");
|
||||||
Help = SN("Help");
|
Help = SN("Help");
|
||||||
|
h_separation = SN("h_separation");
|
||||||
icon_max_width = SN("icon_max_width");
|
icon_max_width = SN("icon_max_width");
|
||||||
class_icon_size = SN("class_icon_size");
|
class_icon_size = SN("class_icon_size");
|
||||||
id_pressed = SN("id_pressed");
|
id_pressed = SN("id_pressed");
|
||||||
|
|
|
@ -83,6 +83,8 @@ public:
|
||||||
StringName exited;
|
StringName exited;
|
||||||
StringName favorite_tasks_changed;
|
StringName favorite_tasks_changed;
|
||||||
StringName Favorites;
|
StringName Favorites;
|
||||||
|
StringName FlatButton;
|
||||||
|
StringName Focus;
|
||||||
StringName focus_exited;
|
StringName focus_exited;
|
||||||
StringName font_color;
|
StringName font_color;
|
||||||
StringName font_size;
|
StringName font_size;
|
||||||
|
@ -94,6 +96,7 @@ public:
|
||||||
StringName GuiTreeArrowRight;
|
StringName GuiTreeArrowRight;
|
||||||
StringName HeaderSmall;
|
StringName HeaderSmall;
|
||||||
StringName Help;
|
StringName Help;
|
||||||
|
StringName h_separation;
|
||||||
StringName icon_max_width;
|
StringName icon_max_width;
|
||||||
StringName class_icon_size;
|
StringName class_icon_size;
|
||||||
StringName id_pressed;
|
StringName id_pressed;
|
||||||
|
|
Loading…
Reference in New Issue