Ticket #239 (closed enhancement: inactive)

Opened 8 years ago

Last modified 4 years ago

custom button sizes

Reported by: pabs Owned by: gogo
Priority: normal Milestone: 2.0
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

It would be nice to be able to create custom sized buttons and have them use the size of the images.

Attachments

custom-button-sizes.patch (0.9 kB) - added by pabs 8 years ago.
custom button size patch

Change History

Changed 8 years ago by pabs

custom button size patch

Changed 8 years ago by gogo

  • version set to trunk

pabs: I don't think that's going to work, not with the combined images system at least.

Changed 8 years ago by niko

should be closed(?)

whats the problem with fixed-sized images anyway?

Changed 8 years ago by gogo

  • milestone changed from Version 1.0 to 2.0

I think that people want to be able to have different sized images, I guess perhaps to have rectangular ones or something? Or perhaps to have bigger ones for people with poor eyesight, or smaller ones for people with superman eyesight.

I think though that this can wait. Changign the milstone.

Changed 8 years ago by pabs3@…

In my case the buttons I wanted to use were 58 x 32, 109 x 32 and 87 x 32. The patch I attached allowed me to do this with the combined images. Sorry for not following up on this quickly, bug tracking systems without an email gateway are annoying.

Changed 8 years ago by gocher

To do something you want to do, you have to set a variable for the size, then you must find all positions where the size is in use and that are more than you found. In the following function there are eight positions!

HTMLArea.makeBtnImg = function(imgDef, doc)
{
  if(!doc) doc = document;

  if(!doc._htmlareaImgCache)
  {
    doc._htmlareaImgCache = { };
  }
  
  var i_contain = doc.createElement('div');  
  i_contain.className    = 'buttonImageContainer';
  i_contain.style.position = 'relative';  
  i_contain.style.overflow = 'hidden';  
  i_contain.style.width = "18px";  
  i_contain.style.height = "18px";  
  
  var img = null;
  if(typeof imgDef == 'string')
  {
    if(doc._htmlareaImgCache[imgDef])
    {
      img = doc._htmlareaImgCache[imgDef].cloneNode();
    }
    else
    {
      img = doc.createElement("img");
      img.src = imgDef;
      img.style.width = "18px";
      img.style.height = "18px";
      if(use_clone_img)
        doc._htmlareaImgCache[imgDef] = img.cloneNode();
    }
  }
  else
  {
    if(doc._htmlareaImgCache[imgDef[0]])
    {
      img = doc._htmlareaImgCache[imgDef[0]].cloneNode();
    }
    else
    {
      img = doc.createElement("img");
      img.src = imgDef[0];
      img.style.position = 'relative';
      if(use_clone_img)
        doc._htmlareaImgCache[imgDef[0]] = img.cloneNode();
    }
    img.style.top  = imgDef[2] ? ('-' + (18 * (imgDef[2] + 1)) + 'px') : '-18px';
    img.style.left = imgDef[1] ? ('-' + (18 * (imgDef[1] + 1)) + 'px') : '-18px';
  }
  i_contain.appendChild(img);
  return i_contain;
}

Changed 4 years ago by gogo

  • status changed from new to closed
  • resolution set to inactive

Inactive, closing. Maybe this can be done with skins in this modern age?

Note: See TracTickets for help on using tickets.