Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Always on top" should be persisted across restart #45

Closed
Yopai opened this issue Oct 27, 2023 · 2 comments
Closed

"Always on top" should be persisted across restart #45

Yopai opened this issue Oct 27, 2023 · 2 comments

Comments

@Yopai
Copy link
Contributor

Yopai commented Oct 27, 2023

  • put a widget on the desktop
  • toggle it as "Always on Top"
  • disconnect from your session
  • reconnect
  • reopen WinWidgets

Result : the widget is not "Always on top" anymore.

What should be observed :

Like the position is, the "Always on top" status should be stored, and restored when the application is reopened.

I'll try to get some time to create a PR for this. As I'm not a .Net expert, any help about where the modification should be in the code would be appreciated.

@beyluta
Copy link
Owner

beyluta commented Oct 27, 2023

Shouldn't be that hard. You can save the state for every opened widget in the config file and write it back when opening the widgets. The base for this feature already exists, you only need to implement the logic to set the "always on top" property.

Take a look inside Asset.Service.cs inside the /Services folder. The following function can be used to overwrite the configuration file with new content.

/// <summary>
/// Overwrites the configuration file with new content
/// </summary>
/// <param name="content">Configuration object to be overwritten</param>
static public void OverwriteConfigurationFile(Configuration configuration)

Yopai added a commit to Yopai/WinWidgets that referenced this issue Oct 28, 2023
Yopai added a commit to Yopai/WinWidgets that referenced this issue Oct 28, 2023
Yopai added a commit to Yopai/WinWidgets that referenced this issue Oct 28, 2023
Yopai added a commit to Yopai/WinWidgets that referenced this issue Oct 28, 2023
beyluta added a commit that referenced this issue Oct 28, 2023
#45 : persist "always on top" state across restart
@beyluta
Copy link
Owner

beyluta commented Oct 28, 2023

PR has been merged into development. I will create the installer for x64 machines and release a new version in the alpha 1.3.1 release page a little later today.

@beyluta beyluta closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants