Skip to content

Commit

Permalink
[feat] 历史天气适配亮色主题
Browse files Browse the repository at this point in the history
  • Loading branch information
zxbmmmmmmmmm committed Jun 15, 2024
1 parent 9b42c18 commit fe0822f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
21 changes: 11 additions & 10 deletions FluentWeather.Uwp/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -870,18 +870,19 @@
<dv:RadLinearGauge.LabelTemplate>
<DataTemplate />
</dv:RadLinearGauge.LabelTemplate>
<!--历史最高/最低温 指示条-->
<dv:SegmentedLinearGaugeIndicator Value="{x:Bind ViewModel.HistoricalWeather.HistoricalMaxTemperature}">
<dv:BarIndicatorSegment
Length="{x:Bind converters1:ConverterMethods.Subtract(ViewModel.HistoricalWeather.AverageMinTemperature, ViewModel.HistoricalWeather.HistoricalMinTemperature)}"
Stroke="#1AB3B3B3"
Stroke="{ThemeResource HistoricalWeatherBaseRangeStroke}"
Thickness="4" />
<dv:BarIndicatorSegment
Length="{x:Bind converters1:ConverterMethods.Subtract(ViewModel.HistoricalWeather.AverageMaxTemperature, ViewModel.HistoricalWeather.AverageMinTemperature)}"
Stroke="#80B3B3B3"
Stroke="{ThemeResource HistoricalWeatherAverageRangeStroke}"
Thickness="4" />
<dv:BarIndicatorSegment
Length="{x:Bind converters1:ConverterMethods.Subtract(ViewModel.HistoricalWeather.HistoricalMaxTemperature, ViewModel.HistoricalWeather.AverageMaxTemperature)}"
Stroke="#1AB3B3B3"
Stroke="{ThemeResource HistoricalWeatherBaseRangeStroke}"
Thickness="4" />
</dv:SegmentedLinearGaugeIndicator>
<!-- 平均低温 -->
Expand All @@ -902,7 +903,7 @@
Width="8"
Height="8"
HorizontalAlignment="Center"
Fill="#FFCCCCCC" />
Fill="{ThemeResource HistoricalWeatherAveragePointFill}" />
</StackPanel>
</dv:MarkerGaugeIndicator.Content>
</dv:MarkerGaugeIndicator>
Expand All @@ -926,7 +927,7 @@
Width="8"
Height="8"
HorizontalAlignment="Center"
Fill="#FFCCCCCC" />
Fill="{ThemeResource HistoricalWeatherAveragePointFill}" />
</StackPanel>
</dv:MarkerGaugeIndicator.Content>
</dv:MarkerGaugeIndicator>
Expand Down Expand Up @@ -955,7 +956,7 @@
Width="8"
Height="8"
HorizontalAlignment="Center"
Fill="#FF666666" />
Fill="{ThemeResource HistoricalWeatherHighestLowestPointFill}" />
</StackPanel>
</dv:MarkerGaugeIndicator.Content>
</dv:MarkerGaugeIndicator>
Expand Down Expand Up @@ -983,7 +984,7 @@
Width="8"
Height="8"
HorizontalAlignment="Center"
Fill="#FF666666" />
Fill="{ThemeResource HistoricalWeatherHighestLowestPointFill}" />
</StackPanel>
</dv:MarkerGaugeIndicator.Content>
</dv:MarkerGaugeIndicator>
Expand All @@ -999,7 +1000,7 @@

<dv:BarIndicatorSegment
Length="{x:Bind converters1:ConverterMethods.Subtract(ViewModel.WeatherToday.MaxTemperature, ViewModel.WeatherToday.MinTemperature)}"
Stroke="#66808080"
Stroke="{ThemeResource HistoricalWeatherTodayRangeStroke}"
Thickness="4" />
<dv:BarIndicatorSegment
Length="{x:Bind converters1:ConverterMethods.Subtract(ViewModel.HistoricalWeather.HistoricalMaxTemperature, ViewModel.WeatherToday.MaxTemperature)}"
Expand All @@ -1018,7 +1019,7 @@
Width="8"
Height="8"
HorizontalAlignment="Center"
Fill="#FF808080" />
Fill="{ThemeResource HistoricalWeatherTodayPointFill}" />
<TextBlock
Margin="2,0,0,0"
HorizontalAlignment="Center"
Expand All @@ -1045,7 +1046,7 @@
Width="8"
Height="8"
HorizontalAlignment="Center"
Fill="#FF808080" />
Fill="{ThemeResource HistoricalWeatherTodayPointFill}" />
<TextBlock
Margin="2,0,0,0"
HorizontalAlignment="Center"
Expand Down
13 changes: 12 additions & 1 deletion FluentWeather.Uwp/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
<StaticResource x:Key="ContentDialogSeparatorBorderBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<StaticResource x:Key="AutoSuggestBoxBorderBrush" ResourceKey="TextControlBorderBrush" />
<StaticResource x:Key="InfoBarInformationalSeverityBackgroundBrush" ResourceKey="SystemControlAcrylicElementBrush" />

<SolidColorBrush x:Key="HistoricalWeatherAverageRangeStroke" Color="#66666666"/>
<SolidColorBrush x:Key="HistoricalWeatherBaseRangeStroke" Color="#4D999999"/>
<SolidColorBrush x:Key="HistoricalWeatherTodayRangeStroke" Color="#45808080"/>
<SolidColorBrush x:Key="HistoricalWeatherHighestLowestPointFill" Color="#FFBABABA"/>
<SolidColorBrush x:Key="HistoricalWeatherAveragePointFill" Color="#FF8C8C8C"/>
<SolidColorBrush x:Key="HistoricalWeatherTodayPointFill" Color="#FFAEAEAE"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<StaticResource x:Key="NavigationViewContentBackground" ResourceKey="LayerFillColorDefaultBrush" />
Expand All @@ -29,6 +34,12 @@
<StaticResource x:Key="ContentDialogSeparatorBorderBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<StaticResource x:Key="AutoSuggestBoxBorderBrush" ResourceKey="TextControlBorderBrush" />
<StaticResource x:Key="InfoBarInformationalSeverityBackgroundBrush" ResourceKey="SystemControlAcrylicElementBrush" />
<SolidColorBrush x:Key="HistoricalWeatherAverageRangeStroke" Color="#80B3B3B3"/>
<SolidColorBrush x:Key="HistoricalWeatherBaseRangeStroke" Color="#21BFBFBF"/>
<SolidColorBrush x:Key="HistoricalWeatherTodayRangeStroke" Color="#66808080"/>
<SolidColorBrush x:Key="HistoricalWeatherHighestLowestPointFill" Color="#FF666666"/>
<SolidColorBrush x:Key="HistoricalWeatherAveragePointFill" Color="#FFCCCCCC"/>
<SolidColorBrush x:Key="HistoricalWeatherTodayPointFill" Color="#FF808080"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

Expand Down
2 changes: 2 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=C:\Users\zxbmm\Pictures\a3way-cs6qn-001.ico,0

0 comments on commit fe0822f

Please sign in to comment.