<commit_before>package at.int32.sweaty.ui.controls;

import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;

import at.int32.sweaty.ui.Colors;
import at.int32.sweaty.ui.Control;
import at.int32.sweaty.ui.Layout;

public class WebView extends Widget<Browser> {

	private Spinner spinner;
	private Image imgSpinner;
	private int sizeSpinner;

	public WebView(Control parent) {
		super(parent);
		this.background(Colors.get(255, 255, 255));
		this.ctrl.setVisible(false);
		this.ctrl.setTouchEnabled(true);
		this.ctrl.setJavascriptEnabled(true);
	}

	public WebView loading(Image img, int size) {
		this.imgSpinner = img;
		this.sizeSpinner = size;
		return this;
	}

	public WebView url(String url) {
		if (this.spinner == null && imgSpinner != null) {
			this.spinner = new Spinner(this).size(sizeSpinner).center();
			this.spinner.image(imgSpinner);
			this.spinner.start();
		}

		this.ctrl.setVisible(false);
		this.ctrl.setUrl(url);
		this.ctrl.addProgressListener(new ProgressListener() {

			@Override
			public void completed(ProgressEvent arg0) {
				if (spinner != null)
					spinner.dispose();

				WebView.this.update();<commit_msg>remove background color<commit_after>package at.int32.sweaty.ui.controls;

import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;

import at.int32.sweaty.ui.Control;
import at.int32.sweaty.ui.Layout;

public class WebView extends Widget<Browser> {

	private Spinner spinner;
	private Image imgSpinner;
	private int sizeSpinner;

	public WebView(Control parent) {
		super(parent);
		this.ctrl.setVisible(false);
		this.ctrl.setTouchEnabled(true);
		this.ctrl.setJavascriptEnabled(true);
	}

	public WebView loading(Image img, int size) {
		this.imgSpinner = img;
		this.sizeSpinner = size;
		return this;
	}
	
	public WebView url(String url) {
		if (this.spinner == null && imgSpinner != null) {
			this.spinner = new Spinner(this).size(sizeSpinner).center();
			this.spinner.image(imgSpinner);
			this.spinner.start();
		}

		this.ctrl.setVisible(false);
		this.ctrl.setUrl(url);
		this.ctrl.addProgressListener(new ProgressListener() {

			@Override
			public void completed(ProgressEvent arg0) {
				if (spinner != null)
					spinner.dispose();

				WebView.this.update();
{'fraction_non_alphanumeric': 0.12485549132947976, 'fraction_numerical': 0.009633911368015413, 'mean_word_length': 4.5588865096359745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6606901', 'n_tokens_mistral': 975, 'n_tokens_neox': 872, 'n_words': 164}