mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
## Core Logic * **Advanced Number Parsing:** We now process numbers with various decimal and thousand-separator formats (e.g., `1,234.56` and `1.234,56`). We distinguish between separator types based on their position and surrounding digits. * **Context-Aware Output Formatting:** We now mirror the output format based on the user's input. If a query includes thousand separators, the result will also have them. The decimal separator in the result will match the one used in the query. ## Code Cleanup * **Deleted Unused File:** `NumberTranslator.cs` was unused and therefore removed. * **Removed Redundant UI Code:** The `CalculatorSettings_Loaded` event handler in `CalculatorSettings.xaml.cs` (and its XAML registration) was removed. The functionality was already handled automatically by data binding. ## Maintainability * **Added Code Documentation:** An XML summary comment was added to the new `NormalizeNumber` method in `Main.cs` to clarify its purpose. So, the plugin is now much more flexible, and will accept whatever format the user gives it regardless of Windows region settings.
23 lines
632 B
C#
23 lines
632 B
C#
using System.Windows.Controls;
|
|
using Flow.Launcher.Plugin.Calculator.ViewModels;
|
|
|
|
namespace Flow.Launcher.Plugin.Calculator.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for CalculatorSettings.xaml
|
|
/// </summary>
|
|
public partial class CalculatorSettings : UserControl
|
|
{
|
|
private readonly SettingsViewModel _viewModel;
|
|
private readonly Settings _settings;
|
|
|
|
public CalculatorSettings(SettingsViewModel viewModel)
|
|
{
|
|
_viewModel = viewModel;
|
|
_settings = viewModel.Settings;
|
|
DataContext = viewModel;
|
|
InitializeComponent();
|
|
}
|
|
}
|
|
|
|
}
|