From 9a60432ee1122de6e4726be1742fa26fcd081ceb Mon Sep 17 00:00:00 2001 From: hu-ja-ja Date: Mon, 16 Feb 2026 21:13:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B0=B4=E5=B9=B3=E3=82=B9=E3=82=AF?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=AB=E3=83=90=E3=83=BC=E3=81=AE=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WindowController.App/MainWindow.xaml | 6 +++++- src/WindowController.App/SettingsWindow.xaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/WindowController.App/MainWindow.xaml b/src/WindowController.App/MainWindow.xaml index 5722d75..1caeea8 100644 --- a/src/WindowController.App/MainWindow.xaml +++ b/src/WindowController.App/MainWindow.xaml @@ -5,10 +5,12 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" mc:Ignorable="d" - Title="Window-Controller" Height="800" Width="1140" + Title="Window-Controller" Height="800" Width="1140" MinWidth="720" WindowStartupLocation="CenterScreen" ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica" + UseLayoutRounding="True" + SnapsToDevicePixels="True" Closing="Window_Closing"> @@ -81,6 +83,7 @@ RowHeight="32" RowStyle="{StaticResource RoundedRow}" CellStyle="{StaticResource TransparentCell}" + ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewMouseWheel="DataGrid_PreviewMouseWheel" Margin="0,0,0,10"> @@ -169,6 +172,7 @@ RowHeight="32" RowStyle="{StaticResource RoundedRow}" CellStyle="{StaticResource TransparentCell}" + ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewMouseWheel="DataGrid_PreviewMouseWheel" Margin="0,0,0,10"> diff --git a/src/WindowController.App/SettingsWindow.xaml b/src/WindowController.App/SettingsWindow.xaml index 5621a2e..a672455 100644 --- a/src/WindowController.App/SettingsWindow.xaml +++ b/src/WindowController.App/SettingsWindow.xaml @@ -6,10 +6,12 @@ xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" xmlns:local="clr-namespace:WindowController.App" mc:Ignorable="d" - Title="設定 - Window-Controller" Height="680" Width="900" + Title="設定 - Window-Controller" Height="680" Width="900" MinWidth="640" WindowStartupLocation="CenterScreen" ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica" + UseLayoutRounding="True" + SnapsToDevicePixels="True" Closing="Window_Closing" PreviewKeyDown="Window_PreviewKeyDown"> @@ -197,6 +199,7 @@ RowHeight="32" RowStyle="{StaticResource RoundedRow}" CellStyle="{StaticResource TransparentCell}" + ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="0,0,0,10"> @@ -266,6 +269,7 @@ RowHeight="32" RowStyle="{StaticResource RoundedRow}" CellStyle="{StaticResource TransparentCell}" + ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="0,0,0,10"> From 3398b9f9e10b8f53c33bcb167324aec3f4b969bc Mon Sep 17 00:00:00 2001 From: hu-ja-ja Date: Mon, 16 Feb 2026 21:22:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=83=85=E5=A0=B1=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WindowController.App/AppBuildInfo.cs | 32 ++++++++++++++ src/WindowController.App/SettingsWindow.xaml | 43 +++++++++++++++++++ .../ViewModels/SettingsViewModel.cs | 10 +++++ .../WindowController.App.csproj | 10 +++++ 4 files changed, 95 insertions(+) create mode 100644 src/WindowController.App/AppBuildInfo.cs diff --git a/src/WindowController.App/AppBuildInfo.cs b/src/WindowController.App/AppBuildInfo.cs new file mode 100644 index 0000000..59b7525 --- /dev/null +++ b/src/WindowController.App/AppBuildInfo.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace WindowController.App; + +internal static class AppBuildInfo +{ + private static Assembly Assembly => typeof(AppBuildInfo).Assembly; + + public static string InformationalVersion + => Assembly.GetCustomAttribute()?.InformationalVersion + ?? "不明"; + + public static string FileVersion + => Assembly.GetCustomAttribute()?.Version + ?? "不明"; + + public static string AssemblyVersion + => Assembly.GetName().Version?.ToString() ?? "不明"; + + public static IReadOnlyDictionary Metadata + => Assembly.GetCustomAttributes() + .Where(a => !string.IsNullOrWhiteSpace(a.Key)) + .GroupBy(a => a.Key) + .ToDictionary(g => g.Key, g => g.Last().Value ?? ""); + + public static string GetMetadata(string key, string fallback = "不明") + => Metadata.TryGetValue(key, out var value) && !string.IsNullOrWhiteSpace(value) + ? value + : fallback; +} diff --git a/src/WindowController.App/SettingsWindow.xaml b/src/WindowController.App/SettingsWindow.xaml index a672455..6363cc6 100644 --- a/src/WindowController.App/SettingsWindow.xaml +++ b/src/WindowController.App/SettingsWindow.xaml @@ -307,6 +307,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WindowController.App/ViewModels/SettingsViewModel.cs b/src/WindowController.App/ViewModels/SettingsViewModel.cs index 4095459..4737b60 100644 --- a/src/WindowController.App/ViewModels/SettingsViewModel.cs +++ b/src/WindowController.App/ViewModels/SettingsViewModel.cs @@ -7,6 +7,7 @@ using CommunityToolkit.Mvvm.Input; using Microsoft.Win32; using Serilog; +using WindowController.App; using WindowController.Core; using WindowController.Core.Models; @@ -75,6 +76,15 @@ public partial class SettingsViewModel : ObservableObject [ObservableProperty] private string _statusText = ""; + // ========== About / Build info (read-only) ========== + public string AppInformationalVersion { get; } = AppBuildInfo.InformationalVersion; + public string AppFileVersion { get; } = AppBuildInfo.FileVersion; + public string AppAssemblyVersion { get; } = AppBuildInfo.AssemblyVersion; + public string BuildTimestampUtc { get; } = AppBuildInfo.GetMetadata("BuildTimestampUtc"); + public string BuildConfiguration { get; } = AppBuildInfo.GetMetadata("BuildConfiguration"); + public string BuildTargetFramework { get; } = AppBuildInfo.GetMetadata("BuildTargetFramework"); + public string BuildRuntimeIdentifier { get; } = AppBuildInfo.GetMetadata("BuildRuntimeIdentifier", fallback: "(未指定)"); + public SettingsViewModel( ProfileStore profileStore, AppSettingsStore appSettingsStore, diff --git a/src/WindowController.App/WindowController.App.csproj b/src/WindowController.App/WindowController.App.csproj index 90f72e9..86efe83 100644 --- a/src/WindowController.App/WindowController.App.csproj +++ b/src/WindowController.App/WindowController.App.csproj @@ -24,8 +24,18 @@ false true embedded + + + $([System.DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ")) + + + + + + +