summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-06-19 20:49:04 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-06-19 20:49:49 +0200
commit31b7f02a29cdf4f1c30cfc37962f43f67380b9ad (patch)
tree1c0de1bac35046915575687e8d8993643d372474 /modules
parentcb9d02a8d1b5bb71abcec6be0e75002c5ea656c4 (diff)
downloadredot-engine-31b7f02a29cdf4f1c30cfc37962f43f67380b9ad.tar.gz
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button; it's just a Button with the Flat property enabled by default. Removing it avoids some confusion when creating GUIs. Existing ToolButtons will be converted to Buttons, but the Flat property won't be enabled automatically. This closes https://github.com/godotengine/godot-proposals/issues/1081.
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnavigation/navigation_mesh_editor_plugin.cpp6
-rw-r--r--modules/gdnavigation/navigation_mesh_editor_plugin.h4
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp6
-rw-r--r--modules/gridmap/grid_map_editor_plugin.h4
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs4
6 files changed, 18 insertions, 14 deletions
diff --git a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp
index 5fe1060aae..648f4f7cdd 100644
--- a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp
+++ b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp
@@ -95,13 +95,15 @@ void NavigationMeshEditor::_bind_methods() {
NavigationMeshEditor::NavigationMeshEditor() {
bake_hbox = memnew(HBoxContainer);
- button_bake = memnew(ToolButton);
+ button_bake = memnew(Button);
+ button_bake->set_flat(true);
bake_hbox->add_child(button_bake);
button_bake->set_toggle_mode(true);
button_bake->set_text(TTR("Bake NavMesh"));
button_bake->connect("pressed", callable_mp(this, &NavigationMeshEditor::_bake_pressed));
- button_reset = memnew(ToolButton);
+ button_reset = memnew(Button);
+ button_reset->set_flat(true);
bake_hbox->add_child(button_reset);
// No button text, we only use a revert icon which is set when entering the tree.
button_reset->set_tooltip(TTR("Clear the navigation mesh."));
diff --git a/modules/gdnavigation/navigation_mesh_editor_plugin.h b/modules/gdnavigation/navigation_mesh_editor_plugin.h
index da3a981f8c..728f958eaa 100644
--- a/modules/gdnavigation/navigation_mesh_editor_plugin.h
+++ b/modules/gdnavigation/navigation_mesh_editor_plugin.h
@@ -46,8 +46,8 @@ class NavigationMeshEditor : public Control {
AcceptDialog *err_dialog;
HBoxContainer *bake_hbox;
- ToolButton *button_bake;
- ToolButton *button_reset;
+ Button *button_bake;
+ Button *button_reset;
Label *bake_info;
NavigationRegion3D *node;
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 3b0e78546d..1b7ce98721 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -1241,14 +1241,16 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
search_box->connect("text_changed", callable_mp(this, &GridMapEditor::_text_changed));
search_box->connect("gui_input", callable_mp(this, &GridMapEditor::_sbox_input));
- mode_thumbnail = memnew(ToolButton);
+ mode_thumbnail = memnew(Button);
+ mode_thumbnail->set_flat(true);
mode_thumbnail->set_toggle_mode(true);
mode_thumbnail->set_pressed(true);
mode_thumbnail->set_icon(p_editor->get_gui_base()->get_theme_icon("FileThumbnail", "EditorIcons"));
hb->add_child(mode_thumbnail);
mode_thumbnail->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode), varray(DISPLAY_THUMBNAIL));
- mode_list = memnew(ToolButton);
+ mode_list = memnew(Button);
+ mode_list->set_flat(true);
mode_list->set_toggle_mode(true);
mode_list->set_pressed(false);
mode_list->set_icon(p_editor->get_gui_base()->get_theme_icon("FileList", "EditorIcons"));
diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h
index 19eea18965..0ae9b27833 100644
--- a/modules/gridmap/grid_map_editor_plugin.h
+++ b/modules/gridmap/grid_map_editor_plugin.h
@@ -74,8 +74,8 @@ class GridMapEditor : public VBoxContainer {
MenuButton *options;
SpinBox *floor;
double accumulated_floor_delta;
- ToolButton *mode_thumbnail;
- ToolButton *mode_list;
+ Button *mode_thumbnail;
+ Button *mode_list;
LineEdit *search_box;
HSlider *size_slider;
HBoxContainer *spatial_editor_hb;
diff --git a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
index 3cf495f025..3de3d8d318 100644
--- a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs
@@ -20,8 +20,8 @@ namespace GodotTools
private ItemList buildTabsList;
private TabContainer buildTabs;
- private ToolButton warningsBtn;
- private ToolButton errorsBtn;
+ private Button warningsBtn;
+ private Button errorsBtn;
private Button viewLogBtn;
private void _UpdateBuildTabsList()
@@ -285,7 +285,7 @@ namespace GodotTools
toolBarHBox.AddSpacer(begin: false);
- warningsBtn = new ToolButton
+ warningsBtn = new Button
{
Text = "Warnings".TTR(),
ToggleMode = true,
@@ -296,7 +296,7 @@ namespace GodotTools
warningsBtn.Toggled += _WarningsToggled;
toolBarHBox.AddChild(warningsBtn);
- errorsBtn = new ToolButton
+ errorsBtn = new Button
{
Text = "Errors".TTR(),
ToggleMode = true,
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index 403e25781d..f330f9ed2c 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -30,7 +30,7 @@ namespace GodotTools
private AcceptDialog aboutDialog;
private CheckBox aboutDialogCheckBox;
- private ToolButton bottomPanelBtn;
+ private Button bottomPanelBtn;
public GodotIdeManager GodotIdeManager { get; private set; }
@@ -513,7 +513,7 @@ namespace GodotTools
menuPopup.IdPressed += _MenuOptionPressed;
- var buildButton = new ToolButton
+ var buildButton = new Button
{
Text = "Build",
HintTooltip = "Build solution",