Refactor Font configuration and import UI, and Font resources.
This commit is contained in:
@ -760,11 +760,11 @@ void PopupMenu::_shape_item(int p_item) {
|
||||
} else {
|
||||
items.write[p_item].text_buf->set_direction((TextServer::Direction)items[p_item].text_direction);
|
||||
}
|
||||
items.write[p_item].text_buf->add_string(items.write[p_item].xl_text, font, font_size, items[p_item].opentype_features, !items[p_item].language.is_empty() ? items[p_item].language : TranslationServer::get_singleton()->get_tool_locale());
|
||||
items.write[p_item].text_buf->add_string(items.write[p_item].xl_text, font, font_size, items[p_item].language);
|
||||
|
||||
items.write[p_item].accel_text_buf->clear();
|
||||
items.write[p_item].accel_text_buf->set_direction(is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR);
|
||||
items.write[p_item].accel_text_buf->add_string(_get_accel_text(items.write[p_item]), font, font_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale());
|
||||
items.write[p_item].accel_text_buf->add_string(_get_accel_text(items.write[p_item]), font, font_size);
|
||||
items.write[p_item].dirty = false;
|
||||
}
|
||||
}
|
||||
@ -1067,29 +1067,6 @@ void PopupMenu::set_item_text_direction(int p_item, Control::TextDirection p_tex
|
||||
}
|
||||
}
|
||||
|
||||
void PopupMenu::clear_item_opentype_features(int p_item) {
|
||||
if (p_item < 0) {
|
||||
p_item += get_item_count();
|
||||
}
|
||||
ERR_FAIL_INDEX(p_item, items.size());
|
||||
items.write[p_item].opentype_features.clear();
|
||||
items.write[p_item].dirty = true;
|
||||
control->update();
|
||||
}
|
||||
|
||||
void PopupMenu::set_item_opentype_feature(int p_item, const String &p_name, int p_value) {
|
||||
if (p_item < 0) {
|
||||
p_item += get_item_count();
|
||||
}
|
||||
ERR_FAIL_INDEX(p_item, items.size());
|
||||
int32_t tag = TS->name_to_tag(p_name);
|
||||
if (!items[p_item].opentype_features.has(tag) || (int)items[p_item].opentype_features[tag] != p_value) {
|
||||
items.write[p_item].opentype_features[tag] = p_value;
|
||||
items.write[p_item].dirty = true;
|
||||
control->update();
|
||||
}
|
||||
}
|
||||
|
||||
void PopupMenu::set_item_language(int p_item, const String &p_language) {
|
||||
if (p_item < 0) {
|
||||
p_item += get_item_count();
|
||||
@ -1195,15 +1172,6 @@ Control::TextDirection PopupMenu::get_item_text_direction(int p_item) const {
|
||||
return items[p_item].text_direction;
|
||||
}
|
||||
|
||||
int PopupMenu::get_item_opentype_feature(int p_item, const String &p_name) const {
|
||||
ERR_FAIL_INDEX_V(p_item, items.size(), -1);
|
||||
int32_t tag = TS->name_to_tag(p_name);
|
||||
if (!items[p_item].opentype_features.has(tag)) {
|
||||
return -1;
|
||||
}
|
||||
return items[p_item].opentype_features[tag];
|
||||
}
|
||||
|
||||
String PopupMenu::get_item_language(int p_item) const {
|
||||
ERR_FAIL_INDEX_V(p_item, items.size(), "");
|
||||
return items[p_item].language;
|
||||
@ -1853,7 +1821,6 @@ void PopupMenu::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_item_text", "index", "text"), &PopupMenu::set_item_text);
|
||||
ClassDB::bind_method(D_METHOD("set_item_text_direction", "index", "direction"), &PopupMenu::set_item_text_direction);
|
||||
ClassDB::bind_method(D_METHOD("set_item_opentype_feature", "index", "tag", "value"), &PopupMenu::set_item_opentype_feature);
|
||||
ClassDB::bind_method(D_METHOD("set_item_language", "index", "language"), &PopupMenu::set_item_language);
|
||||
ClassDB::bind_method(D_METHOD("set_item_icon", "index", "icon"), &PopupMenu::set_item_icon);
|
||||
ClassDB::bind_method(D_METHOD("set_item_checked", "index", "checked"), &PopupMenu::set_item_checked);
|
||||
@ -1876,8 +1843,6 @@ void PopupMenu::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_item_text", "index"), &PopupMenu::get_item_text);
|
||||
ClassDB::bind_method(D_METHOD("get_item_text_direction", "index"), &PopupMenu::get_item_text_direction);
|
||||
ClassDB::bind_method(D_METHOD("get_item_opentype_feature", "index", "tag"), &PopupMenu::get_item_opentype_feature);
|
||||
ClassDB::bind_method(D_METHOD("clear_item_opentype_features", "index"), &PopupMenu::clear_item_opentype_features);
|
||||
ClassDB::bind_method(D_METHOD("get_item_language", "index"), &PopupMenu::get_item_language);
|
||||
ClassDB::bind_method(D_METHOD("get_item_icon", "index"), &PopupMenu::get_item_icon);
|
||||
ClassDB::bind_method(D_METHOD("is_item_checked", "index"), &PopupMenu::is_item_checked);
|
||||
|
||||
Reference in New Issue
Block a user