<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TogglDesktop
{
    public partial class TimeEntryCell : UserControl
    {
        public string GUID;
        public bool header = false;

        public TimeEntryCell()
        {
            InitializeComponent();
        }

        internal void Display(Toggl.TimeEntry item)
        {
            GUID = item.GUID;

            labelDescription.Text = item.Description;
            labelProject.ForeColor = ColorTranslator.FromHtml(item.Color);
            labelProject.Text = item.ProjectLabel;
            labelClient.Text = item.ClientLabel;
            labelTask.Text = item.TaskLabel;
            labelDuration.Text = item.Duration;
            labelBillable.Visible = item.Billable;
            labelTag.Visible = (item.Tags != null && item.Tags.Length > 0);

            if (item.IsHeader)
            {
                labelFormattedDate.Text = item.DateHeader;
                labelDateDuration.Text = item.DateDuration;
                Height = headerPanel.Height + panel.Height;
                panel.Top = headerPanel.Bottom;
                header = true;
            }
            else
            {
                Height = panel.Height;
                panel.Top = 0;
                header = false;
            }
            headerPanel.Visible = item.IsHeader;
            toolTip.SetToolTip(labelDescription, item.Description);
            toolTip.SetToolTip(labelTask, item.ProjectAndTaskLabel);
            toolTip.SetToolTip(labelProject, item.ProjectAndTaskLabel);
            toolTip.SetToolTip(labelClient, item.ProjectAndTaskLabel);
            if (labelTag.Visible)
            {
                toolTip.SetToolTip(labelTag, item.Tags.Replace("|", ", "));
            }
        }

        public int getTopLocation()
        {
            if (header)
            {
                return headerPanel.Height + (panel.Height / 2);
            }
            return Height;
        }

        private void TimeEntryCellWithHeader_MouseClick(object sender, MouseEventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelDescription_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Description);
        }

        private void labelDuration_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Duration);
        }

        private void labelProject_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }

        private void labelContinue_Click(object sender, EventArgs e)
        {
            Toggl.Continue(GUID);
        }

        private void panel_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelBillable_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelTag_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelTask_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }

        private void labelClient_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }

        private void taskProjectPanel_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }
    }
}<commit_msg>Edit popup y position fix (win)<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TogglDesktop
{
    public partial class TimeEntryCell : UserControl
    {
        public string GUID;
        public bool header = false;

        public TimeEntryCell()
        {
            InitializeComponent();
        }

        internal void Display(Toggl.TimeEntry item)
        {
            GUID = item.GUID;

            labelDescription.Text = item.Description;
            labelProject.ForeColor = ColorTranslator.FromHtml(item.Color);
            labelProject.Text = item.ProjectLabel;
            labelClient.Text = item.ClientLabel;
            labelTask.Text = item.TaskLabel;
            labelDuration.Text = item.Duration;
            labelBillable.Visible = item.Billable;
            labelTag.Visible = (item.Tags != null && item.Tags.Length > 0);

            if (item.IsHeader)
            {
                labelFormattedDate.Text = item.DateHeader;
                labelDateDuration.Text = item.DateDuration;
                Height = headerPanel.Height + panel.Height;
                panel.Top = headerPanel.Bottom;
                header = true;
            }
            else
            {
                Height = panel.Height;
                panel.Top = 0;
                header = false;
            }
            headerPanel.Visible = item.IsHeader;
            toolTip.SetToolTip(labelDescription, item.Description);
            toolTip.SetToolTip(labelTask, item.ProjectAndTaskLabel);
            toolTip.SetToolTip(labelProject, item.ProjectAndTaskLabel);
            toolTip.SetToolTip(labelClient, item.ProjectAndTaskLabel);
            if (labelTag.Visible)
            {
                toolTip.SetToolTip(labelTag, item.Tags.Replace("|", ", "));
            }
        }

        public int getTopLocation()
        {
            if (header)
            {
                return headerPanel.Height + (panel.Height / 2);
            }
            return Height / 2;
        }

        private void TimeEntryCellWithHeader_MouseClick(object sender, MouseEventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelDescription_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Description);
        }

        private void labelDuration_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Duration);
        }

        private void labelProject_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }

        private void labelContinue_Click(object sender, EventArgs e)
        {
            Toggl.Continue(GUID);
        }

        private void panel_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelBillable_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelTag_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, "");
        }

        private void labelTask_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }

        private void labelClient_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }

        private void taskProjectPanel_Click(object sender, EventArgs e)
        {
            Toggl.Edit(GUID, false, Toggl.Project);
        }
    }
}
{'fraction_non_alphanumeric': 0.08503668763102726, 'fraction_numerical': 0.0009171907756813418, 'mean_word_length': 1.5726322885069093, 'pattern_counts': {'":': 0, '<': 3, '<?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': '414173', 'n_tokens_mistral': 2046, 'n_tokens_neox': 1983, 'n_words': 402}