summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-10-29 19:25:59 -0500
committerThaddeus Crews <repiteo@outlook.com>2024-10-29 19:25:59 -0500
commit696ca9db3c1aa45a57824783426d595f2d8c03d6 (patch)
tree4869ace538fbc176246f657189b75ebdab94b4a9 /scene
parentb748c91e5b6ab2d14f2dff571cc04c723a23962b (diff)
parent562c666e3dfc9f0fe72a33974c23373dff77c825 (diff)
downloadredot-engine-696ca9db3c1aa45a57824783426d595f2d8c03d6.tar.gz
Merge pull request #98039 from aaronfranke/button-icon
Rename internal Button `*_icon` functions to `*_button_icon` to match exposed methods
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/button.cpp8
-rw-r--r--scene/gui/button.h4
-rw-r--r--scene/gui/color_picker.cpp16
-rw-r--r--scene/gui/file_dialog.cpp18
-rw-r--r--scene/gui/graph_edit.cpp16
-rw-r--r--scene/gui/option_button.cpp6
6 files changed, 34 insertions, 34 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 9df4bfde92..4bd85cbde9 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -642,7 +642,7 @@ String Button::get_language() const {
return language;
}
-void Button::set_icon(const Ref<Texture2D> &p_icon) {
+void Button::set_button_icon(const Ref<Texture2D> &p_icon) {
if (icon == p_icon) {
return;
}
@@ -666,7 +666,7 @@ void Button::_texture_changed() {
update_minimum_size();
}
-Ref<Texture2D> Button::get_icon() const {
+Ref<Texture2D> Button::get_button_icon() const {
return icon;
}
@@ -762,8 +762,8 @@ void Button::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_text_direction"), &Button::get_text_direction);
ClassDB::bind_method(D_METHOD("set_language", "language"), &Button::set_language);
ClassDB::bind_method(D_METHOD("get_language"), &Button::get_language);
- ClassDB::bind_method(D_METHOD("set_button_icon", "texture"), &Button::set_icon);
- ClassDB::bind_method(D_METHOD("get_button_icon"), &Button::get_icon);
+ ClassDB::bind_method(D_METHOD("set_button_icon", "texture"), &Button::set_button_icon);
+ ClassDB::bind_method(D_METHOD("get_button_icon"), &Button::get_button_icon);
ClassDB::bind_method(D_METHOD("set_flat", "enabled"), &Button::set_flat);
ClassDB::bind_method(D_METHOD("is_flat"), &Button::is_flat);
ClassDB::bind_method(D_METHOD("set_clip_text", "enabled"), &Button::set_clip_text);
diff --git a/scene/gui/button.h b/scene/gui/button.h
index 5f4429bc1d..b86d6a6c1f 100644
--- a/scene/gui/button.h
+++ b/scene/gui/button.h
@@ -137,8 +137,8 @@ public:
void set_language(const String &p_language);
String get_language() const;
- void set_icon(const Ref<Texture2D> &p_icon);
- Ref<Texture2D> get_icon() const;
+ void set_button_icon(const Ref<Texture2D> &p_icon);
+ Ref<Texture2D> get_button_icon() const;
void set_expand_icon(bool p_enabled);
bool is_expand_icon() const;
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 2d88a9bddf..997120ff25 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -80,10 +80,10 @@ void ColorPicker::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
- btn_pick->set_icon(theme_cache.screen_picker);
+ btn_pick->set_button_icon(theme_cache.screen_picker);
_update_drop_down_arrow(btn_preset->is_pressed(), btn_preset);
_update_drop_down_arrow(btn_recent_preset->is_pressed(), btn_recent_preset);
- btn_add_preset->set_icon(theme_cache.add_preset);
+ btn_add_preset->set_button_icon(theme_cache.add_preset);
btn_pick->set_custom_minimum_size(Size2(28 * theme_cache.base_scale, 0));
btn_shape->set_custom_minimum_size(Size2(28 * theme_cache.base_scale, 0));
@@ -116,7 +116,7 @@ void ColorPicker::_notification(int p_what) {
shape_popup->set_item_icon(shape_popup->get_item_index(SHAPE_OKHSL_CIRCLE), theme_cache.shape_circle);
if (current_shape != SHAPE_NONE) {
- btn_shape->set_icon(shape_popup->get_item_icon(current_shape));
+ btn_shape->set_button_icon(shape_popup->get_item_icon(current_shape));
}
internal_margin->begin_bulk_theme_override();
@@ -705,14 +705,14 @@ void ColorPicker::_text_type_toggled() {
if (text_is_constructor) {
text_type->set_text("");
#ifdef TOOLS_ENABLED
- text_type->set_icon(get_editor_theme_icon(SNAME("Script")));
+ text_type->set_button_icon(get_editor_theme_icon(SNAME("Script")));
#endif
c_text->set_editable(false);
c_text->set_tooltip_text(RTR("Copy this constructor in a script."));
} else {
text_type->set_text("#");
- text_type->set_icon(nullptr);
+ text_type->set_button_icon(nullptr);
c_text->set_editable(true);
c_text->set_tooltip_text(ETR("Enter a hex code (\"#ff0000\") or named color (\"red\")."));
@@ -738,7 +738,7 @@ void ColorPicker::set_picker_shape(PickerShapeType p_shape) {
}
if (p_shape != SHAPE_NONE) {
shape_popup->set_item_checked(p_shape, true);
- btn_shape->set_icon(shape_popup->get_item_icon(p_shape));
+ btn_shape->set_button_icon(shape_popup->get_item_icon(p_shape));
}
current_shape = p_shape;
@@ -794,9 +794,9 @@ void ColorPicker::_show_hide_preset(const bool &p_is_btn_pressed, Button *p_btn_
void ColorPicker::_update_drop_down_arrow(const bool &p_is_btn_pressed, Button *p_btn_preset) {
if (p_is_btn_pressed) {
- p_btn_preset->set_icon(theme_cache.expanded_arrow);
+ p_btn_preset->set_button_icon(theme_cache.expanded_arrow);
} else {
- p_btn_preset->set_icon(theme_cache.folded_arrow);
+ p_btn_preset->set_button_icon(theme_cache.folded_arrow);
}
}
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index d8e9d1bcc0..111b8579ec 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -197,18 +197,18 @@ void FileDialog::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
- dir_up->set_icon(theme_cache.parent_folder);
+ dir_up->set_button_icon(theme_cache.parent_folder);
if (vbox->is_layout_rtl()) {
- dir_prev->set_icon(theme_cache.forward_folder);
- dir_next->set_icon(theme_cache.back_folder);
+ dir_prev->set_button_icon(theme_cache.forward_folder);
+ dir_next->set_button_icon(theme_cache.back_folder);
} else {
- dir_prev->set_icon(theme_cache.back_folder);
- dir_next->set_icon(theme_cache.forward_folder);
+ dir_prev->set_button_icon(theme_cache.back_folder);
+ dir_next->set_button_icon(theme_cache.forward_folder);
}
- refresh->set_icon(theme_cache.reload);
- show_hidden->set_icon(theme_cache.toggle_hidden);
- makedir->set_icon(theme_cache.create_folder);
- show_filename_filter_button->set_icon(theme_cache.toggle_filename_filter);
+ refresh->set_button_icon(theme_cache.reload);
+ show_hidden->set_button_icon(theme_cache.toggle_hidden);
+ makedir->set_button_icon(theme_cache.create_folder);
+ show_filename_filter_button->set_button_icon(theme_cache.toggle_filename_filter);
dir_up->begin_bulk_theme_override();
dir_up->add_theme_color_override("icon_normal_color", theme_cache.icon_normal_color);
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 646757008a..cb495f9d47 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -733,14 +733,14 @@ void GraphEdit::_update_theme_item_cache() {
void GraphEdit::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
- zoom_minus_button->set_icon(theme_cache.zoom_out);
- zoom_reset_button->set_icon(theme_cache.zoom_reset);
- zoom_plus_button->set_icon(theme_cache.zoom_in);
-
- toggle_snapping_button->set_icon(theme_cache.snapping_toggle);
- toggle_grid_button->set_icon(theme_cache.grid_toggle);
- minimap_button->set_icon(theme_cache.minimap_toggle);
- arrange_button->set_icon(theme_cache.layout);
+ zoom_minus_button->set_button_icon(theme_cache.zoom_out);
+ zoom_reset_button->set_button_icon(theme_cache.zoom_reset);
+ zoom_plus_button->set_button_icon(theme_cache.zoom_in);
+
+ toggle_snapping_button->set_button_icon(theme_cache.snapping_toggle);
+ toggle_grid_button->set_button_icon(theme_cache.grid_toggle);
+ minimap_button->set_button_icon(theme_cache.minimap_toggle);
+ arrange_button->set_button_icon(theme_cache.layout);
zoom_label->set_custom_minimum_size(Size2(48, 0) * theme_cache.base_scale);
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index 5432058f7b..79018c40f5 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -225,7 +225,7 @@ void OptionButton::set_item_icon(int p_idx, const Ref<Texture2D> &p_icon) {
popup->set_item_icon(p_idx, p_icon);
if (current == p_idx) {
- set_icon(p_icon);
+ set_button_icon(p_icon);
}
_queue_update_size_cache();
}
@@ -381,7 +381,7 @@ void OptionButton::_select(int p_which, bool p_emit) {
current = NONE_SELECTED;
set_text("");
- set_icon(nullptr);
+ set_button_icon(nullptr);
} else {
ERR_FAIL_INDEX(p_which, popup->get_item_count());
@@ -391,7 +391,7 @@ void OptionButton::_select(int p_which, bool p_emit) {
current = p_which;
set_text(popup->get_item_text(current));
- set_icon(popup->get_item_icon(current));
+ set_button_icon(popup->get_item_icon(current));
}
if (is_inside_tree() && p_emit) {