mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(ntabbar): add defensive checks for QML initialization timing
This commit is contained in:
@@ -20,6 +20,10 @@ Rectangle {
|
||||
Component.onCompleted: _applyDistribution()
|
||||
|
||||
function _updateFirstLast() {
|
||||
// Defensive check for QML initialization timing
|
||||
if (!tabRow || !tabRow.children) {
|
||||
return;
|
||||
}
|
||||
var kids = tabRow.children;
|
||||
var len = kids.length;
|
||||
var firstVisible = -1;
|
||||
@@ -43,6 +47,9 @@ Rectangle {
|
||||
}
|
||||
|
||||
function _applyDistribution() {
|
||||
if (!tabRow || !tabRow.children) {
|
||||
return;
|
||||
}
|
||||
if (!distributeEvenly) {
|
||||
for (var i = 0; i < tabRow.children.length; i++) {
|
||||
var child = tabRow.children[i];
|
||||
|
||||
Reference in New Issue
Block a user