Skip to content

Commit 9ed655d

Browse files
committed
Don't flip playback control buttons in RTL layout
1 parent af77100 commit 9ed655d

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

editor/debugger/editor_visual_profiler.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,7 @@ void EditorVisualProfiler::_notification(int p_what) {
437437
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
438438
case NOTIFICATION_THEME_CHANGED:
439439
case NOTIFICATION_TRANSLATION_CHANGED: {
440-
if (is_layout_rtl()) {
441-
activate->set_icon(get_editor_theme_icon(SNAME("PlayBackwards")));
442-
} else {
443-
activate->set_icon(get_editor_theme_icon(SNAME("Play")));
444-
}
440+
activate->set_icon(get_editor_theme_icon(SNAME("Play")));
445441
clear_button->set_icon(get_editor_theme_icon(SNAME("Clear")));
446442
} break;
447443
}

editor/export/editor_export_platform.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,7 @@ Error EditorExportPlatform::_save_zip_patch_file(void *p_userdata, const String
326326
Ref<ImageTexture> EditorExportPlatform::get_option_icon(int p_index) const {
327327
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
328328
ERR_FAIL_COND_V(theme.is_null(), Ref<ImageTexture>());
329-
if (EditorNode::get_singleton()->get_gui_base()->is_layout_rtl()) {
330-
return theme->get_icon(SNAME("PlayBackwards"), EditorStringName(EditorIcons));
331-
} else {
332-
return theme->get_icon(SNAME("Play"), EditorStringName(EditorIcons));
333-
}
329+
return theme->get_icon(SNAME("Play"), EditorStringName(EditorIcons));
334330
}
335331

336332
String EditorExportPlatform::find_export_template(const String &template_file_name, String *err) const {

editor/plugins/animation_player_editor_plugin.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,30 +2006,34 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
20062006
HBoxContainer *hb = memnew(HBoxContainer);
20072007
add_child(hb);
20082008

2009+
HBoxContainer *playback_container = memnew(HBoxContainer);
2010+
playback_container->set_layout_direction(LAYOUT_DIRECTION_LTR);
2011+
hb->add_child(playback_container);
2012+
20092013
play_bw_from = memnew(Button);
20102014
play_bw_from->set_theme_type_variation("FlatButton");
20112015
play_bw_from->set_tooltip_text(TTR("Play Animation Backwards"));
2012-
hb->add_child(play_bw_from);
2016+
playback_container->add_child(play_bw_from);
20132017

20142018
play_bw = memnew(Button);
20152019
play_bw->set_theme_type_variation("FlatButton");
20162020
play_bw->set_tooltip_text(TTR("Play Animation Backwards from End"));
2017-
hb->add_child(play_bw);
2021+
playback_container->add_child(play_bw);
20182022

20192023
stop = memnew(Button);
20202024
stop->set_theme_type_variation("FlatButton");
20212025
stop->set_tooltip_text(TTR("Pause/Stop Animation"));
2022-
hb->add_child(stop);
2026+
playback_container->add_child(stop);
20232027

20242028
play = memnew(Button);
20252029
play->set_theme_type_variation("FlatButton");
20262030
play->set_tooltip_text(TTR("Play Animation from Start"));
2027-
hb->add_child(play);
2031+
playback_container->add_child(play);
20282032

20292033
play_from = memnew(Button);
20302034
play_from->set_theme_type_variation("FlatButton");
20312035
play_from->set_tooltip_text(TTR("Play Animation"));
2032-
hb->add_child(play_from);
2036+
playback_container->add_child(play_from);
20332037

20342038
frame = memnew(SpinBox);
20352039
hb->add_child(frame);

editor/plugins/sprite_frames_editor_plugin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
19861986
sub_vb->add_child(hfc);
19871987

19881988
playback_container = memnew(HBoxContainer);
1989+
playback_container->set_layout_direction(LAYOUT_DIRECTION_LTR);
19891990
hfc->add_child(playback_container);
19901991

19911992
play_bw_from = memnew(Button);
@@ -2013,7 +2014,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
20132014
play_from->set_tooltip_text(TTR("Play selected animation from current pos. (D)"));
20142015
playback_container->add_child(play_from);
20152016

2016-
playback_container->add_child(memnew(VSeparator));
2017+
hfc->add_child(memnew(VSeparator));
20172018

20182019
autoplay->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_autoplay_pressed));
20192020
autoplay->set_toggle_mode(true);

0 commit comments

Comments
 (0)