Skip to content

Commit

Permalink
Merge pull request #44 from creewick/dev
Browse files Browse the repository at this point in the history
Release 0.6.0
  • Loading branch information
creewick authored Oct 3, 2024
2 parents d60db5f + 0d1922b commit 3ec9d09
Show file tree
Hide file tree
Showing 53 changed files with 561 additions and 341 deletions.
2 changes: 1 addition & 1 deletion src/Widgets/Calendar/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using uWidgets.Core.Models.Attributes;

[assembly: AssemblyCompany("creewick")]
[assembly: AssemblyVersion("1.0.6")]
[assembly: AssemblyVersion("1.0.7")]

[assembly: WidgetInfo(typeof(Date), null, null, "Calendar_Date_Title", "Calendar_Date_Subtitle")]
[assembly: WidgetInfo(typeof(Month), typeof(MonthCalendarModel), typeof(MonthCalendarSettings), "Calendar_Month_Title", "Calendar_Month_Subtitle")]
Expand Down
4 changes: 3 additions & 1 deletion src/Widgets/Calendar/Calendar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.2" PrivateAssets="all" ExcludeAssets="runtime"/>
<PackageReference Include="Avalonia" Version="11.1.3" PrivateAssets="all" ExcludeAssets="runtime">
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Clock/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using uWidgets.Core.Models.Attributes;

[assembly: AssemblyCompany("creewick")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyVersion("1.1.1")]

[assembly: WidgetInfo(typeof(AnalogI), typeof(ClockModel), typeof(AnalogClockSettings), "Clock_AnalogI_Title", "Clock_Analog_Subtitle")]
[assembly: WidgetInfo(typeof(AnalogII), typeof(ClockModel), typeof(AnalogClockSettings), "Clock_AnalogII_Title", "Clock_Analog_Subtitle")]
Expand Down
8 changes: 6 additions & 2 deletions src/Widgets/Clock/Clock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.2" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.11" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="Avalonia" Version="11.1.3" PrivateAssets="all" ExcludeAssets="runtime">
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.3" PrivateAssets="all" ExcludeAssets="runtime">
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="TimeZoneNames" Version="6.0.0" />
</ItemGroup>
</Project>
70 changes: 69 additions & 1 deletion src/Widgets/Clock/Locales/Locale.zh-Hans.resx
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down Expand Up @@ -62,7 +121,7 @@
<value>时钟</value>
</data>
<data name="Clock_ShowSeconds" xml:space="preserve">
<value>显示秒针</value>
<value>显示秒数</value>
</data>
<data name="Clock_Use24Hours" xml:space="preserve">
<value>使用 24 小时制</value>
Expand Down Expand Up @@ -97,4 +156,13 @@
<data name="Clock_ShowDate" xml:space="preserve">
<value>显示日期</value>
</data>
<data name="Clock_Today" xml:space="preserve">
<value>今天</value>
</data>
<data name="Clock_Yesterday" xml:space="preserve">
<value>昨天</value>
</data>
<data name="Clock_Tomorrow" xml:space="preserve">
<value>明天</value>
</data>
</root>
9 changes: 9 additions & 0 deletions src/Widgets/Clock/Locales/Locale.zh-Hant.resx
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,13 @@
<data name="Clock_ShowDate" xml:space="preserve">
<value>顯示日期</value>
</data>
<data name="Clock_Today" xml:space="preserve">
<value>今天</value>
</data>
<data name="Clock_Yesterday" xml:space="preserve">
<value>昨天</value>
</data>
<data name="Clock_Tomorrow" xml:space="preserve">
<value>明天</value>
</data>
</root>
8 changes: 6 additions & 2 deletions src/Widgets/Clock/ViewModels/AnalogClockSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ public bool Use24Hours
set => UpdateClockModel(clockModel with { Use24Hours = value });
}

public bool ShowTimeZones => clockModel.TimeZoneId != null;
public bool ShowTimeZones => !UseLocalTimeZone;

public bool UseLocalTimeZone
{
get => clockModel.TimeZoneId == null;
set => UpdateClockModel(clockModel with { TimeZoneId = value ? null : TimeZoneInfo.Local.Id });
set
{
UpdateClockModel(clockModel with { TimeZoneId = value ? null : TimeZoneInfo.Local.Id });
this.RaisePropertyChanged(nameof(ShowTimeZones));
}
}

public TimeZoneInfo TimeZone
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Monitor/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using uWidgets.Core.Models.Attributes;

[assembly: AssemblyCompany("creewick")]
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyVersion("1.1.0")]

[assembly: WidgetInfo(typeof(SingleMetric), typeof(SingleMetricModel), typeof(SingleMetricSettings), "Monitor_SingleMetric_Title", "Monitor_SingleMetric_Subtitle")]
[assembly: Locale(typeof(Locale), "Monitor", "M10 1.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5zm-5 0A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5v1A1.5 1.5 0 0 1 9.5 4h-3A1.5 1.5 0 0 1 5 2.5zm-2 0h1v1H3a1 1 0 0 0-1 1V14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3.5a1 1 0 0 0-1-1h-1v-1h1a2 2 0 0 1 2 2V14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3.5a2 2 0 0 1 2-2m6.979 3.856a.5.5 0 0 0-.968.04L7.92 10.49l-.94-3.135a.5.5 0 0 0-.895-.133L4.232 10H3.5a.5.5 0 0 0 0 1h1a.5.5 0 0 0 .416-.223l1.41-2.115 1.195 3.982a.5.5 0 0 0 .968-.04L9.58 7.51l.94 3.135A.5.5 0 0 0 11 11h1.5a.5.5 0 0 0 0-1h-1.128z")]
4 changes: 3 additions & 1 deletion src/Widgets/Monitor/Monitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.2" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="Avalonia" Version="11.1.3" PrivateAssets="all" ExcludeAssets="runtime">
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Management" Version="8.0.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/Widgets/Monitor/Services/MetricService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public static StreamGeometry GetMetricIcon(MetricType type)
{
return type switch
{
MetricType.CpuUsage => MetricIcon.CpuUsage,
MetricType.RamUsage => MetricIcon.RamUsage,
MetricType.DiskUsage => MetricIcon.DiskUsage,
MetricType.NetworkUsage => MetricIcon.NetworkUsage,
MetricType.BatteryLevel => MetricIcon.BatteryLevel,
MetricType.CpuUsage => MetricIcon.CpuUsage.Value,
MetricType.RamUsage => MetricIcon.RamUsage.Value,
MetricType.DiskUsage => MetricIcon.DiskUsage.Value,
MetricType.NetworkUsage => MetricIcon.NetworkUsage.Value,
MetricType.BatteryLevel => MetricIcon.BatteryLevel.Value,
_ => new StreamGeometry()
};
}
Expand Down
Loading

0 comments on commit 3ec9d09

Please sign in to comment.