Style ToolTip for dark theme — replace cream Win98 popup
Some checks failed
CI / build-and-test (push) Failing after 38s
Some checks failed
CI / build-and-test (push) Failing after 38s
Default WPF ToolTip is cream-on-black with a thin 3D border — looks like a Win98 popup on the dark canvas. The app has dozens of tooltips on settings controls, header pills, IN-CALL bar, and per-row toggles — every one was previously rendering as the OS default. New style: SurfaceElevated background, BorderStrong border, rounded 6px corner, monospace-friendly text wrapping at 320px so a verbose explanation doesn't stretch across the whole monitor. Implementation note: ContentPresenter doesn't accept TextBlock.TextWrapping as an attached property — used a templated TextBlock bound directly to Content instead (every tooltip in the app passes a plain string).
This commit is contained in:
parent
b56e2e12e1
commit
2ae0dc2d62
1 changed files with 42 additions and 0 deletions
|
|
@ -823,6 +823,48 @@
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<!-- ════ ToolTip ════ -->
|
||||||
|
<!--
|
||||||
|
Default WPF ToolTips render as cream-on-black with a thin border —
|
||||||
|
Win98 aesthetic. Replace with a slim dark card so the dozens of
|
||||||
|
tooltips throughout MainWindow read as part of the same UI rather
|
||||||
|
than as OS popups bolted on. Wraps long tooltip text at 320px so a
|
||||||
|
verbose explanation doesn't stretch across a whole monitor.
|
||||||
|
-->
|
||||||
|
<Style TargetType="ToolTip">
|
||||||
|
<Setter Property="Background" Value="{StaticResource Wd.SurfaceElevated}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource Wd.BorderStrong}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource Wd.Text.Primary}"/>
|
||||||
|
<Setter Property="FontFamily" Value="{StaticResource Wd.Font.Sans}"/>
|
||||||
|
<Setter Property="FontSize" Value="12"/>
|
||||||
|
<Setter Property="Padding" Value="10,6"/>
|
||||||
|
<Setter Property="HasDropShadow" Value="False"/>
|
||||||
|
<Setter Property="Placement" Value="Bottom"/>
|
||||||
|
<Setter Property="VerticalOffset" Value="6"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ToolTip">
|
||||||
|
<Border Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{StaticResource Radius.S}"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
MaxWidth="320">
|
||||||
|
<!-- Most tooltips in this app pass a plain string for
|
||||||
|
Content; bind directly to a TextBlock so we get
|
||||||
|
TextWrapping="Wrap" and respect the parent's
|
||||||
|
MaxWidth. ContentPresenter wouldn't honor
|
||||||
|
TextBlock.TextWrapping (not an attached prop). -->
|
||||||
|
<TextBlock Text="{TemplateBinding Content}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Foreground="{TemplateBinding Foreground}"/>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<!-- ════ ContextMenu (right-click) ════ -->
|
<!-- ════ ContextMenu (right-click) ════ -->
|
||||||
<!--
|
<!--
|
||||||
WPF's default ContextMenu renders white-on-grey with a 3D border —
|
WPF's default ContextMenu renders white-on-grey with a 3D border —
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue