You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #105481 from bruvzg/rtl_title_sort
Fix incorrect title bar sorting in RTL layout.
This commit is contained in:
@@ -96,7 +96,23 @@ void EditorTitleBar::_notification(int p_what) {
|
|||||||
Control *prev = nullptr;
|
Control *prev = nullptr;
|
||||||
Control *base = nullptr;
|
Control *base = nullptr;
|
||||||
Control *next = nullptr;
|
Control *next = nullptr;
|
||||||
for (int i = 0; i < get_child_count(); i++) {
|
|
||||||
|
bool rtl = is_layout_rtl();
|
||||||
|
|
||||||
|
int start;
|
||||||
|
int end;
|
||||||
|
int delta;
|
||||||
|
if (rtl) {
|
||||||
|
start = get_child_count() - 1;
|
||||||
|
end = -1;
|
||||||
|
delta = -1;
|
||||||
|
} else {
|
||||||
|
start = 0;
|
||||||
|
end = get_child_count();
|
||||||
|
delta = +1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = start; i != end; i += delta) {
|
||||||
Control *c = as_sortable_control(get_child(i));
|
Control *c = as_sortable_control(get_child(i));
|
||||||
if (!c) {
|
if (!c) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user