obs-web icon indicating copy to clipboard operation
obs-web copied to clipboard

Program view doesn't have dark background

Open nospam2k opened this issue 1 year ago • 2 comments

In ProgramPreview.svelte:

<div class="columns is-centered is-vcentered has-text-centered">
  {#if isStudioMode}
    <div class="column">
      <img bind:this={preview} class="has-background-dark" alt="Preview" />
    </div>
    <div class="column is-narrow">
      {#each transitions as transition}
      <button class="button is-fullwidth is-info" style="margin-bottom: .5rem;"
        on:click={async () => {
          await sendCommand('SetCurrentSceneTransition', { transitionName: transition.transitionName })
          await sendCommand('TriggerStudioModeTransition')
        }}
        >{transition.transitionName}</button>
      {/each}
    </div>
  {/if}
  <div class="column">
    <!-- ****** This should have class="has-background-dark" like Preview ****** -->
    <!-- Ex.  <img bind:this={program} class="has-background-dark" alt="Program" /> -->
    <img bind:this={program} alt="Program"/>
  </div>
</div>

Changing the line to include has-background-dark doesn't work because:

  async function getScreenshot () {
    if (!programScene) return
    let data = await sendCommand('GetSourceScreenshot', {
      sourceName: programScene,
      imageFormat,
      imageWidth: 960,
      imageHeight: 540
    })
    if (data && data.imageData && program) {
      program.src = data.imageData
      program.className = '' // **** Is this valid??? ****
    }

    if (isStudioMode) {
      if (previewScene !== programScene) {
        data = await sendCommand('GetSourceScreenshot', {
          sourceName: previewScene,
          imageFormat,
          imageWidth: 960,
          imageHeight: 540
        })
      }
      if (data && data.imageData && preview) {
        preview.src = data.imageData
      }
    }
  }

nospam2k avatar Sep 25 '24 18:09 nospam2k

Hey, @nospam2k Can I do this under hacktoberfest ?

KanavCode avatar Oct 06 '25 04:10 KanavCode

@KanavCode - Not sure what you mean.

nospam2k avatar Oct 06 '25 04:10 nospam2k