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

🚧 [Mouse Jump] Customisable appearance - borders, margins, colours, etc #29292

Closed

Conversation

mikeclayton
Copy link
Contributor

@mikeclayton mikeclayton commented Oct 18, 2023

Summary of the Pull Request

Adds some settings to control the display style of the popup preview form - see #27511

image

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@mikeclayton
Copy link
Contributor Author

@jaimecbernardo - just started looking at this again.

I've got a question.. is there a pre-existing pattern for upgrading the format of config files? The existing config for Mouse Jump looks like this:

{
  "name": "MouseJump",
  "version": "1.0",
  "properties": {
    "DefaultActivationShortcut": { ... },
    "activation_shortcut": { ... },
    "thumbnail_size": {
      "width": 1600,
      "height": 1200
    }
  }
}

but I'm copy over a raft of additional style settings from FancyMouse to allow customising the borders, colours and layout:

{
  "name": "MouseJump",
  "version": "2.0",
  "properties": {
    "DefaultActivationShortcut": { ... },
    "activation_shortcut": { ... },
    "preview_style": {
      "name": "default",
      "size": {
        "width": 1600, <---- existing thumbnail_size.width setting
        "height": 1200 <---- existing thumbnail_size.height setting
      },
      "canvas": {
        "border": {
          "color": "SystemColors.Highlight",
          "width": 6,
          "depth": 0
        },
        "padding": {
          "width": 6
        },
        "background": {
          "color1": "#0D57D2",
          "color2": "#0344C0"
        }
      },
      "screenshot": {
        "margin": {
          "width": 2
        },
        "border": {
          "color": "#222222",
          "width": 10,
          "depth": 3
        },
        "background": {
          "color1": "Color.MidnightBlue",
          "color2": "Color.MidnightBlue"
        }
      }
    }
  }
}

I guess the ideal scenario is that it migrates the existing "thumbnail_size" settings to the new location if they already exist in the settings.json, but I'm not sure what the best way is to go about doing that. Do you know if any modules do this already that I could copy?

I've got a way of doing it in FancyMouse (see https://github.com/mikeclayton/FancyMouse/tree/main/src/FancyMouse/Models/Settings) which basically keeps a domain model of each config format and maps it to the latest internal representation when the settings.json loads - I can mirror that, but if there's already a way to do it I'll keep to the same pattern...

@jaimecbernardo
Copy link
Collaborator

Hi @mikeclayton , search the code for "UpgradeSettingsConfiguration". Some of the modules implement it already, like FindMyMouse, Mouse Highlighter and Mouse Without Borders.

@jaimecbernardo
Copy link
Collaborator

Thanks for working on this 😉

This comment has been minimized.

@htcfreek
Copy link
Collaborator

Any updates? When does this get ready.

@htcfreek htcfreek added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Mar 4, 2024
@mikeclayton
Copy link
Contributor Author

@htcfreek - sorry about the extended radio silence on this PR - I kind of got bogged down in trying to work out how to handle the config upgrade and probably tyring to be too clever with applying defaults to partially missing values in the nested json.

It all ground to a bit of a halt and I've not had a chance to pick it up again since. Happy if you want to close this PR for the time being as I'm not sure when I'll be able to work on it next...

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 25, 2024
@mikeclayton
Copy link
Contributor Author

I'm going to close this PR as I've hit a bit of a dead-end with it - I'll raise a new one with a different approach...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Team-Response An issue author responded so the team needs to follow up Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams
Projects
Development

Successfully merging this pull request may close these issues.

3 participants