Skip to content

Commit

Permalink
Merge pull request #100049 from Chaosus/flat_button_sname
Browse files Browse the repository at this point in the history
[Scene] Add `SceneStringName::FlatButton`
  • Loading branch information
Repiteo committed Dec 10, 2024
2 parents ba66c47 + ba39b07 commit b789935
Show file tree
Hide file tree
Showing 44 changed files with 256 additions and 254 deletions.
16 changes: 8 additions & 8 deletions editor/debugger/script_editor_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1853,30 +1853,30 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
hbc->add_child(memnew(VSeparator));

skip_breakpoints = memnew(Button);
skip_breakpoints->set_theme_type_variation("FlatButton");
skip_breakpoints->set_theme_type_variation(SceneStringName(FlatButton));
hbc->add_child(skip_breakpoints);
skip_breakpoints->set_tooltip_text(TTR("Skip Breakpoints"));
skip_breakpoints->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_skip_breakpoints));

hbc->add_child(memnew(VSeparator));

copy = memnew(Button);
copy->set_theme_type_variation("FlatButton");
copy->set_theme_type_variation(SceneStringName(FlatButton));
hbc->add_child(copy);
copy->set_tooltip_text(TTR("Copy Error"));
copy->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_copy));

hbc->add_child(memnew(VSeparator));

step = memnew(Button);
step->set_theme_type_variation("FlatButton");
step->set_theme_type_variation(SceneStringName(FlatButton));
hbc->add_child(step);
step->set_tooltip_text(TTR("Step Into"));
step->set_shortcut(ED_GET_SHORTCUT("debugger/step_into"));
step->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_step));

next = memnew(Button);
next->set_theme_type_variation("FlatButton");
next->set_theme_type_variation(SceneStringName(FlatButton));
hbc->add_child(next);
next->set_tooltip_text(TTR("Step Over"));
next->set_shortcut(ED_GET_SHORTCUT("debugger/step_over"));
Expand All @@ -1885,14 +1885,14 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
hbc->add_child(memnew(VSeparator));

dobreak = memnew(Button);
dobreak->set_theme_type_variation("FlatButton");
dobreak->set_theme_type_variation(SceneStringName(FlatButton));
hbc->add_child(dobreak);
dobreak->set_tooltip_text(TTR("Break"));
dobreak->set_shortcut(ED_GET_SHORTCUT("debugger/break"));
dobreak->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_break));

docontinue = memnew(Button);
docontinue->set_theme_type_variation("FlatButton");
docontinue->set_theme_type_variation(SceneStringName(FlatButton));
hbc->add_child(docontinue);
docontinue->set_tooltip_text(TTR("Continue"));
docontinue->set_shortcut(ED_GET_SHORTCUT("debugger/continue"));
Expand Down Expand Up @@ -2079,10 +2079,10 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
vmem_total->set_custom_minimum_size(Size2(100, 0) * EDSCALE);
vmem_hb->add_child(vmem_total);
vmem_refresh = memnew(Button);
vmem_refresh->set_theme_type_variation("FlatButton");
vmem_refresh->set_theme_type_variation(SceneStringName(FlatButton));
vmem_hb->add_child(vmem_refresh);
vmem_export = memnew(Button);
vmem_export->set_theme_type_variation("FlatButton");
vmem_export->set_theme_type_variation(SceneStringName(FlatButton));
vmem_export->set_tooltip_text(TTR("Export list to a CSV file"));
vmem_hb->add_child(vmem_export);
vmem_vb->add_child(vmem_hb);
Expand Down
6 changes: 3 additions & 3 deletions editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,21 +822,21 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
HBoxContainer *hbc = memnew(HBoxContainer);
vb->add_child(hbc);
solo = memnew(Button);
solo->set_theme_type_variation("FlatButton");
solo->set_theme_type_variation(SceneStringName(FlatButton));
solo->set_toggle_mode(true);
solo->set_tooltip_text(TTR("Solo"));
solo->set_focus_mode(FOCUS_NONE);
solo->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_solo_toggled));
hbc->add_child(solo);
mute = memnew(Button);
mute->set_theme_type_variation("FlatButton");
mute->set_theme_type_variation(SceneStringName(FlatButton));
mute->set_toggle_mode(true);
mute->set_tooltip_text(TTR("Mute"));
mute->set_focus_mode(FOCUS_NONE);
mute->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_mute_toggled));
hbc->add_child(mute);
bypass = memnew(Button);
bypass->set_theme_type_variation("FlatButton");
bypass->set_theme_type_variation(SceneStringName(FlatButton));
bypass->set_toggle_mode(true);
bypass->set_tooltip_text(TTR("Bypass"));
bypass->set_focus_mode(FOCUS_NONE);
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_help_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ EditorHelpSearch::EditorHelpSearch() {
hbox->add_child(search_box);

case_sensitive_button = memnew(Button);
case_sensitive_button->set_theme_type_variation("FlatButton");
case_sensitive_button->set_theme_type_variation(SceneStringName(FlatButton));
case_sensitive_button->set_tooltip_text(TTR("Case Sensitive"));
case_sensitive_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelpSearch::_update_results));
case_sensitive_button->set_toggle_mode(true);
case_sensitive_button->set_focus_mode(Control::FOCUS_NONE);
hbox->add_child(case_sensitive_button);

hierarchy_button = memnew(Button);
hierarchy_button->set_theme_type_variation("FlatButton");
hierarchy_button->set_theme_type_variation(SceneStringName(FlatButton));
hierarchy_button->set_tooltip_text(TTR("Show Hierarchy"));
hierarchy_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelpSearch::_update_results));
hierarchy_button->set_toggle_mode(true);
Expand Down
8 changes: 4 additions & 4 deletions editor/editor_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,15 @@ EditorLog::EditorLog() {

// Clear.
clear_button = memnew(Button);
clear_button->set_theme_type_variation("FlatButton");
clear_button->set_theme_type_variation(SceneStringName(FlatButton));
clear_button->set_focus_mode(FOCUS_NONE);
clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::K));
clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_clear_request));
hb_tools->add_child(clear_button);

// Copy.
copy_button = memnew(Button);
copy_button->set_theme_type_variation("FlatButton");
copy_button->set_theme_type_variation(SceneStringName(FlatButton));
copy_button->set_focus_mode(FOCUS_NONE);
copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KeyModifierMask::CMD_OR_CTRL | Key::C));
copy_button->set_shortcut_context(this);
Expand All @@ -505,7 +505,7 @@ EditorLog::EditorLog() {

// Collapse.
collapse_button = memnew(Button);
collapse_button->set_theme_type_variation("FlatButton");
collapse_button->set_theme_type_variation(SceneStringName(FlatButton));
collapse_button->set_focus_mode(FOCUS_NONE);
collapse_button->set_tooltip_text(TTR("Collapse duplicate messages into one log entry. Shows number of occurrences."));
collapse_button->set_toggle_mode(true);
Expand All @@ -515,7 +515,7 @@ EditorLog::EditorLog() {

// Show Search.
show_search_button = memnew(Button);
show_search_button->set_theme_type_variation("FlatButton");
show_search_button->set_theme_type_variation(SceneStringName(FlatButton));
show_search_button->set_focus_mode(FOCUS_NONE);
show_search_button->set_toggle_mode(true);
show_search_button->set_pressed(true);
Expand Down
24 changes: 12 additions & 12 deletions editor/gui/editor_file_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2309,13 +2309,13 @@ EditorFileDialog::EditorFileDialog() {
vbc->add_child(pathhb);

dir_prev = memnew(Button);
dir_prev->set_theme_type_variation("FlatButton");
dir_prev->set_theme_type_variation(SceneStringName(FlatButton));
dir_prev->set_tooltip_text(TTR("Go to previous folder."));
dir_next = memnew(Button);
dir_next->set_theme_type_variation("FlatButton");
dir_next->set_theme_type_variation(SceneStringName(FlatButton));
dir_next->set_tooltip_text(TTR("Go to next folder."));
dir_up = memnew(Button);
dir_up->set_theme_type_variation("FlatButton");
dir_up->set_theme_type_variation(SceneStringName(FlatButton));
dir_up->set_tooltip_text(TTR("Go to parent folder."));

pathhb->add_child(dir_prev);
Expand All @@ -2338,13 +2338,13 @@ EditorFileDialog::EditorFileDialog() {
pathhb->add_child(dir);

refresh = memnew(Button);
refresh->set_theme_type_variation("FlatButton");
refresh->set_theme_type_variation(SceneStringName(FlatButton));
refresh->set_tooltip_text(TTR("Refresh files."));
refresh->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::update_file_list));
pathhb->add_child(refresh);

favorite = memnew(Button);
favorite->set_theme_type_variation("FlatButton");
favorite->set_theme_type_variation(SceneStringName(FlatButton));
favorite->set_toggle_mode(true);
favorite->set_tooltip_text(TTR("(Un)favorite current folder."));
favorite->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_pressed));
Expand All @@ -2361,7 +2361,7 @@ EditorFileDialog::EditorFileDialog() {
pathhb->add_child(makedir_sep);

makedir = memnew(Button);
makedir->set_theme_type_variation("FlatButton");
makedir->set_theme_type_variation(SceneStringName(FlatButton));
makedir->set_tooltip_text(TTR("Create a new folder."));
makedir->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_make_dir));
pathhb->add_child(makedir);
Expand Down Expand Up @@ -2397,11 +2397,11 @@ EditorFileDialog::EditorFileDialog() {

fav_hb->add_spacer();
fav_up = memnew(Button);
fav_up->set_theme_type_variation("FlatButton");
fav_up->set_theme_type_variation(SceneStringName(FlatButton));
fav_hb->add_child(fav_up);
fav_up->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_move_up));
fav_down = memnew(Button);
fav_down->set_theme_type_variation("FlatButton");
fav_down->set_theme_type_variation(SceneStringName(FlatButton));
fav_hb->add_child(fav_down);
fav_down->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_move_down));

Expand Down Expand Up @@ -2444,7 +2444,7 @@ EditorFileDialog::EditorFileDialog() {
lower_hb->add_child(l);

show_hidden = memnew(Button);
show_hidden->set_theme_type_variation("FlatButton");
show_hidden->set_theme_type_variation(SceneStringName(FlatButton));
show_hidden->set_toggle_mode(true);
show_hidden->set_pressed(is_showing_hidden_files());
show_hidden->set_tooltip_text(TTR("Toggle the visibility of hidden files."));
Expand All @@ -2457,7 +2457,7 @@ EditorFileDialog::EditorFileDialog() {
view_mode_group.instantiate();

mode_thumbnails = memnew(Button);
mode_thumbnails->set_theme_type_variation("FlatButton");
mode_thumbnails->set_theme_type_variation(SceneStringName(FlatButton));
mode_thumbnails->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS));
mode_thumbnails->set_toggle_mode(true);
mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS);
Expand All @@ -2466,7 +2466,7 @@ EditorFileDialog::EditorFileDialog() {
lower_hb->add_child(mode_thumbnails);

mode_list = memnew(Button);
mode_list->set_theme_type_variation("FlatButton");
mode_list->set_theme_type_variation(SceneStringName(FlatButton));
mode_list->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST));
mode_list->set_toggle_mode(true);
mode_list->set_pressed(display_mode == DISPLAY_LIST);
Expand All @@ -2482,7 +2482,7 @@ EditorFileDialog::EditorFileDialog() {
file_sort_button->set_tooltip_text(TTR("Sort files"));

show_search_filter_button = memnew(Button);
show_search_filter_button->set_theme_type_variation("FlatButton");
show_search_filter_button->set_theme_type_variation(SceneStringName(FlatButton));
show_search_filter_button->set_toggle_mode(true);
show_search_filter_button->set_pressed(false);
show_search_filter_button->set_tooltip_text(TTR("Toggle the visibility of the filter for file names."));
Expand Down
4 changes: 2 additions & 2 deletions editor/node_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ NodeDock::NodeDock() {
mode_hb->hide();

connections_button = memnew(Button);
connections_button->set_theme_type_variation("FlatButton");
connections_button->set_theme_type_variation(SceneStringName(FlatButton));
connections_button->set_text(TTR("Signals"));
connections_button->set_toggle_mode(true);
connections_button->set_pressed(true);
Expand All @@ -104,7 +104,7 @@ NodeDock::NodeDock() {
connections_button->connect(SceneStringName(pressed), callable_mp(this, &NodeDock::show_connections));

groups_button = memnew(Button);
groups_button->set_theme_type_variation("FlatButton");
groups_button->set_theme_type_variation(SceneStringName(FlatButton));
groups_button->set_text(TTR("Groups"));
groups_button->set_toggle_mode(true);
groups_button->set_pressed(false);
Expand Down
6 changes: 3 additions & 3 deletions editor/plugins/abstract_polygon_2d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,19 +727,19 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(bool p_wip_destructive) {
edge_point = PosVertex();

button_create = memnew(Button);
button_create->set_theme_type_variation("FlatButton");
button_create->set_theme_type_variation(SceneStringName(FlatButton));
add_child(button_create);
button_create->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_CREATE));
button_create->set_toggle_mode(true);

button_edit = memnew(Button);
button_edit->set_theme_type_variation("FlatButton");
button_edit->set_theme_type_variation(SceneStringName(FlatButton));
add_child(button_edit);
button_edit->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_EDIT));
button_edit->set_toggle_mode(true);

button_delete = memnew(Button);
button_delete->set_theme_type_variation("FlatButton");
button_delete->set_theme_type_variation(SceneStringName(FlatButton));
add_child(button_delete);
button_delete->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_DELETE));
button_delete->set_toggle_mode(true);
Expand Down
10 changes: 5 additions & 5 deletions editor/plugins/animation_blend_space_1d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
bg.instantiate();

tool_blend = memnew(Button);
tool_blend->set_theme_type_variation("FlatButton");
tool_blend->set_theme_type_variation(SceneStringName(FlatButton));
tool_blend->set_toggle_mode(true);
tool_blend->set_button_group(bg);
top_hb->add_child(tool_blend);
Expand All @@ -670,15 +670,15 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
tool_blend->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(3));

tool_select = memnew(Button);
tool_select->set_theme_type_variation("FlatButton");
tool_select->set_theme_type_variation(SceneStringName(FlatButton));
tool_select->set_toggle_mode(true);
tool_select->set_button_group(bg);
top_hb->add_child(tool_select);
tool_select->set_tooltip_text(TTR("Select and move points, create points with RMB."));
tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(0));

tool_create = memnew(Button);
tool_create->set_theme_type_variation("FlatButton");
tool_create->set_theme_type_variation(SceneStringName(FlatButton));
tool_create->set_toggle_mode(true);
tool_create->set_button_group(bg);
top_hb->add_child(tool_create);
Expand All @@ -688,15 +688,15 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
tool_erase_sep = memnew(VSeparator);
top_hb->add_child(tool_erase_sep);
tool_erase = memnew(Button);
tool_erase->set_theme_type_variation("FlatButton");
tool_erase->set_theme_type_variation(SceneStringName(FlatButton));
top_hb->add_child(tool_erase);
tool_erase->set_tooltip_text(TTR("Erase points."));
tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_erase_selected));

top_hb->add_child(memnew(VSeparator));

snap = memnew(Button);
snap->set_theme_type_variation("FlatButton");
snap->set_theme_type_variation(SceneStringName(FlatButton));
snap->set_toggle_mode(true);
top_hb->add_child(snap);
snap->set_pressed(true);
Expand Down
14 changes: 7 additions & 7 deletions editor/plugins/animation_blend_space_2d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
bg.instantiate();

tool_blend = memnew(Button);
tool_blend->set_theme_type_variation("FlatButton");
tool_blend->set_theme_type_variation(SceneStringName(FlatButton));
tool_blend->set_toggle_mode(true);
tool_blend->set_button_group(bg);
top_hb->add_child(tool_blend);
Expand All @@ -891,23 +891,23 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
tool_blend->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(3));

tool_select = memnew(Button);
tool_select->set_theme_type_variation("FlatButton");
tool_select->set_theme_type_variation(SceneStringName(FlatButton));
tool_select->set_toggle_mode(true);
tool_select->set_button_group(bg);
top_hb->add_child(tool_select);
tool_select->set_tooltip_text(TTR("Select and move points, create points with RMB."));
tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(0));

tool_create = memnew(Button);
tool_create->set_theme_type_variation("FlatButton");
tool_create->set_theme_type_variation(SceneStringName(FlatButton));
tool_create->set_toggle_mode(true);
tool_create->set_button_group(bg);
top_hb->add_child(tool_create);
tool_create->set_tooltip_text(TTR("Create points."));
tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(1));

tool_triangle = memnew(Button);
tool_triangle->set_theme_type_variation("FlatButton");
tool_triangle->set_theme_type_variation(SceneStringName(FlatButton));
tool_triangle->set_toggle_mode(true);
tool_triangle->set_button_group(bg);
top_hb->add_child(tool_triangle);
Expand All @@ -917,7 +917,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
tool_erase_sep = memnew(VSeparator);
top_hb->add_child(tool_erase_sep);
tool_erase = memnew(Button);
tool_erase->set_theme_type_variation("FlatButton");
tool_erase->set_theme_type_variation(SceneStringName(FlatButton));
top_hb->add_child(tool_erase);
tool_erase->set_tooltip_text(TTR("Erase points and triangles."));
tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_erase_selected));
Expand All @@ -926,7 +926,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
top_hb->add_child(memnew(VSeparator));

auto_triangles = memnew(Button);
auto_triangles->set_theme_type_variation("FlatButton");
auto_triangles->set_theme_type_variation(SceneStringName(FlatButton));
top_hb->add_child(auto_triangles);
auto_triangles->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled));
auto_triangles->set_toggle_mode(true);
Expand All @@ -935,7 +935,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
top_hb->add_child(memnew(VSeparator));

snap = memnew(Button);
snap->set_theme_type_variation("FlatButton");
snap->set_theme_type_variation(SceneStringName(FlatButton));
snap->set_toggle_mode(true);
top_hb->add_child(snap);
snap->set_pressed(true);
Expand Down
Loading

0 comments on commit b789935

Please sign in to comment.