mirror of
https://gitlab.gnome.org/julianschacher/top-bar-organizer.git
synced 2025-10-27 15:19:09 +00:00
Fix: Use correct child count when ordering right box
Previously the `panelBoxChildCount` would just be the child count of the right box before new items got added, which would result in incorrect indices for new child insertions being used (in `panel.insert_child_at_index`), since `panelBoxChildCount` would just account for the current children, not for new ones. This resulted in the following issue: When you used the settings to move an item from e.g. the middle box to the right box, the right box would get ordered incorrectly. So fix this issue by getting the max of the right boxes current children and the `validBoxOrder.length`.
This commit is contained in:
parent
65304a9894
commit
d4514219ed
@ -430,7 +430,7 @@ class Extension {
|
||||
// This could happen, when the box order gets set to a permutation
|
||||
// of an outdated box order.
|
||||
case "right":
|
||||
panelBoxChildCount = panelBox.get_children().length;
|
||||
panelBoxChildCount = Math.max(panelBox.get_children().length, validBoxOrder.length);
|
||||
for (let i = 0; i < validBoxOrder.length; i++) {
|
||||
const role = validBoxOrder[validBoxOrder.length - 1 - i];
|
||||
// Get the indicator container associated with the current role.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user