<commit_before>///layout for displaying one of its children at the time
Layout {
	property int currentIndex: 0;	///< index of displaying child
	property int count: 0;			///< childrens count
	clip: true;	///@private

	/// @private
	onCurrentIndexChanged: {
		if (this.currentIndex < 0)
			this.currentIndex = 0;
		else if (this.children.length > 0 && this.currentIndex >= this.children.length)
			this.currentIndex = this.children.length - 1;

		this._scheduleLayout()
	}

	/// @private
	onActiveFocusChanged: {
		if (value && this.count)
			this.children[this.currentIndex].setFocus()
	}

	/// @private
	function _layout() {
		this.count = this.children.length;
		if (this.trace)
			log('laying out ' + this.count + ' children in ' + this.width + 'x' + this.height)

		for (var i = 0; i < this.count; ++i)
			this.children[i].visibleInView = (i == this.currentIndex);

		var c = this.children[this.currentIndex];
		if (!c)
			return

		this.contentHeight = c.height;
		this.contentWidth = c.width;
	}

	/// @private
	function addChild(child) {
		_globals.core.Item.prototype.addChild.apply(this, arguments)
		child.onChanged('height', this._scheduleLayout.bind(this))
		child.onChanged('recursiveVisible', this._scheduleLayout.bind(this))
	}
}<commit_msg>call addChild on base class prototype<commit_after>///layout for displaying one of its children at the time
Layout {
	property int currentIndex: 0;	///< index of displaying child
	property int count: 0;			///< childrens count
	clip: true;	///@private

	/// @private
	onCurrentIndexChanged: {
		if (this.currentIndex < 0)
			this.currentIndex = 0;
		else if (this.children.length > 0 && this.currentIndex >= this.children.length)
			this.currentIndex = this.children.length - 1;

		this._scheduleLayout()
	}

	/// @private
	onActiveFocusChanged: {
		if (value && this.count)
			this.children[this.currentIndex].setFocus()
	}

	/// @private
	function _layout() {
		this.count = this.children.length;
		if (this.trace)
			log('laying out ' + this.count + ' children in ' + this.width + 'x' + this.height)

		for (var i = 0; i < this.count; ++i)
			this.children[i].visibleInView = (i == this.currentIndex);

		var c = this.children[this.currentIndex];
		if (!c)
			return

		this.contentHeight = c.height;
		this.contentWidth = c.width;
	}

	/// @private
	function addChild(child) {
		_globals.core.Layout.prototype.addChild.apply(this, arguments)
		child.onChanged('height', this._scheduleLayout.bind(this))
		child.onChanged('recursiveVisible', this._scheduleLayout.bind(this))
	}
}
{'fraction_non_alphanumeric': 0.14589905362776026, 'fraction_numerical': 0.005520504731861199, 'mean_word_length': 3.596014492753623, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2084057', 'n_tokens_mistral': 919, 'n_tokens_neox': 827, 'n_words': 195}