<commit_before>Item {
	id: channelsPanelProto;
	signal channelSwitched;
	signal programSelected;
	signal channelSelected;
	property int spacing: 0;

	ChannelsModel {
		id: channelsModel;
		protocol: protocol;
	}

	Item {
		id: currentCategory;
		width: parent.width / 2;
		height: currentCategoryText.height;
		anchors.left: parent.left;
		anchors.top: renderer.top;
		anchors.topMargin: (50 - listIcon.height) / 2;
		anchors.leftMargin: 10;

		Image {
			id: listIcon;
			source: "res/list.png";
			anchors.left: parent.left;
		}

		Text {
			id: currentCategoryText;
			anchors.right: parent.right;
			anchors.left: listIcon.right;
			anchors.verticalCenter: listIcon.verticalCenter;
			anchors.leftMargin: 10;
			clip: true;
			font.pointSize: 18;
			color: colorTheme.textColor;
		}

		MouseArea {
			anchors.fill: parent;

			onClicked: { categoriesList.toggle(); }
		}
	}

	ChannelsList {
		id: channels;
		anchors.top: currentCategory.bottom;
		anchors.bottom: parent.bottom;
		anchors.left: parent.left;
		anchors.right: parent.right;
		anchors.topMargin: 10 + parent.spacing;
		dragEnabled: !parent.parent.hasAnyActiveChild;

		onClicked:				{ if (this.hoverEnabled) this.switchToCurrent(); }
		onSelectPressed:		{ this.switchToCurrent(); }
		onCurrentIndexChanged:	{ epgpanel.hide(); }

		onContentYChanged: {
			if (epgpanel.visible)
				epgpanel.y = this.getCurrentDelegateY() - 70;
		}

		onDetailsRequest: {
			if (epgpanel.visible) {
				epgpanel.hide();
			} else {
				epgpanel.x = this.getCurrentDelegateX() + 10;

				var a = epgpanel.getAnimation('y')
				if (a)
					a.disable()
				epgpanel.y = this.getCurrentDelegateY() - 70;
				if (a)
					a.enable()

				epgpanel.show(this.model.get(this.currentIndex));
				channelsPanelProto.channelSelected(this.model.get(this.currentIndex));
				channelsPanelProto.programSelected(this.model.get(this.currentIndex).program);
			}
		}

		switchToCurrent: {
			if (categoriesList.active)
				categoriesList.toggle();

			var channel = this.model.get(this.currentIndex);

			channel["categoryIndex"] = categoriesList.currentIndex;
			channelsPanelProto.channelSwitched(channel);
		}
	}

	Item {
		anchors.top: channels.top;
		anchors.bottom: channels.bottom;
		anchors.left: renderer.left;
		anchors.right: channels.right;
		anchors.rightMargni: 20;
		clip: true;

		EPGPanel {
			id: epgpanel;
			width: channels.width / 3;
			height: channels.height / 2;

			onProgramSelected(program): {
				channelsPanelProto.channelSelected(channels.model.get(channels.currentIndex));
				channelsPanelProto.programSelected(program);
			}

			Behavior on y { Animation { duration: 300; } }
		}
	}

	Shadow {
		active: categoriesList.active;
		anchors.left: categoriesList.right;<commit_msg>Fix clip area for epgpanel sizes.<commit_after>Item {
	id: channelsPanelProto;
	signal channelSwitched;
	signal programSelected;
	signal channelSelected;
	property int spacing: 0;

	ChannelsModel {
		id: channelsModel;
		protocol: protocol;
	}

	Item {
		id: currentCategory;
		width: parent.width / 2;
		height: currentCategoryText.height;
		anchors.left: parent.left;
		anchors.top: renderer.top;
		anchors.topMargin: (50 - listIcon.height) / 2;
		anchors.leftMargin: 10;

		Image {
			id: listIcon;
			source: "res/list.png";
			anchors.left: parent.left;
		}

		Text {
			id: currentCategoryText;
			anchors.right: parent.right;
			anchors.left: listIcon.right;
			anchors.verticalCenter: listIcon.verticalCenter;
			anchors.leftMargin: 10;
			clip: true;
			font.pointSize: 18;
			color: colorTheme.textColor;
		}

		MouseArea {
			anchors.fill: parent;

			onClicked: { categoriesList.toggle(); }
		}
	}

	ChannelsList {
		id: channels;
		anchors.top: currentCategory.bottom;
		anchors.bottom: parent.bottom;
		anchors.left: parent.left;
		anchors.right: parent.right;
		anchors.topMargin: 10 + parent.spacing;
		dragEnabled: !parent.parent.hasAnyActiveChild;

		onClicked:				{ if (this.hoverEnabled) this.switchToCurrent(); }
		onSelectPressed:		{ this.switchToCurrent(); }
		onCurrentIndexChanged:	{ epgpanel.hide(); }

		onContentYChanged: {
			if (epgpanel.visible)
				epgpanel.y = this.getCurrentDelegateY() - 70;
		}

		onDetailsRequest: {
			if (epgpanel.visible) {
				epgpanel.hide();
			} else {
				epgpanel.x = this.getCurrentDelegateX() + 10;

				var a = epgpanel.getAnimation('y')
				if (a)
					a.disable()
				epgpanel.y = this.getCurrentDelegateY() - 70;
				if (a)
					a.enable()

				epgpanel.show(this.model.get(this.currentIndex));
				channelsPanelProto.channelSelected(this.model.get(this.currentIndex));
				channelsPanelProto.programSelected(this.model.get(this.currentIndex).program);
			}
		}

		switchToCurrent: {
			if (categoriesList.active)
				categoriesList.toggle();

			var channel = this.model.get(this.currentIndex);

			channel["categoryIndex"] = categoriesList.currentIndex;
			channelsPanelProto.channelSwitched(channel);
		}
	}

	Item {
		anchors.top: channels.top;
		anchors.bottom: channels.bottom;
		anchors.left: renderer.left;
		anchors.right: channels.right;
		anchors.rightMargin: -40;
		clip: true;

		EPGPanel {
			id: epgpanel;
			width: channels.width / 3;
			height: channels.height / 2;

			onProgramSelected(program): {
				channelsPanelProto.channelSelected(channels.model.get(channels.currentIndex));
				channelsPanelProto.programSelected(program);
			}

			Behavior on y { Animation { duration: 300; } }
		}
	}

	Shadow {
		active: categoriesList.active;
		anchors.left: categoriesList.right;
{'fraction_non_alphanumeric': 0.12175177176085772, 'fraction_numerical': 0.009449391241141195, 'mean_word_length': 3.7042735042735044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2326924', 'n_tokens_mistral': 2222, 'n_tokens_neox': 1851, 'n_words': 332}