mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-03 06:07: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;
|
||||
flex: 1;
|
||||
|
||||
svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-inline-end: 8px;
|
||||
}
|
||||
|
||||
+ * {
|
||||
margin: 0 0 0 auto;
|
||||
}
|
||||
|
@ -1008,6 +1008,7 @@ export class SettingsDialog extends NavigationDialog {
|
||||
const $row = createSettingRow(label, !prefDefinition?.unsupported && $control, {
|
||||
$note,
|
||||
multiLines: setting.multiLines,
|
||||
icon: prefDefinition?.labelIcon,
|
||||
});
|
||||
if (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;
|
||||
|
||||
label?: string;
|
||||
labelIcon?: BxIconRaw,
|
||||
note?: string | (() => HTMLElement) | HTMLElement;
|
||||
experimental?: boolean;
|
||||
unsupported?: boolean;
|
||||
|
@ -54,6 +54,7 @@ export type BxButtonOptions = Partial<{
|
||||
}>;
|
||||
|
||||
export type SettingsRowOptions = Partial<{
|
||||
icon: BxIconRaw,
|
||||
multiLines: boolean;
|
||||
$note: HTMLElement;
|
||||
}>;
|
||||
@ -210,6 +211,7 @@ export function createSettingRow(label: string, $control: HTMLElement | false |
|
||||
|
||||
const $row = CE('label', { class: 'bx-settings-row' },
|
||||
$label = CE('span', { class: 'bx-settings-label' },
|
||||
options.icon && createSvgIcon(options.icon),
|
||||
label,
|
||||
options.$note,
|
||||
),
|
||||
|
@ -13,6 +13,7 @@ import { MkbMappingDefaultPresetId } from "../local-db/mkb-mapping-presets-table
|
||||
import { KeyboardShortcutDefaultId } from "../local-db/keyboard-shortcuts-table";
|
||||
import { GhPagesUtils } from "../gh-pages";
|
||||
import { BxEventBus } from "../bx-event-bus";
|
||||
import { BxIcon } from "../bx-icon";
|
||||
|
||||
|
||||
function getSupportedCodecProfiles() {
|
||||
@ -338,6 +339,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
|
||||
[PrefKey.LOCAL_CO_OP_ENABLED]: {
|
||||
requiredVariants: 'full',
|
||||
label: t('enable-local-co-op-support'),
|
||||
labelIcon: BxIcon.LOCAL_CO_OP,
|
||||
default: false,
|
||||
note: () => CE('div', false,
|
||||
CE('a', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user