Officially support the system tray on Windows
This commit is contained in:
parent
23acbf284e
commit
af1f2ea449
24 changed files with 968 additions and 194 deletions
|
@ -49,3 +49,11 @@ export enum TitleBarVisibility {
|
|||
// This should match the "logic" in `stylesheets/_global.scss`.
|
||||
export const getTitleBarVisibility = (): TitleBarVisibility =>
|
||||
OS.isMacOS() ? TitleBarVisibility.Hidden : TitleBarVisibility.Visible;
|
||||
|
||||
/**
|
||||
* Returns `true` if you can minimize the app to the system tray. Users can override this
|
||||
* option with a command line flag, but that is not officially supported.
|
||||
*
|
||||
* We may add support for Linux in the future.
|
||||
*/
|
||||
export const isSystemTraySupported = OS.isWindows;
|
||||
|
|
2
ts/types/Storage.d.ts
vendored
2
ts/types/Storage.d.ts
vendored
|
@ -10,6 +10,7 @@ import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverabil
|
|||
import type { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode';
|
||||
import type { RetryItemType } from '../util/retryPlaceholders';
|
||||
import type { ConfigMapType as RemoteConfigType } from '../RemoteConfig';
|
||||
import { SystemTraySetting } from './SystemTraySetting';
|
||||
|
||||
import type { GroupCredentialType } from '../textsecure/WebAPI';
|
||||
import type {
|
||||
|
@ -32,6 +33,7 @@ export type StorageAccessType = {
|
|||
'call-ringtone-notification': boolean;
|
||||
'call-system-notification': boolean;
|
||||
'hide-menu-bar': boolean;
|
||||
'system-tray-setting': SystemTraySetting;
|
||||
'incoming-call-notification': boolean;
|
||||
'notification-draw-attention': boolean;
|
||||
'notification-setting': 'message' | 'name' | 'count' | 'off';
|
||||
|
|
22
ts/types/SystemTraySetting.ts
Normal file
22
ts/types/SystemTraySetting.ts
Normal 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
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue