From 8b582092312813b0d698c55750914f487618fe5c Mon Sep 17 00:00:00 2001 From: Soul-Remix Date: Sat, 6 Apr 2024 13:50:25 +0300 Subject: [PATCH] Fix button borders showing as "?" on windows --- NetWarden.Tui/Views/ErrorView.Designer.cs | 1 + NetWarden.Tui/Views/MainView.Designer.cs | 10 ++++++++++ NetWarden.Tui/Views/SelectDeviceVew.Designer.cs | 4 +++- NetWarden.Tui/Views/SelectDeviceVew.cs | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NetWarden.Tui/Views/ErrorView.Designer.cs b/NetWarden.Tui/Views/ErrorView.Designer.cs index 4c5a562..9d4105a 100644 --- a/NetWarden.Tui/Views/ErrorView.Designer.cs +++ b/NetWarden.Tui/Views/ErrorView.Designer.cs @@ -82,6 +82,7 @@ private void InitializeComponent() this.exitBtn.Text = "Quit"; this.exitBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.exitBtn.IsDefault = false; + this.exitBtn.NoDecorations = true; this.Add(this.exitBtn); } } diff --git a/NetWarden.Tui/Views/MainView.Designer.cs b/NetWarden.Tui/Views/MainView.Designer.cs index 5c58603..7f2276d 100644 --- a/NetWarden.Tui/Views/MainView.Designer.cs +++ b/NetWarden.Tui/Views/MainView.Designer.cs @@ -118,6 +118,7 @@ private void InitializeComponent() this.setNameBtn.Text = "Ok"; this.setNameBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.setNameBtn.IsDefault = true; + this.setNameBtn.NoDecorations = true; this.updateNameView.Add(this.setNameBtn); this.cancelSetNameBtn.AutoSize = false; this.cancelSetNameBtn.Width = 10; @@ -129,6 +130,7 @@ private void InitializeComponent() this.cancelSetNameBtn.Text = "Cancel"; this.cancelSetNameBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.cancelSetNameBtn.IsDefault = false; + this.cancelSetNameBtn.NoDecorations = true; this.updateNameView.Add(this.cancelSetNameBtn); this.lineView.AutoSize = false; this.lineView.Width = Dim.Fill(0); @@ -151,6 +153,7 @@ private void InitializeComponent() this.updateInterfaceBtn.Text = "Select Interface"; this.updateInterfaceBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.updateInterfaceBtn.IsDefault = false; + this.updateInterfaceBtn.NoDecorations = true; this.Add(this.updateInterfaceBtn); this.refreshBtn.AutoSize = false; this.refreshBtn.Width = 11; @@ -162,6 +165,7 @@ private void InitializeComponent() this.refreshBtn.Text = "Refresh"; this.refreshBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.refreshBtn.IsDefault = false; + this.refreshBtn.NoDecorations = true; this.Add(this.refreshBtn); this.killAllBtn.AutoSize = false; this.killAllBtn.Width = 11; @@ -173,6 +177,7 @@ private void InitializeComponent() this.killAllBtn.Text = "Cut All"; this.killAllBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.killAllBtn.IsDefault = false; + this.killAllBtn.NoDecorations = true; this.Add(this.killAllBtn); this.unKillAllBtn.AutoSize = false; this.unKillAllBtn.Width = 15; @@ -184,6 +189,7 @@ private void InitializeComponent() this.unKillAllBtn.Text = "Restore All"; this.unKillAllBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.unKillAllBtn.IsDefault = false; + this.unKillAllBtn.NoDecorations = true; this.Add(this.unKillAllBtn); this.killBtn.AutoSize = false; this.killBtn.Width = 7; @@ -195,6 +201,7 @@ private void InitializeComponent() this.killBtn.Text = "Cut"; this.killBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.killBtn.IsDefault = false; + this.killBtn.NoDecorations = true; this.Add(this.killBtn); this.unKillBtn.AutoSize = false; this.unKillBtn.Width = 11; @@ -206,6 +213,7 @@ private void InitializeComponent() this.unKillBtn.Text = "Restore"; this.unKillBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.unKillBtn.IsDefault = false; + this.unKillBtn.NoDecorations = true; this.Add(this.unKillBtn); this.openNameViewBtn.AutoSize = false; this.openNameViewBtn.Width = 15; @@ -217,6 +225,7 @@ private void InitializeComponent() this.openNameViewBtn.Text = "Update Name"; this.openNameViewBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.openNameViewBtn.IsDefault = false; + this.openNameViewBtn.NoDecorations = true; this.Add(this.openNameViewBtn); this.exitBtn.AutoSize = false; this.exitBtn.Width = 8; @@ -228,6 +237,7 @@ private void InitializeComponent() this.exitBtn.Text = "Quit"; this.exitBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.exitBtn.IsDefault = false; + this.exitBtn.NoDecorations = true; this.Add(this.exitBtn); } } diff --git a/NetWarden.Tui/Views/SelectDeviceVew.Designer.cs b/NetWarden.Tui/Views/SelectDeviceVew.Designer.cs index c1712e8..bcedc8f 100644 --- a/NetWarden.Tui/Views/SelectDeviceVew.Designer.cs +++ b/NetWarden.Tui/Views/SelectDeviceVew.Designer.cs @@ -65,7 +65,8 @@ private void InitializeComponent() this.selectBtn.Data = "selectBtn"; this.selectBtn.Text = "Select"; this.selectBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; - this.selectBtn.IsDefault = false; + this.selectBtn.IsDefault = true; + this.selectBtn.NoDecorations = true; this.Add(this.selectBtn); this.exitBtn.AutoSize = false; this.exitBtn.Width = 8; @@ -77,6 +78,7 @@ private void InitializeComponent() this.exitBtn.Text = "Quit"; this.exitBtn.TextAlignment = Terminal.Gui.TextAlignment.Centered; this.exitBtn.IsDefault = false; + this.exitBtn.NoDecorations = true; this.Add(this.exitBtn); } } diff --git a/NetWarden.Tui/Views/SelectDeviceVew.cs b/NetWarden.Tui/Views/SelectDeviceVew.cs index 8f29d84..ed0e957 100644 --- a/NetWarden.Tui/Views/SelectDeviceVew.cs +++ b/NetWarden.Tui/Views/SelectDeviceVew.cs @@ -52,7 +52,7 @@ private DataTable GetTableData() } } - dt.Rows.Add(device.Name, device.MacAddress?.GetFormattedAddress(), ipv4, ipv6); + dt.Rows.Add(device.Interface.FriendlyName, device.MacAddress?.GetFormattedAddress(), ipv4, ipv6); } return dt;