1
0
mirror of https://github.com/chylex/Query.git synced 2025-09-17 18:24:47 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
9a280e0d58 Release 2.3.0 2025-07-08 01:06:00 +02:00
6caf8c7eb2 Fix displaying large results 2025-07-08 01:05:42 +02:00
1c92d67fa3 Fix window sometimes not appearing when using keyboard shortcut 2025-07-08 00:42:46 +02:00
3 changed files with 22 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.Numerics; using System.Numerics;
using ExtendedNumerics; using ExtendedNumerics;
@@ -72,8 +73,23 @@ public abstract record Number : IAdditionOperators<Number, Number, Number>,
} }
public override string ToString(IFormatProvider? formatProvider) { public override string ToString(IFormatProvider? formatProvider) {
Fraction fraction = Value.GetImproperFraction(); BigRational value = Fraction.ReduceToProperFraction(Value.GetImproperFraction());
return fraction.Denominator == 1 ? fraction.Numerator.ToString(formatProvider) : AsDecimal.ToString(formatProvider); string wholePartStr = value.WholePart.ToString(formatProvider);
if (value.FractionalPart.IsZero) {
return wholePartStr;
}
decimal fractionalPart = (decimal) value.FractionalPart;
if (fractionalPart == 0) {
return wholePartStr + ".0...";
}
string decimalPartStr = fractionalPart.ToString(formatProvider);
int decimalSeparatorIndex = decimalPartStr.TakeWhile(char.IsAsciiDigit).Count();
return wholePartStr + decimalPartStr[decimalSeparatorIndex..];
} }
public override int CompareTo(Number? other) { public override int CompareTo(Number? other) {

View File

@@ -8,7 +8,7 @@
<PropertyGroup> <PropertyGroup>
<Authors>chylex</Authors> <Authors>chylex</Authors>
<Version>2.2.0.0</Version> <Version>2.3.0.0</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View File

@@ -64,7 +64,7 @@ sealed partial class MainForm : System.Windows.Forms.Form {
private bool isMoving = false; private bool isMoving = false;
private void FixLocation() { private void FixLocation() {
if (!isMoving && Screen.FromControl(this) is {} screen) { if (!isMoving && WindowState != FormWindowState.Minimized && Screen.FromControl(this) is {} screen) {
Rectangle screenRect = screen.WorkingArea; Rectangle screenRect = screen.WorkingArea;
isMoving = true; isMoving = true;
Location = new Point(screenRect.X + screenRect.Width - Width, screenRect.Y + screenRect.Height - Height); Location = new Point(screenRect.X + screenRect.Width - Width, screenRect.Y + screenRect.Height - Height);
@@ -104,8 +104,10 @@ sealed partial class MainForm : System.Windows.Forms.Form {
} }
private void focusTimer_Tick(object? sender, EventArgs e) { private void focusTimer_Tick(object? sender, EventArgs e) {
WindowState = FormWindowState.Minimized;
Show(); Show();
Activate(); Activate();
WindowState = FormWindowState.Normal;
queryBox.Focus(); queryBox.Focus();
focusTimer.Stop(); focusTimer.Stop();