#69 Image for buttons

Nifty_1.4
open
nobody
5
2012-08-28
2012-01-17
Anonymous
No

Hi,

This is an addition to the Button control. It adds a possibility to add an image.
It currently supports text Over, Above or Below he image. Left/Right still have to be implemented. Layout can be changed at runtime.

Currently, with above or below layouts, the elements (image/text) are vertically constrained top or bottom, which make them
appear at the very edge of the button, with a possible empty space in the middle if the image is wider than taller.
This could be avoided by using more panels to layout the elements and/or calulating the whole layout in the controller and/or allowing changing childLayout add runtime. I don't know which option would be the best.

I added an example to nifty-examples, although it was more useful for testing than it might be to users.
Buttons without images still work correctly.

The patches are against recent git master branch.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-01-17

    nifty-controls patch

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-01-17

    Nifty-example patch: http://pastebin.com/DSrGRYB2
    (I don't know how to add a second file)

     
    Last edit: Anonymous 2014-05-23

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks