ConsoleGuiTools icon indicating copy to clipboard operation
ConsoleGuiTools copied to clipboard

Out-GridView should remember window position

Open tig opened this issue 4 years ago • 8 comments

I find it super annoying to have to resize it on my wide monitor. The default size it uses is crazy wide.

tig avatar Apr 19 '20 21:04 tig

Is this the original out-grid view? If so, that needs to go in the PowerShell/PowerShell repo (and there might be an existing issue)

TylerLeonhardt avatar Apr 19 '20 23:04 TylerLeonhardt

I'm an idiot. Yes, I was running the old one. I just assumed import-module of the .dll that ocgv was in would have ogv in it too. I never ran it with -verbose so just assumed...

Much better default size. I still think it should remember size/position.

tig avatar Apr 19 '20 23:04 tig

Should we close this then since it's about the old ogv?

TylerLeonhardt avatar Apr 20 '20 00:04 TylerLeonhardt

No, because I changed the title to be more specific to a valid feature request (that the new one doesn't save / restore it's window pos).

tig avatar Apr 20 '20 00:04 tig

Is it possible on Unix? On Windows Registry is used to remember Windows size and position.

iSazonov avatar Apr 21 '20 10:04 iSazonov

You just need somewhere to store one each of:

public enum FormWindowState
{
    //
    // Summary:
    //     A default sized window.
    Normal = 0,
    //
    // Summary:
    //     A minimized window.
    Minimized = 1,
    //
    // Summary:
    //     A maximized window.
    Maximized = 2
}

Point

Size

You do not need to use the registry. .NET Core provides a SettingsService that abstracts away where stuff is stored.

tig avatar Apr 21 '20 13:04 tig

Can you point SettingsService API?

iSazonov avatar Apr 21 '20 14:04 iSazonov

https://docs.microsoft.com/en-us/dotnet/api/system.configuration.applicationsettingsbase?view=netcore-3.1

This should get you started. Sorry I mis-remembered the name...

tig avatar Apr 21 '20 15:04 tig

@andschwa This should be closed as won't fix since it's for the Avalona version.

tig avatar Aug 24 '22 12:08 tig