Officially support the system tray on Windows

This commit is contained in:
Evan Hahn
2021-06-29 12:18:03 -05:00
committed by GitHub
parent 23acbf284e
commit af1f2ea449
24 changed files with 968 additions and 194 deletions

View File

@@ -0,0 +1,22 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { makeEnumParser } from '../util/enum';
// Be careful when changing these values, as they are persisted.
export enum SystemTraySetting {
DoNotUseSystemTray = 'DoNotUseSystemTray',
MinimizeToSystemTray = 'MinimizeToSystemTray',
MinimizeToAndStartInSystemTray = 'MinimizeToAndStartInSystemTray',
}
export const shouldMinimizeToSystemTray = (
setting: SystemTraySetting
): boolean =>
setting === SystemTraySetting.MinimizeToSystemTray ||
setting === SystemTraySetting.MinimizeToAndStartInSystemTray;
export const parseSystemTraySetting = makeEnumParser(
SystemTraySetting,
SystemTraySetting.DoNotUseSystemTray
);