Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Nov 18, 2024
1 parent fd8c366 commit ec8c074
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 25 deletions.
5 changes: 3 additions & 2 deletions JL.Windows/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using JL.Windows.GUI;
using JL.Windows.Utilities;
using Microsoft.Data.Sqlite;
using Rectangle = System.Drawing.Rectangle;

namespace JL.Windows;

Expand Down Expand Up @@ -925,7 +926,7 @@ public void LoadPreferenceWindow(PreferencesWindow preferenceWindow)
preferenceWindow.PopupFontComboBox.SelectedIndex = 0;
}

System.Drawing.Rectangle bounds = WindowsUtils.ActiveScreen.Bounds;
Rectangle bounds = WindowsUtils.ActiveScreen.Bounds;
preferenceWindow.PopupMaxHeightNumericUpDown.Maximum = bounds.Height;
preferenceWindow.PopupMaxWidthNumericUpDown.Maximum = bounds.Width;

Expand Down Expand Up @@ -1440,7 +1441,7 @@ public void SaveBeforeClosing()
: mainWindow.MinWidth;
ConfigDBManager.UpdateSetting(connection, nameof(MainWindowWidth), mainWindowWidth.ToString(CultureInfo.InvariantCulture));

System.Drawing.Rectangle bounds = WindowsUtils.ActiveScreen.Bounds;
Rectangle bounds = WindowsUtils.ActiveScreen.Bounds;
DpiScale dpi = WindowsUtils.Dpi;
double mainWindowTopPosition = mainWindow.Top >= SystemParameters.VirtualScreenTop
? mainWindow.Top + mainWindow.Height <= SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight
Expand Down
1 change: 0 additions & 1 deletion JL.Windows/GUI/AddDictionaryWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using JL.Core.Utilities;
using JL.Windows.GUI.UserControls;
using Microsoft.Win32;
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
using Path = System.IO.Path;

namespace JL.Windows.GUI;
Expand Down
7 changes: 1 addition & 6 deletions JL.Windows/GUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
Expand All @@ -19,12 +18,8 @@
using JL.Windows.Utilities;
using Microsoft.Data.Sqlite;
using Microsoft.Win32;
using Clipboard = System.Windows.Clipboard;
using Cursors = System.Windows.Input.Cursors;
using DpiChangedEventArgs = System.Windows.DpiChangedEventArgs;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
using Rectangle = System.Drawing.Rectangle;
using Screen = System.Windows.Forms.Screen;

namespace JL.Windows.GUI;

Expand Down
3 changes: 0 additions & 3 deletions JL.Windows/GUI/ManageDictionariesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
using JL.Core.Dicts;
using JL.Core.Utilities;
using JL.Windows.Utilities;
using Button = System.Windows.Controls.Button;
using CheckBox = System.Windows.Controls.CheckBox;
using Cursors = System.Windows.Input.Cursors;

namespace JL.Windows.GUI;

Expand Down
3 changes: 0 additions & 3 deletions JL.Windows/GUI/PreferencesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
using JL.Core.Utilities;
using JL.Windows.Utilities;
using Microsoft.Data.Sqlite;
using Button = System.Windows.Controls.Button;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using TextBox = System.Windows.Controls.TextBox;

namespace JL.Windows.GUI;

Expand Down
3 changes: 2 additions & 1 deletion JL.Windows/GUI/ReadingSelectionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Windows.Input;
using System.Windows.Interop;
using JL.Windows.Utilities;
using Rectangle = System.Drawing.Rectangle;

namespace JL.Windows.GUI;

Expand Down Expand Up @@ -83,7 +84,7 @@ private void UpdatePosition(Point cursorPosition)
double dpiAwareXOffSet = 5 * dpi.DpiScaleX;
double dpiAwareYOffset = 15 * dpi.DpiScaleY;

System.Drawing.Rectangle bounds = WindowsUtils.ActiveScreen.Bounds;
Rectangle bounds = WindowsUtils.ActiveScreen.Bounds;
bool needsFlipX = mouseX + currentWidth > bounds.Right;
bool needsFlipY = mouseY + currentHeight > bounds.Bottom;

Expand Down
11 changes: 2 additions & 9 deletions JL.Windows/Utilities/WindowsUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
using System.Web;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using HandyControl.Controls;
using HandyControl.Data;
using HandyControl.Tools;
using JL.Core.Audio;
Expand All @@ -26,13 +24,8 @@
using JL.Windows.SpeechSynthesis;
using NAudio.Vorbis;
using NAudio.Wave;
using Application = System.Windows.Application;
using Button = System.Windows.Controls.Button;
using Clipboard = System.Windows.Clipboard;
using FlowDirection = System.Windows.FlowDirection;
using PopupWindow = JL.Windows.GUI.PopupWindow;
using TextBox = System.Windows.Controls.TextBox;
using Window = System.Windows.Window;
using ColorPicker = HandyControl.Controls.ColorPicker;
using Screen = System.Windows.Forms.Screen;

namespace JL.Windows.Utilities;

Expand Down

0 comments on commit ec8c074

Please sign in to comment.