Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow opacity & layer (above/below) to be set in viewport config #58

Merged
merged 2 commits into from
Oct 28, 2023

Conversation

ringlej
Copy link
Contributor

@ringlej ringlej commented Oct 27, 2023

This PR is on top of #57

I had a request from a user who had hacked the glfw driver to make his window transparent and floating. His motivation was that it gave him a great experience using scenic_live_reload where he could see his code and the changes load automatically with the scenic window hovering over his code.

This change allows the cairo-gtk to provide the same feature in a supported way by setting the :opacity and :layer viewport config options

…config

For example, this can be used to set the window to be transparent and
always on top:

config :hello_scenic_full, :viewport,
  name: :main_viewport,
  size: {800, 600},
  theme: :dark,
  default_scene: HelloScenicFull.Scene.Primitives,
  drivers: [
    [
      module: Scenic.Driver.Local,
      name: :local,
      window: [resizeable: false, title: "hello_scenic_full"],
      on_close: :stop_system,
      opacity: 160,
      layer: 1
    ]
  ]
@ringlej
Copy link
Contributor Author

ringlej commented Oct 27, 2023

image

@crertel crertel merged commit 5aa0f02 into ScenicFramework:main Oct 28, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants