mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Show local co-op icon in settings
This commit is contained in:
parent
b3697df8dc
commit
488b0dfef2
84
dist/better-xcloud.lite.user.js
vendored
84
dist/better-xcloud.lite.user.js
vendored
File diff suppressed because one or more lines are too long
84
dist/better-xcloud.user.js
vendored
84
dist/better-xcloud.user.js
vendored
File diff suppressed because one or more lines are too long
@ -190,6 +190,12 @@
|
|||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-inline-end: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
+ * {
|
+ * {
|
||||||
margin: 0 0 0 auto;
|
margin: 0 0 0 auto;
|
||||||
}
|
}
|
||||||
|
@ -1008,6 +1008,7 @@ export class SettingsDialog extends NavigationDialog {
|
|||||||
const $row = createSettingRow(label, !prefDefinition?.unsupported && $control, {
|
const $row = createSettingRow(label, !prefDefinition?.unsupported && $control, {
|
||||||
$note,
|
$note,
|
||||||
multiLines: setting.multiLines,
|
multiLines: setting.multiLines,
|
||||||
|
icon: prefDefinition?.labelIcon,
|
||||||
});
|
});
|
||||||
if (pref) {
|
if (pref) {
|
||||||
$row.htmlFor = `bx_setting_${escapeCssSelector(pref)}`;
|
$row.htmlFor = `bx_setting_${escapeCssSelector(pref)}`;
|
||||||
|
1
src/types/setting-definition.d.ts
vendored
1
src/types/setting-definition.d.ts
vendored
@ -20,6 +20,7 @@ interface BaseSettingDefinition {
|
|||||||
default: any;
|
default: any;
|
||||||
|
|
||||||
label?: string;
|
label?: string;
|
||||||
|
labelIcon?: BxIconRaw,
|
||||||
note?: string | (() => HTMLElement) | HTMLElement;
|
note?: string | (() => HTMLElement) | HTMLElement;
|
||||||
experimental?: boolean;
|
experimental?: boolean;
|
||||||
unsupported?: boolean;
|
unsupported?: boolean;
|
||||||
|
@ -54,6 +54,7 @@ export type BxButtonOptions = Partial<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
export type SettingsRowOptions = Partial<{
|
export type SettingsRowOptions = Partial<{
|
||||||
|
icon: BxIconRaw,
|
||||||
multiLines: boolean;
|
multiLines: boolean;
|
||||||
$note: HTMLElement;
|
$note: HTMLElement;
|
||||||
}>;
|
}>;
|
||||||
@ -210,6 +211,7 @@ export function createSettingRow(label: string, $control: HTMLElement | false |
|
|||||||
|
|
||||||
const $row = CE('label', { class: 'bx-settings-row' },
|
const $row = CE('label', { class: 'bx-settings-row' },
|
||||||
$label = CE('span', { class: 'bx-settings-label' },
|
$label = CE('span', { class: 'bx-settings-label' },
|
||||||
|
options.icon && createSvgIcon(options.icon),
|
||||||
label,
|
label,
|
||||||
options.$note,
|
options.$note,
|
||||||
),
|
),
|
||||||
|
@ -13,6 +13,7 @@ import { MkbMappingDefaultPresetId } from "../local-db/mkb-mapping-presets-table
|
|||||||
import { KeyboardShortcutDefaultId } from "../local-db/keyboard-shortcuts-table";
|
import { KeyboardShortcutDefaultId } from "../local-db/keyboard-shortcuts-table";
|
||||||
import { GhPagesUtils } from "../gh-pages";
|
import { GhPagesUtils } from "../gh-pages";
|
||||||
import { BxEventBus } from "../bx-event-bus";
|
import { BxEventBus } from "../bx-event-bus";
|
||||||
|
import { BxIcon } from "../bx-icon";
|
||||||
|
|
||||||
|
|
||||||
function getSupportedCodecProfiles() {
|
function getSupportedCodecProfiles() {
|
||||||
@ -338,6 +339,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
|
|||||||
[PrefKey.LOCAL_CO_OP_ENABLED]: {
|
[PrefKey.LOCAL_CO_OP_ENABLED]: {
|
||||||
requiredVariants: 'full',
|
requiredVariants: 'full',
|
||||||
label: t('enable-local-co-op-support'),
|
label: t('enable-local-co-op-support'),
|
||||||
|
labelIcon: BxIcon.LOCAL_CO_OP,
|
||||||
default: false,
|
default: false,
|
||||||
note: () => CE('div', false,
|
note: () => CE('div', false,
|
||||||
CE('a', {
|
CE('a', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user