SwarmUI icon indicating copy to clipboard operation
SwarmUI copied to clipboard

Outline currently selected image

Open CreativeAlloy opened this issue 6 months ago • 0 comments

This new logic adds an outline to the currently selected image, whether from the image history or the current image batch.

More specifically, I have modified three files with the following code:

  • genpage.css, which now contains style code for .image-block-selected, the outline using var --emphasis' color code to ensure that it's consistent with the current loaded theme.
  • currentimagehandler.js, which now contains logic within function clickImageInBatch(div) that, upon clicking any image, removes the outline from any previously selected image, and adds the latest clicked image to the classList instead. Furthermore, some additional logic uses the existing "curImg.dataset.batch_id = 'history';" code to make an if(){} check, where if the batchId is NOT history, the selector will be removed from the image history as well.
  • imagehistory.js, with similar logic to remove and add images into the classList.

There's also a few line breaks removed before some "else"s, which I left as they were. I can easily go back and reinsert the line breaks if desired.

Attached example images to showcase what this looks like with the default dark theme.

image image

CreativeAlloy avatar May 14 '25 01:05 CreativeAlloy