more work on gtk & code cleanup

This commit is contained in:
2025-06-16 15:30:56 +02:00
parent 6f7bb5d92c
commit a49a3b2beb
69 changed files with 374 additions and 268 deletions

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.ComponentModel;
// Nicht gemergte Änderung aus Projekt "Pilz.UI (net8.0-windows)"
// Vor:
// Imports System.Windows.Forms
@@ -9,7 +6,6 @@ using System.Drawing;
// Nach:
// Imports System.Drawing
// Imports System.Windows.Forms
using System.Windows.Forms;
namespace Pilz.UI.WinForms;
@@ -17,8 +13,8 @@ namespace Pilz.UI.WinForms;
public class Highlighter : Component
{
private Dictionary<Control, eHighlightColor> _Highlights = new Dictionary<Control, eHighlightColor>();
private Dictionary<Control, bool> _HighlightOnFocus = new Dictionary<Control, bool>();
private Dictionary<Control, eHighlightColor> _Highlights = [];
private Dictionary<Control, bool> _HighlightOnFocus = [];
protected override void Dispose(bool disposing)
{
@@ -143,8 +139,8 @@ public class Highlighter : Component
}
}
private Dictionary<TabControl, int> _TabControl2 = new Dictionary<TabControl, int>();
private Dictionary<Panel, int> _ParentPanel = new Dictionary<Panel, int>();
private Dictionary<TabControl, int> _TabControl2 = [];
private Dictionary<Panel, int> _ParentPanel = [];
private void AddHighlight(Dictionary<Control, eHighlightColor> highlights, Control c, eHighlightColor highlightColor)
{
@@ -386,15 +382,14 @@ public class Highlighter : Component
if (_ContainerControl is not null)
{
if (_HighlightPanel is null)
_HighlightPanel ??= new HighlightPanel(_Highlights)
{
_HighlightPanel = new HighlightPanel(_Highlights);
_HighlightPanel.FocusHighlightColor = _FocusHighlightColor;
_HighlightPanel.Margin = new Padding(0);
_HighlightPanel.Padding = new Padding(0);
_HighlightPanel.CustomHighlightColors = _CustomHighlightColors;
_HighlightPanel.Visible = false;
}
FocusHighlightColor = _FocusHighlightColor,
Margin = new Padding(0),
Padding = new Padding(0),
CustomHighlightColors = _CustomHighlightColors,
Visible = false
};
_ContainerControl.SizeChanged += ContainerControlSizeChanged;
_ContainerControl.HandleCreated += ContainerControlHandleCreated;
@@ -452,8 +447,10 @@ public class Highlighter : Component
if (_DelayTimer is null)
{
_DelayTimer = new();
_DelayTimer.Interval = 100;
_DelayTimer = new()
{
Interval = 100
};
_DelayTimer.Tick += new EventHandler(DelayTimerTick);
_DelayTimer.Start();
}