MapWnd save/restore popup visibility consistently

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

MapWnd save/restore popup visibility consistently

#1 Post by vincele »

I was puzzled by the fact that some popups visibility was not restored when toggling on and off for production, research and design windows. Is that intentional ?

The attached patch makes the behaviour consistent in the 3 cases : hide all popups upon showing the fullscreen window, and show all that were opened on close.

[The extension diff has been deactivated and can no longer be displayed.]

All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: MapWnd save/restore popup visibility consistently

#2 Post by Geoff the Medio »

None of the SitRepPanel, ObjectListWnd, or SidePanel are derived from MapWndPopup, so hiding popups doesn't hide them.

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: MapWnd save/restore popup visibility consistently

#3 Post by vincele »

OK I understand why the patch is wrong, but what about the rationale for it :
When I toggle research (or production, or design) on then off, the objects and sitrep panels get closed (or hidden) without my consent, whereas the empires and messages stay opened, that's the inconsistency I was trying to fix, is it intentional ?

And what about the hunk that added showallpopups() to hidedesign(), was that forgotten or as designed ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: MapWnd save/restore popup visibility consistently

#4 Post by MatGB »

Up until very recently, empire and messages stayed open all the time and there was no toggle for them, whereas sitrep and objects had a toggle since the beginning.

I would love it if sitrep stayed open when you go into a different window, but if that were to happen I think you'd also need a 'home' or 'top' option within the panel.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: MapWnd save/restore popup visibility consistently

#5 Post by Geoff the Medio »

vincele wrote:When I toggle research (or production, or design) on then off, the objects and sitrep panels get closed (or hidden) without my consent, whereas the empires and messages stay opened, that's the inconsistency I was trying to fix, is it intentional ?
I think the purpose of HideAppPopups and ShowAllPopups was to accomplish what you want, but most of the "popup" windows are't derived from MapWndPopup, so don't work with this feature.
And what about the hunk that added showallpopups() to hidedesign(), was that forgotten or as designed ?
Presumably it's OK... Should work the same as any other full screen window (research, sort of production)...

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: MapWnd save/restore popup visibility consistently

#6 Post by vincele »

Geoff the Medio wrote:
vincele wrote:When I toggle research (or production, or design) on then off, the objects and sitrep panels get closed (or hidden) without my consent, whereas the empires and messages stay opened, that's the inconsistency I was trying to fix, is it intentional ?
I think the purpose of HideAppPopups and ShowAllPopups was to accomplish what you want, but most of the "popup" windows aren't derived from MapWndPopup, so don't work with this feature.
Would that be the best route for action ? I can give this a try...
And what about the hunk that added showallpopups() to hidedesign(), was that forgotten or as designed ?
Presumably it's OK... Should work the same as any other full screen window (research, sort of production)...
Do you want me to resend just this hunk separated, or you do it yourself ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: MapWnd save/restore popup visibility consistently

#7 Post by vincele »

MatGB wrote:Up until very recently, empire and messages stayed open all the time and there was no toggle for them, whereas sitrep and objects had a toggle since the beginning.
Yes, I think I remember this being different in the past.

BTW, what people think of the 2 others in this row-of-toggle-buttons that are not quite toggles: the menu and the graphs/pedia buttons. I would like them to all behave in the same way: on-off toggles. Would that be OK ?
MatGB wrote:I would love it if sitrep stayed open when you go into a different window, but if that were to happen I think you'd also need a 'home' or 'top' option within the panel.
A side effect of my patch is that sitrep (and object) stay opened (or closed) when you get back from design, prod or research. The patch did it the wrong way, but the result is what I wanted, and I find it pleasant not to need to reopen them myself.

I don't understand your top or home options, care to elaborate a bit ?

Thanks
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: MapWnd save/restore popup visibility consistently

#8 Post by MatGB »

Within sitrep, you can have a very long list, and sometimes an important thing happens near the bottom and it prompts you to go do something in production or similar.

Your fix means when you come out of production you're still at the bottom of the long list. That's very good except...

Scrolling back up again can be annoying, I have for a long time without really thinking about it simply opened and closed prodwnd to get to the top of the sitrep list again.

Does opening/closing sitrep itself take you back to the top? (basically, I'm a big fan of the keyboard 'home' button, so much so I've remapped my CAPSLOCK to be a home button, which is slightly annoying scripting but...)
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: MapWnd save/restore popup visibility consistently

#9 Post by Geoff the Medio »

MatGB wrote:Does opening/closing sitrep itself take you back to the top?
After a few seconds of testing, yes. That's actually the sort of thing I'd have made a point of trying to prevent from happening, had I thought about it and been so inclined.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: MapWnd save/restore popup visibility consistently

#10 Post by Dilvish »

Geoff the Medio wrote:
MatGB wrote:Does opening/closing sitrep itself take you back to the top?
After a few seconds of testing, yes. That's actually the sort of thing I'd have made a point of trying to prevent from happening, had I thought about it and been so inclined.
My inclination, too, would be for opening and closing to NOT reset the scroll to the top. If I swap over to the production window or something and come back, I'm much more likely to want to continue reviewing from where I was, not have to rescroll back to that point. That's much more common for me that wanting to quickly get back to the top (except at the start of a new turn, and presumably that would always reset scroll to the top, I suppose any change of which turns info is presented should do that).

In order to accommodate a fast zoom to top or bottom I suppose our scrollbars (or probably a subclass) could have a little zoom button area at the top and bottom for going immediately to that end.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: MapWnd save/restore popup visibility consistently

#11 Post by MatGB »

To be clear, I want it to stay where it is if I go in/out of prodwind, but I have the (bad) habit of doing that to get back to the top, when I should just toggle sitrep on/off (don't ask me where it came from, no clue, pointless).

What I want is for it to, normally, stay where it is on open/close or to go somewhere else and come back, but it also needs an easy top/bottom link, the scrollbar button idea would be fine, as would top/bottom next to back/next/last buttons, I care not as long as it's there.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: MapWnd save/restore popup visibility consistently

#12 Post by Geoff the Medio »

Is dragging the scrollbar to the top particularly difficult for this list? It seems odd to need a special button just in this case... (or at all, really... scrollbars work?)

User avatar
vincele
Space Dragon
Posts: 341
Joined: Sun Mar 23, 2014 6:10 pm

Re: MapWnd save/restore popup visibility consistently

#13 Post by vincele »

Geoff the Medio wrote:Is dragging the scrollbar to the top particularly difficult for this list? It seems odd to need a special button just in this case... (or at all, really... scrollbars work?)
Maybe a key mapping <HOME> and <END> key presses would be good or even enough, but I'm coming with a lot of CLI background.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: MapWnd save/restore popup visibility consistently

#14 Post by Geoff the Medio »

vincele wrote:Maybe a key mapping <HOME> and <END> key presses...
Trouble with that is that it would only work for the current focus window, but there's not much indication in the UI what window has focus, except in cases like an edit control where there's a blinking caret.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: MapWnd save/restore popup visibility consistently

#15 Post by Dilvish »

Geoff the Medio wrote:Is dragging the scrollbar to the top particularly difficult for this list? It seems odd to need a special button just in this case... (or at all, really... scrollbars work?)
Dragging scrollbars across significant portions of a large document is something that I have seen strain an underpowered system to the point of near inoperability. That said, I think that other things in FO would likely break before the Sitrep window ever reached such size, so I expect you are right that such buttons for the sitrep window are probably unneeded. Just to check, Matt, do you ever observe any real problems with dragging the sitrep scrollbar; is there a particular reason you dislike dragging it to the top?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply