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

Slider window position #7

Closed
Narrat opened this issue Apr 30, 2016 · 12 comments
Closed

Slider window position #7

Narrat opened this issue Apr 30, 2016 · 12 comments
Labels

Comments

@Narrat
Copy link
Contributor

Narrat commented Apr 30, 2016

Hi.
Any chance the slider popup will open in the direction with the most place available?
Currently it is placed under the icon which is kinda hindering when panels are placed on the bottom of the screen.

@buzz buzz added the bug label Apr 30, 2016
@buzz
Copy link
Owner

buzz commented Apr 30, 2016

Yes, absolutely. The program should detect that I guess.
Do you bother to create a pull request?

@Narrat
Copy link
Contributor Author

Narrat commented Apr 30, 2016

I'm currently looking at the tray.py to find out if I can help with it

@buzz
Copy link
Owner

buzz commented Apr 30, 2016

The placing is happening here:
https://github.com/buzz/volctl/blob/master/volctl/tray.py#L207

The question is how to decide if the sliders should show above or below the icon. You could query the screen dimensions and if the icon is in the top half of the screen sliders go below otherwise above.

This way the most common cases (top/bottom panels) would be covered, right?

@buzz buzz closed this as completed Apr 30, 2016
@buzz buzz reopened this Apr 30, 2016
@Narrat
Copy link
Contributor Author

Narrat commented Apr 30, 2016

At least the top/bottom panel users would be happy. Dunno about those, that place panels at the left or right.
Left would be less of an issue as with right placement, as the slider windows is appended to the right?

@buzz
Copy link
Owner

buzz commented Apr 30, 2016

Yeah, they are probably more cases. Think of right-to-left script like Arabic.

But top/bottom panels would be awesome already ;)

@Narrat
Copy link
Contributor Author

Narrat commented May 1, 2016

Didn't work that much with PyGI before. Is there a simple way to define in which direction the popup will open or can the size of the whole thing be calculated nicely?
Currently stuck at that point.
Hardcoded position values won't do it, as the size depends on font settings, gtk theme and so on (which is the next issue on the list :D If enough pa applications open, the slider menu will expand beyond the screen)

Narrat added a commit to Narrat/volctl that referenced this issue May 1, 2016
This currently covers just top or bottom panels.
Previously the slider popup were placed under the tray icon which didn't work with panels on the bottom. This closes buzz#7
@Narrat
Copy link
Contributor Author

Narrat commented May 1, 2016

Current WIP Narrat@709b146

Will take a look at the doc later. This magic value needs to vanish :D

Narrat added a commit to Narrat/volctl that referenced this issue May 1, 2016
This currently covers just top or bottom panels.
Previously the slider popup were placed under the tray icon which didn't work with panels on the bottom.

This closes buzz#7
Narrat added a commit to Narrat/volctl that referenced this issue May 1, 2016
This currently covers just top or bottom panels.
Previously the slider popup were placed under the tray icon which didn't work with panels on the bottom.

This closes buzz#7
@Narrat
Copy link
Contributor Author

Narrat commented May 1, 2016

Cannot use get_size for the window, because it will return a default value as the window isn't visible. So it's reporting back 200x200 which is way to much for a correction.

Actual height for me is 165px. Your screen shows 155px.
If I don't hardcode the value I can "calculate" a value of 172px. Still hardcoded value in there (guess of icon size (16px)). Acceptable for me but not for everyone else :D

@buzz
Copy link
Owner

buzz commented May 3, 2016

You are right: The window height is only available after calling window.show().

Could you test this, please?
https://github.com/buzz/volctl/tree/issue_7

@Narrat
Copy link
Contributor Author

Narrat commented May 3, 2016

the issue_7 branch works for me :)

@ScuttleSE
Copy link

Reopening this.
I'm on a three monitor setup, and the slider-popups opens up almost in the middle of my middle monitor instead of on top of the tray icon, which is also on the middle screen.

My guess is that the program gets the resolution of my left or right monitor and uses that for the positioning instead of the middle one.

@buzz
Copy link
Owner

buzz commented Aug 11, 2019

Reopening this.
I'm on a three monitor setup, and the slider-popups opens up almost in the middle of my middle monitor instead of on top of the tray icon, which is also on the middle screen.

My guess is that the program gets the resolution of my left or right monitor and uses that for the positioning instead of the middle one.

Opened #22 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants