Menu

#2911 Doubled panel backgrounds

Fixed_0.12.0
closed-fixed
nobody
GUI (288)
5
2022-05-01
2015-09-08
wintertime
No

In many panels and dialogs you can see discontinuities in the paper background texture.
This is because they contain subpanels and possibly other GUI components which, by default, contain their own background using the same texture.
It is easy to fix, any such component, which is contained inside another panel or dialog needs a call to setOpaque(false) on it.
This is already done for many GUI components in FreeCol, but there are just too many to check all at once.
This would be an easy first task for a volunteer: Find one or more panels/dialogs with the background problem, add subcomponent.setOpaque(false) calls where these are created, check if it looks correctly ingame, submit patch.

Discussion

  • Bernat

    Bernat - 2015-09-09

    Can you paste two images?
    One should contain the defect and other with no defect
    I have 1 free day on friday and I will make something to return a piece of all your great work
    I haven't a big knowlage of Java but I want to help, and this is an appropiate work for me
    I been playing this game since 2006-2007 and I understand how the game works

     

    Last edit: Bernat 2015-09-09
  • wintertime

    wintertime - 2015-09-09

    Attached is an example of the problem. You can clearly see around the text in middle how the texture changes. Another occurrence is around most of the panel (except icon and send button) is another change of texture.

     

    Last edit: wintertime 2015-09-09
  • Bernat

    Bernat - 2015-09-10

    Very thank you! I can now see it exactly

    I'm going to read developer.pdf tonight to know what to do on friday

    See you

     
  • Bernat

    Bernat - 2015-09-11

    Sorry wintertime
    I tried to do what you say but I only can make disappear one of the multiple textures.
    I changed the background image for an "X" to see exactly where are the overlapped textures (see attachment)
    In the case of the Negotiation Dialog of the image (the same example you attach), remains 4 more components to set without opaque, but I don't know how
    Probably this is out of my current skill, i have to learn more before about MigLayout and background images

     
  • wintertime

    wintertime - 2015-09-12

    Thank you for trying to contribute.
    Sorry, I put the picture of the negotiation cause I remembered there you see the problem clearly, but its not the easiest dialog to fix and even a partial fix would be progress. Or you could try on some easier panel/dialog, if you still like to?

     
  • Bernat

    Bernat - 2015-09-12

    I done two functions, recursively run through the tree of objects of Trade Negotiation, and turn it to setOpaque(false).

    I done this functions because I'm lost in the code and I already don't know where each texture is assigned.

    Is it a correct workaround?

    If is not a correct solution, I would need more time...

     

    Last edit: Bernat 2015-09-12
  • wintertime

    wintertime - 2015-09-12

    The screenshot looks as if it works correctly. I would need to see the diff before I could say if the code changes are acceptable. ;)

    Oh and the texture is assigned automatically when creating GUI components. IIRC at startup the FreeColLookAndFeel is set and then Swing does its thing automatically. The problem is we want the texture for outer panels and not subpanels, so it needs to be deactivated most times a "new JPanel" or similar is done.

     

    Last edit: wintertime 2015-09-12
  • Bernat

    Bernat - 2015-09-13

    I follow this video to send commits and fork and push
    https://www.youtube.com/watch?t=192&v=Rp8f0cLmMrI

    I hope that is correct.
    I learned more in two days than in the last six months ;)

     
  • wintertime

    wintertime - 2015-09-15

    MR#36 from Bernat, which fixes this for all dialogs, is applied now (thank you!) and I added the synchronization with the AWT tree lock (please comment if it could be done better).
    Further improvements, like finding some corner case where its not working or getting it compatible with FreeColPanel, or just more testing is welcome!

     
  • Bernat

    Bernat - 2015-09-17

    I want to try the arrangement this weekend, but I can not possibly do it until next weekend
    I see the web page FreeCol is using an old Joomla template
    Are you using Joomla to create HTML content?
    Can I help us make the website?
    (I did a lot of joomla websites in the past from mambo to J! 3.1)
    I like to make components and plugins (I'm stronger than in Java with PHP;)), but what I'm trying to say is that I try to do in a renewed template (design) without much effort or add content
    (and I can do responsive if you will)
    I can make two or more templates and then talk more about that
    It's just a thought
    And if we have time we can do a multilingual site
    I like to contribute and I have worked with Joomla for years

     

    Last edit: Bernat 2015-09-18
  • wintertime

    wintertime - 2015-09-18

    Nice that you wanna do more testing.
    As for the website, thats kinda offtopic here, you should consider registering on our mailing list where this is coordinated (you can see its code in our git repo).

     
  • Bernat

    Bernat - 2015-09-19

    OK Wintertime, thanks for all !!
    I'm going to register now :)

     

    Last edit: Bernat 2015-09-19
  • Bernat

    Bernat - 2015-11-18

    Wintertime, i played a new game from 1492 since 1714 and i can't see anymore the doubled panels, con someone close the thread?

    It's enough? I can declare independence yet, I still need more time.

     
  • wintertime

    wintertime - 2015-11-18

    I kept it open, because only the FreeColDialogs are fixed, but not the FreeColPanels and everything inside them. All reports, history and other panels may still have problems.

     
    • Calebrw

      Calebrw - 2016-09-26

      I think these are mainly cleaned up, but I think I will try to take a look at these cases later this week.

       
  • Mike Pope

    Mike Pope - 2022-05-01
    • status: open --> closed-fixed
    • Group: Current --> Fixed_0.12.0
     
  • Mike Pope

    Mike Pope - 2022-05-01

    I am not seeing this any more. Closing.

     

Log in to post a comment.