Add options for relative positioning of window on screen#21
Open
udiboy1209 wants to merge 2 commits intoprikhi:masterfrom
udiboy1209:window-position
Open
Add options for relative positioning of window on screen#21udiboy1209 wants to merge 2 commits intoprikhi:masterfrom udiboy1209:window-position
udiboy1209 wants to merge 2 commits intoprikhi:masterfrom
udiboy1209:window-position
Conversation
Added 'window-position-x' and 'window-position-y' as double value 0.0-1.0 to allow user to move the window on the screen.
Owner
|
Cool, thanks! Will test it out soon. Have you tested to see if it properly handles configs that don't have the new options? |
Author
|
I have not tested without adding those options. How is that handled, can you show me? I will add it to the code. |
prikhi
reviewed
Mar 28, 2018
Owner
There was a problem hiding this comment.
get_double says it returns 0.0 & sets the GError when it can't find the key, so you need to pass a GError instead of null & check that error after calling the function. If it's not found or not a double, set it to 0.5.
| position_y = 0.5; | ||
| } | ||
| config->position_x = position_x; | ||
| config->position_y = position_y; |
Owner
There was a problem hiding this comment.
I think you should turn this into a function so you can just do something like:
config->position_x = get_relative_position(keyfile, "x");
config->position_y = get_relative_position(keyfile, "y");
Author
|
@prikhi I have checked with a missing "window-position-x" conf and the latest commit works. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
window-position-xandwindow-position-yas double value 0.0-1.0 to allow user to move the window on the screen.