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

Add window position to SettingsManager (JSON + CLI) #136

Merged
merged 2 commits into from
Nov 15, 2018

Conversation

adielfernandez
Copy link
Contributor

SettingsManager defaults to window centered on screen if no position is set. Wanted the default setting for the block to be a centered window but felt like the position setting line should still be included, so the line is commented out in the settings.json template. Let me know if you prefer another default @benjaminbojko

src/bluecadet/core/SettingsManager.cpp Show resolved Hide resolved
@@ -16,6 +16,7 @@
"fullscreen": true,
"borderless": false,
"size": {"x": 1280, "y": 720},
//"pos": {"x": -1, "y": -1}, //Window appears centered if no position specified
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually parse successfully? I thought Cinder's JSON parser was pretty strict. Either way, I'd be a bit torn about leaving a comment in the JSON itself, since that's technically not supported in pure JSON. What do you think @adielfernandez ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it compiles and runs just fine. But I agree, it's not great practice, but I wanted to add it to start this conversation of how to let users know while keeping the default at a centered window.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I wonder if we should just set it to 0/0 by default (meaning the window would be top/left) and add a note in the readme to remove it if you want it to auto-center.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works, but I'd recommend something like 50, 50 so that the toolbar up top is on screen and people can drag the window where they need.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see... Maybe we should just leave it out then? I feel like in most cases it should just work. Even if we wanted to position a window at -1/-1, that should happen automatically if the window is centered and +2px wide/tall.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me 👍

src/bluecadet/core/SettingsManager.h Show resolved Hide resolved
@adielfernandez adielfernandez merged commit 54e53bc into develop Nov 15, 2018
@adielfernandez adielfernandez deleted the feature/clang-format branch November 15, 2018 00:04
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

Successfully merging this pull request may close these issues.

2 participants