<commit_before>#include <QDebug>
#include <qdrawutil.h>

#include "lightingsliderstyle.h"

void LightingSliderStyle::drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
{
	const QStyleOptionComplex *opt;
	QPainter *p;

	opt = option;
	p = painter;

	if (control == CC_Slider)
	{
		if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt))
		{
			QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, widget);
			QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, widget);

			if ((slider->subControls & SC_SliderGroove) && groove.isValid())
			{

				Qt::BGMode oldMode = p->backgroundMode();
				p->setBackgroundMode(Qt::TransparentMode);
				p->drawPixmap(widget->rect(), groovePixmap);
				p->setBackgroundMode(oldMode);
			}

			if (slider->subControls & SC_SliderHandle)
			{
				int x = handle.x(), y = handle.y(), wi = handle.width() - 2, he = slider->rect.height();

				Qt::BGMode oldMode = p->backgroundMode();
				p->setBackgroundMode(Qt::TransparentMode);
				auto handlePixMap = QPixmap(_handleImage);
				p->drawPixmap(QRect(x, y, wi, he), handlePixMap);
				p->setBackgroundMode(oldMode);
			}
		}
	}
	else<commit_msg>fixed slider handle scaling<commit_after>#include <QDebug>
#include <qdrawutil.h>

#include "lightingsliderstyle.h"

void LightingSliderStyle::drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
{
	const QStyleOptionComplex *opt;
	QPainter *p;

	opt = option;
	p = painter;

	if (control == CC_Slider)
	{
		if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt))
		{
			QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, widget);
			QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, widget);

			if ((slider->subControls & SC_SliderGroove) && groove.isValid())
			{

				Qt::BGMode oldMode = p->backgroundMode();
				p->setBackgroundMode(Qt::TransparentMode);
				p->drawPixmap(widget->rect(), groovePixmap);
				p->setBackgroundMode(oldMode);
			}

			if (slider->subControls & SC_SliderHandle)
			{
				Qt::BGMode oldMode = p->backgroundMode();
				p->setBackgroundMode(Qt::TransparentMode);
				auto handlePixMap = QPixmap(_handleImage);
				p->drawPixmap(handle.x(), handle.y(), handlePixMap);
				p->setBackgroundMode(oldMode);
			}
		}
	}
	else
{'fraction_non_alphanumeric': 0.13303679741205013, 'fraction_numerical': 0.0004043671653861706, 'mean_word_length': 4.975845410628019, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 32, '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': '6683147', 'n_tokens_mistral': 948, 'n_tokens_neox': 826, 'n_words': 164}