Publish reviewed history-free open-source snapshot (2026-10-12)

This commit is contained in:
Zonghengjia Open Source
2026-10-11 23:23:20 +00:00
commit 901f27baf5
301 changed files with 32378 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
namespace UCVL.VPNPlus;
internal sealed partial class MainForm
{
private WindowChrome? _windowChrome;
internal WindowChrome? WindowChromeForTest => _windowChrome;
// Remove the native caption before HWND creation, not only after its first
// style/paint messages. This avoids a transient second caption at startup.
protected override CreateParams CreateParams
{
get
{
var parameters = base.CreateParams;
parameters.Style = unchecked((int)ChromeNative.ClientChromeStyle(parameters.Style));
return parameters;
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
LayoutBrandHeader();
CenterCards();
LayoutDashboard();
}
// Explicit title/tray Exit and installer IPC share the graceful exit path.
private void InitializeWindowChrome(Panel header)
{
if (_windowChrome is not null) return;
_windowChrome = new WindowChrome(this, header, RequestExit);
_windowChrome.SetLoginMode(true);
}
private void LayoutWindowChrome() => _windowChrome?.LayoutButtons();
// Minimize is a normal taskbar state, never Hide() or a disconnect. Avoid
// presenting a second, tray-only entry while the taskbar owns restoration.
private void UpdateTaskbarPresentation()
{
if (_exitResourcesDisposed) return;
_notifyIcon.Visible = ShouldShowTrayIcon(WindowState, _preview || _uiOnly || _exiting);
}
internal static bool ShouldShowTrayIcon(FormWindowState state, bool suppressed) =>
!suppressed && state != FormWindowState.Minimized;
internal bool MinimizedToTaskbarForTest => WindowState == FormWindowState.Minimized
&& ShowInTaskbar && Visible && !_notifyIcon.Visible && !_exiting;
}