[Patch] Lock windows

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

Moderator: Committer

Message
Author
Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

[Patch] Lock windows

#1 Post by Eloque »

This allows to Lock the message window.
Require pin.png and pinned.png to be in /default/data/art/icons/buttons

Disccussion: viewtopic.php?f=6&t=8951
Attachments

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

pinned.png
pinned.png (1.87 KiB) Viewed 2012 times
pin.png
pin.png (1.94 KiB) Viewed 2012 times
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

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

Re: [Patch] Lock windows

#2 Post by Geoff the Medio »

If you're posting "art" (as debatable as it may be in this case), you should also note that you release it under the CC-BY-SA 3.0 license.

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: [Patch] Lock windows

#3 Post by Eloque »

Will do, I'll put the in my signature as well.
For the record: All art and artwork is under CC-BY-SA 3.0 license.
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

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

Re: [Patch] Lock windows

#4 Post by Geoff the Medio »

Generally seems OK.

Putting the button into CUIWnd but then only implementing the behaviour in MessageWnd is odd, though.

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: [Patch] Lock windows

#5 Post by Eloque »

I've changed that now. It's implemented in CuiWnd.
Attachments

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

Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

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

Re: [Patch] Lock windows

#6 Post by Geoff the Medio »

Please remove all tabs and replace with 4 spaces.

If resizing is disabled while pinned, the mouseover highlight of the resize tab at the bottom right should be disabled.

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: [Patch] Lock windows

#7 Post by Eloque »

Tabs removed.
Window now has m_resizable set to false when the window is pinned.
Attachments

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

Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

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

Re: [Patch] Lock windows

#8 Post by Geoff the Medio »

Committed the button icons and CUIWnd changes.

Can you provide another patch that makes as many UI windows as is reasonable pinnable?

Sitrep, Messages, Empires, Objects, FleetWnd, Pedia (on map and subscreens), various windows on the design, research, and production screens?

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: [Patch] Lock windows

#9 Post by Eloque »

Will do. Was about to ask what windows those should be, but I'll do the list you suggested first.
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

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

Re: [Patch] Lock windows

#10 Post by vincele »

Geoff the Medio wrote:Committed the button icons and CUIWnd changes.
Hello the committed patch makes my compiler warn about member initialization order:

Code: Select all

In file included from /home/vince/repo/upstream/freeorion/FreeOrion/UI/CUIWnd.cpp:3:0:
/home/vince/repo/upstream/freeorion/FreeOrion/UI/CUIWnd.h: In constructor ‘CUIWnd::CUIWnd(const string&, GG::X, GG::Y, GG::X, GG::Y, GG::Flags<GG::WndFlag>)’:
/home/vince/repo/upstream/freeorion/FreeOrion/UI/CUIWnd.h:151:27: warning: ‘CUIWnd::m_minimize_button’ will be initialized after [-Wreorder]
     CUI_MinRestoreButton*   m_minimize_button;  //!< the minimize/restore button
                           ^
/home/vince/repo/upstream/freeorion/FreeOrion/UI/CUIWnd.h:142:10: warning:   ‘bool CUIWnd::m_pinable’ [-Wreorder]
     bool                    m_pinable;        //!< true if the window is able to be pinned
          ^
/home/vince/repo/upstream/freeorion/FreeOrion/UI/CUIWnd.cpp:136:1: warning:   when initialized here [-Wreorder]
 CUIWnd::CUIWnd(const std::string& t, GG::X x, GG::Y y, GG::X w, GG::Y h, GG::Flags<GG::WndFlag> flags) :
 
The following patch fixes that, if we care...

[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: [Patch] Lock windows

#11 Post by Geoff the Medio »

vincele wrote:...warn about member initialization order...
Hopefully fixed...

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: [Patch] Lock windows

#12 Post by Eloque »

I've added pinning to a few windows that were pretty straightforward, working on Pedia now.

Message
ModeratorActions
ObjectList
PlayerList
SitRep
Attachments

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

Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

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

Re: [Patch] Lock windows

#13 Post by Geoff the Medio »

Committed.

Can you also add mouseover responses to the pin button? (Like how the close button responds to having the mouse cursor over it)

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

Re: [Patch] Lock windows

#14 Post by MatGB »

Is this going into 0.4.4 or just into Trunk for 0.4.4+ Because it looks like a nice little feature to have.
Mat Bowles

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

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: [Patch] Lock windows

#15 Post by Eloque »

I made the mouseover work. The code was already there for X button.

I needed to add additional images, I had to tweak the originals for contrast however, so the pin.png and pinned.png files should be replaced as well.
Attachments
buttons.zip
(6.88 KiB) Downloaded 110 times

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

Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.

Post Reply