Gauge: Only show spotlight in dark themes (#114524)

* Gauge: Only show spotlight in dark themes

* Update
This commit is contained in:
Torkel Ödegaard
2025-12-05 08:48:39 +01:00
committed by GitHub
parent 88478a851e
commit c74af430a6
3 changed files with 16 additions and 12 deletions
@@ -135,7 +135,7 @@ export function RadialGauge(props: RadialGaugeProps) {
displayProcessor,
});
if (spotlight) {
if (spotlight && theme.isDark) {
defs.push(
<SpotlightGradient
key={spotlightGradientId}
@@ -1,6 +1,6 @@
import { StandardEditorProps } from '@grafana/data';
import { t } from '@grafana/i18n';
import { Stack, Switch, Label } from '@grafana/ui';
import { Stack, Switch, Label, Tooltip } from '@grafana/ui';
import { GaugePanelEffects } from './panelcfg.gen';
@@ -36,15 +36,18 @@ export function EffectsEditor(props: StandardEditorProps<GaugePanelEffects>) {
/>
<Label htmlFor="radialbar-center-glow">{t('radialbar.config.effects.center-glow', 'Center glow')}</Label>
</Stack>
<Stack>
<Switch
id="radialbar-spotlight"
label={t('radialbar.config.effects.spotlight', 'Spotlight')}
value={!!props.value?.spotlight}
onChange={(e) => props.onChange({ ...props.value, spotlight: e.currentTarget.checked })}
/>
<Label htmlFor="radialbar-spotlight">{t('radialbar.config.effects.spotlight', 'Spotlight')}</Label>
</Stack>
<Tooltip content={t('radialbar.config.effects.spotlight-tooltip', 'Only visible in dark themes')}>
<Stack>
<Switch
id="radialbar-spotlight"
label={t('radialbar.config.effects.spotlight', 'Spotlight')}
value={!!props.value?.spotlight}
onChange={(e) => props.onChange({ ...props.value, spotlight: e.currentTarget.checked })}
/>
<Label htmlFor="radialbar-spotlight">{t('radialbar.config.effects.spotlight', 'Spotlight')}</Label>
</Stack>
</Tooltip>
</Stack>
);
}
+2 -1
View File
@@ -12396,7 +12396,8 @@
"bar-glow": "Bar glow",
"center-glow": "Center glow",
"rounded-bars": "Rounded bars",
"spotlight": "Spotlight"
"spotlight": "Spotlight",
"spotlight-tooltip": "Only visible in dark themes"
},
"gradient": "Gradient",
"gradient-auto": "Auto",