Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/mRemoteNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitrij <kvarkas@gmail.com>2022-05-14 22:39:00 +0300
committerDimitrij <kvarkas@gmail.com>2022-05-14 22:39:00 +0300
commitdfb1d34b8aecff8e605ec660f6e39bc69eac5fa0 (patch)
tree61e74f9262cc8761811569ecc80c4fda88379a66
parentace62c07beae0dbc8b271aa97e2ea0ebd744f947 (diff)
cleaning redundant blocks
-rw-r--r--mRemoteNG/App/ProgramRoot.cs11
-rw-r--r--mRemoteNG/UI/Forms/FrmSplashScreenNew.xaml.cs15
-rw-r--r--mRemoteNG/UI/Forms/frmMain.Designer.cs19
-rw-r--r--mRemoteNG/UI/Forms/frmMain.cs27
4 files changed, 29 insertions, 43 deletions
diff --git a/mRemoteNG/App/ProgramRoot.cs b/mRemoteNG/App/ProgramRoot.cs
index 84c79f69..cab2cf23 100644
--- a/mRemoteNG/App/ProgramRoot.cs
+++ b/mRemoteNG/App/ProgramRoot.cs
@@ -30,6 +30,7 @@ namespace mRemoteNG.App
CatchAllUnhandledExceptions();
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
+
var frmSplashScreen = FrmSplashScreenNew.GetInstance();
Screen targetScreen = (Screen.AllScreens.Length > 1) ? Screen.AllScreens[1] : Screen.AllScreens[0];
@@ -37,18 +38,12 @@ namespace mRemoteNG.App
Rectangle viewport = targetScreen.WorkingArea;
frmSplashScreen.Top = viewport.Top;
frmSplashScreen.Left = viewport.Left;
- //mainWindow.Show();
- Screen[] screens = Screen.AllScreens;
- //if (screens.Length > 1)
- //{
// normaly it should be screens[1] however due DPI apply 1 size "same" as default with 100%
frmSplashScreen.Left = viewport.Left + (targetScreen.Bounds.Size.Width / 2) - (frmSplashScreen.Width / 2);
frmSplashScreen.Top = viewport.Top + (targetScreen.Bounds.Size.Height / 2) - (frmSplashScreen.Height / 2);
- //frmSplashScreen.Top = 50;
- //}
-
- //frmSplashScreen.Show();
+
frmSplashScreen.Show();
+
System.Windows.Forms.Application.Run(FrmMain.Default);
}
diff --git a/mRemoteNG/UI/Forms/FrmSplashScreenNew.xaml.cs b/mRemoteNG/UI/Forms/FrmSplashScreenNew.xaml.cs
index f95ba08a..4760285b 100644
--- a/mRemoteNG/UI/Forms/FrmSplashScreenNew.xaml.cs
+++ b/mRemoteNG/UI/Forms/FrmSplashScreenNew.xaml.cs
@@ -1,19 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Forms;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using System.Drawing.Text;
-using System.Drawing;
using mRemoteNG.App.Info;
namespace mRemoteNG.UI.Forms
diff --git a/mRemoteNG/UI/Forms/frmMain.Designer.cs b/mRemoteNG/UI/Forms/frmMain.Designer.cs
index df9a6553..3b6580ed 100644
--- a/mRemoteNG/UI/Forms/frmMain.Designer.cs
+++ b/mRemoteNG/UI/Forms/frmMain.Designer.cs
@@ -39,6 +39,7 @@
this.viewMenu = new mRemoteNG.UI.Menu.ViewMenu();
this.toolsMenu = new mRemoteNG.UI.Menu.ToolsMenu();
this.helpMenu = new mRemoteNG.UI.Menu.HelpMenu();
+ this.modeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mMenSep3 = new System.Windows.Forms.ToolStripSeparator();
this.tsContainer = new System.Windows.Forms.ToolStripContainer();
this._quickConnectToolStrip = new mRemoteNG.UI.Controls.QuickConnectToolStrip();
@@ -81,7 +82,7 @@
this.msMain.Location = new System.Drawing.Point(3, 0);
this.msMain.Name = "msMain";
this.msMain.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
- this.msMain.Size = new System.Drawing.Size(309, 25);
+ this.msMain.Size = new System.Drawing.Size(151, 25);
this.msMain.Stretch = false;
this.msMain.TabIndex = 0;
this.msMain.Text = "Main Toolbar";
@@ -124,6 +125,11 @@
this.helpMenu.Text = "&Help";
this.helpMenu.TextDirection = System.Windows.Forms.ToolStripTextDirection.Horizontal;
//
+ // modeToolStripMenuItem
+ //
+ this.modeToolStripMenuItem.Name = "modeToolStripMenuItem";
+ this.modeToolStripMenuItem.Size = new System.Drawing.Size(12, 25);
+ //
// mMenSep3
//
this.mMenSep3.Name = "mMenSep3";
@@ -188,6 +194,15 @@
// vsToolStripExtender
//
this.vsToolStripExtender.DefaultRenderer = null;
+ //
+ // tsModeAdmin
+ //
+ this.tsModeAdmin.Name = "tsModeAdmin";
+ this.tsModeAdmin.Size = new System.Drawing.Size(32, 19);
+ //
+ // tsModeUser
+ //
+ this.tsModeUser.Checked = true;
this.tsModeUser.CheckState = System.Windows.Forms.CheckState.Checked;
this.tsModeUser.Name = "tsModeUser";
this.tsModeUser.Size = new System.Drawing.Size(180, 22);
@@ -206,7 +221,7 @@
this.MinimumSize = new System.Drawing.Size(400, 400);
this.Name = "FrmMain";
this.Opacity = 0D;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = " ";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);
this.Load += new System.EventHandler(this.FrmMain_Load);
diff --git a/mRemoteNG/UI/Forms/frmMain.cs b/mRemoteNG/UI/Forms/frmMain.cs
index 43c10f16..4e1277d2 100644
--- a/mRemoteNG/UI/Forms/frmMain.cs
+++ b/mRemoteNG/UI/Forms/frmMain.cs
@@ -64,7 +64,14 @@ namespace mRemoteNG.UI.Forms
{
_showFullPathInTitle = Properties.OptionsAppearancePage.Default.ShowCompleteConsPathInTitle;
InitializeComponent();
- DPI_Per_Monitor.TryEnableDPIAware(this, SetUserFonts);
+ Screen targetScreen = (Screen.AllScreens.Length > 1) ? Screen.AllScreens[1] : Screen.AllScreens[0];
+
+ Rectangle viewport = targetScreen.WorkingArea;
+
+ // normaly it should be screens[1] however due DPI apply 1 size "same" as default with 100%
+ this.Left = viewport.Left + (targetScreen.Bounds.Size.Width / 2) - (this.Width / 2);
+ this.Top = viewport.Top + (targetScreen.Bounds.Size.Height / 2) - (this.Height / 2);
+
Fullscreen = new FullscreenHandler(this);
//Theming support
@@ -74,23 +81,7 @@ namespace mRemoteNG.UI.Forms
_advancedWindowMenu = new AdvancedWindowMenu(this);
}
- void SetUserFonts(float scaleFactorX, float scaleFactorY)
- {
- //this.Width = (int)Math.Ceiling(this.Width *scaleFactorX);
- //this.Height = (int)Math.Ceiling(this.Height*scaleFactorY);
- var OldFont = Font;
- Font = new Font(Font.FontFamily, 11f * scaleFactorX, Font.Style, GraphicsUnit.Pixel);
- OldFont.Dispose();
- //splitContainer1.Size = this.ClientSize; // not strictly important, but stabalize things against rounding errors...
- //checkedListBoxSaved.Height = labelAnchorSaved.Top - checkedListBoxSaved.Top; //See note on listboxes
- //checkedListBoxCurrent.Height = labelAnchorChecked.Top - checkedListBoxCurrent.Top; //See note on listboxes
- Refresh();
- }
- //protected override void DefWndProc(ref System.Windows.Forms.Message m)
- //{
- // DPI_Per_Monitor.Check_WM_DPICHANGED_WM_NCCREATE(SetUserFonts, m, this.Handle);
- // base.WndProc(ref m);
- //}
+
#region Properties
public FormWindowState PreviousWindowState { get; set; }