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

Window background image #612

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Vulcalien
Copy link
Member

@Vulcalien Vulcalien commented Jun 21, 2022

Sharing the progress on this issue: #608

So far, these are the changes I've made:

  1. add config settings window_background_type and window_background_image
  2. draw a global background image on the window
  3. when Terminator.reconfigure is called, also apply config to the windows

The feature 3. was added with the first commit. I don't see any reason for the windows not to apply the config without restarting. This makes it so that the global background image changes without restart, but also all the other settings (fullscreen, always on top...).

Still not ready to merge. Missing features:

  1. the preferences menu should have a way to set the global background image
  2. settings to choose how the image fills the window/terminal (stretch, scale keeping ratio... (?))

Introduced bugs:

  1. When a notebook loses focus, the window background becomes a solid color. Doesn't matter if it was transparent or an image.

Also, are the names window_background_type and window_background_image ok?

@Vulcalien
Copy link
Member Author

Here is a config file to help display what this PR does. Also useful for testing.
Change the paths for settings window_background_image and background_image to whatever image.

config.txt

@mattrose
Copy link
Member

If you can solve the introduced bug with the notebook losing focus, that would be huge. I stumbled across this when trying to implement overpaint dimming and I eventually had to pull the code because of it. Thanks so much for all you're doing.

@Vulcalien Vulcalien added the help wanted Extra attention is needed label Sep 14, 2022
Added these settings:
  - 'window_background_image_mode'
  - 'window_background_image_align_horiz'
  - 'window_background_image_align_vert'
@Vulcalien
Copy link
Member Author

I updated the Window.background_draw function to match the newer and improved version in Terminal. That version, introduced in #713, increased control over how the terminal's background image is drawn. The same now applies to the window's background image.
This implements one of the missing features listed above (2. settings to choose how the image fills...).

The function has practically been copy-pasted from Terminal, so it is a significant code duplication issue. Eventually, if this feature ever gets finished, that should be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants