mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make label of tray item reactive
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
17e0451e66
commit
384d39cd6c
@ -21,7 +21,7 @@ const aboutAppTrayItemInjectable = getInjectable({
|
|||||||
id: "about-app",
|
id: "about-app",
|
||||||
parentId: null,
|
parentId: null,
|
||||||
orderNumber: 140,
|
orderNumber: 140,
|
||||||
label: `About ${productName}`,
|
label: computed(() => `About ${productName}`),
|
||||||
enabled: computed(() => true),
|
enabled: computed(() => true),
|
||||||
visible: computed(() => true),
|
visible: computed(() => true),
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ const openAppTrayItemInjectable = getInjectable({
|
|||||||
return {
|
return {
|
||||||
id: "open-app",
|
id: "open-app",
|
||||||
parentId: null,
|
parentId: null,
|
||||||
label: `Open ${productName}`,
|
label: computed(() => `Open ${productName}`),
|
||||||
orderNumber: 10,
|
orderNumber: 10,
|
||||||
enabled: computed(() => true),
|
enabled: computed(() => true),
|
||||||
visible: computed(() => true),
|
visible: computed(() => true),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const openPreferencesTrayItemInjectable = getInjectable({
|
|||||||
return {
|
return {
|
||||||
id: "open-preferences",
|
id: "open-preferences",
|
||||||
parentId: null,
|
parentId: null,
|
||||||
label: "Preferences",
|
label: computed(() => "Preferences"),
|
||||||
orderNumber: 20,
|
orderNumber: 20,
|
||||||
enabled: computed(() => true),
|
enabled: computed(() => true),
|
||||||
visible: computed(() => true),
|
visible: computed(() => true),
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const quitAppSeparatorTrayItemInjectable = getInjectable({
|
|||||||
id: "quit-app-separator-tray-item",
|
id: "quit-app-separator-tray-item",
|
||||||
|
|
||||||
instantiate: () => ({
|
instantiate: () => ({
|
||||||
id: "quit-app-sepator",
|
id: "quit-app-separator",
|
||||||
parentId: null,
|
parentId: null,
|
||||||
orderNumber: 149,
|
orderNumber: 149,
|
||||||
enabled: computed(() => true),
|
enabled: computed(() => true),
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const quitAppTrayItemInjectable = getInjectable({
|
|||||||
id: "quit-app",
|
id: "quit-app",
|
||||||
parentId: null,
|
parentId: null,
|
||||||
orderNumber: 150,
|
orderNumber: 150,
|
||||||
label: "Quit App",
|
label: computed(() => "Quit App"),
|
||||||
enabled: computed(() => true),
|
enabled: computed(() => true),
|
||||||
visible: computed(() => true),
|
visible: computed(() => true),
|
||||||
separated: true,
|
separated: true,
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export interface TrayMenuItem {
|
|||||||
enabled: IComputedValue<boolean>;
|
enabled: IComputedValue<boolean>;
|
||||||
visible: IComputedValue<boolean>;
|
visible: IComputedValue<boolean>;
|
||||||
|
|
||||||
label?: string;
|
label?: IComputedValue<string>;
|
||||||
click?: () => Promise<void> | void;
|
click?: () => Promise<void> | void;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
separator?: boolean;
|
separator?: boolean;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ const toItemInjectablesFor = (extension: LensMainExtension, installationCounter:
|
|||||||
|
|
||||||
separator: registration.type === "separator",
|
separator: registration.type === "separator",
|
||||||
|
|
||||||
label: registration.label,
|
label: computed(() => registration.label),
|
||||||
tooltip: registration.toolTip,
|
tooltip: registration.toolTip,
|
||||||
|
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|||||||
@ -72,7 +72,7 @@ const toTrayMenuOptions = (trayMenuItems: TrayMenuItem[]) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: trayMenuItem.id,
|
id: trayMenuItem.id,
|
||||||
label: trayMenuItem.label,
|
label: trayMenuItem.label.get(),
|
||||||
enabled: trayMenuItem.enabled.get(),
|
enabled: trayMenuItem.enabled.get(),
|
||||||
toolTip: trayMenuItem.tooltip,
|
toolTip: trayMenuItem.tooltip,
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user