Wetterdienst: Hover Bugfix
This commit is contained in:
@@ -783,8 +783,16 @@ public partial class WeekCellItem : ObservableObject
|
||||
[ObservableProperty] private string _weatherTooltip = "";
|
||||
[ObservableProperty] private bool _hasWeatherWarning;
|
||||
public bool HasWeather => WeatherSymbol.Length > 0;
|
||||
public bool HasWeatherInformation => HasWeather || HasWeatherWarning;
|
||||
|
||||
partial void OnWeatherSymbolChanged(string value) => OnPropertyChanged(nameof(HasWeather));
|
||||
partial void OnWeatherSymbolChanged(string value)
|
||||
{
|
||||
OnPropertyChanged(nameof(HasWeather));
|
||||
OnPropertyChanged(nameof(HasWeatherInformation));
|
||||
}
|
||||
|
||||
partial void OnHasWeatherWarningChanged(bool value) =>
|
||||
OnPropertyChanged(nameof(HasWeatherInformation));
|
||||
|
||||
public void SetWeather(SchoolDayWeatherSummary? summary, IReadOnlyList<WeatherWarning> warnings)
|
||||
{
|
||||
|
||||
@@ -195,11 +195,19 @@
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4">
|
||||
<TextBlock Text="{Binding Text}" FontWeight="SemiBold" FontSize="12" Opacity="0.75"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding WeatherSymbol}" FontSize="16" VerticalAlignment="Center"
|
||||
IsVisible="{Binding HasWeather}" ToolTip.Tip="{Binding WeatherTooltip}"/>
|
||||
<TextBlock Text="⚠" FontSize="12" Foreground="#D85A30" FontWeight="Bold"
|
||||
VerticalAlignment="Center" IsVisible="{Binding HasWeatherWarning}"
|
||||
ToolTip.Tip="{Binding WeatherTooltip}"/>
|
||||
<!-- TextBlock-Trefferflächen sind bei Emoji-Fallback-Schriften teils nur wenige
|
||||
Pixel groß. Der transparente Border bietet eine verlässliche Hover-Fläche. -->
|
||||
<Border Background="Transparent" CornerRadius="4" Padding="4,2"
|
||||
IsVisible="{Binding HasWeatherInformation}"
|
||||
ToolTip.Tip="{Binding WeatherTooltip}" ToolTip.ShowDelay="200">
|
||||
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||
<TextBlock Text="{Binding WeatherSymbol}" FontSize="16" VerticalAlignment="Center"
|
||||
IsVisible="{Binding HasWeather}" IsHitTestVisible="False"/>
|
||||
<TextBlock Text="⚠" FontSize="12" Foreground="#D85A30" FontWeight="Bold"
|
||||
VerticalAlignment="Center" IsVisible="{Binding HasWeatherWarning}"
|
||||
IsHitTestVisible="False"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||||
|
||||
Reference in New Issue
Block a user