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

Add "Scale (fit)" background image mode #2023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PatchMixolydic
Copy link

@PatchMixolydic PatchMixolydic commented May 1, 2021

The current "Scale" mode crops out part of the image if the scaled image is larger than the terminal in any direction. This is useful for most cases, such as wallpapers repurposed as terminal backgrounds. However, this may be surprising to users coming from xfce4-terminal, where the equivalent "Scaled" mode tries to fit the background within the terminal in both dimensions. This new "Scale (fit)" mode is meant to emulate this behaviour.

I'm aware that Tilix is currently in low-maintenance mode and looking for a new maintainer, but since this mostly builds off of the "Scale" background image mode, I feel that this addition is fairly minor. Feel free to close this PR if it would carry too much of a maintenance burden.

Here are some examples of the differences between "Scale" and "Scale (fit)" using a typical background and a background well suited to "Scale (fit)":

Typical background, Scale

A terminal with a background image featuring a video game character. The image fills the terminal. The text 'Take a tea break' is visible.

A terminal with a background image featuring a video game character. The image fills the terminal. There is cut-off text reading '...ke a tea break'.

Typical background, Scale (fit)

A terminal with a background image featuring a video game character. The image fits within the terminal window, and black bars are visible to the left and right of it. The text 'Have a tea break' is visible.

A terminal with a background image featuring a video game character. The image fits within the terminal window, and black bars are visible above and below it. The text 'Have a tea break' is visible.

Transparent PNG, Scale

A terminal with an emblem in the background. The emblem fills the terminal window and is cut off. The text 'works on my machine' can be seen.

A terminal with an emblem in the background. The emblem fills the terminal window and is cut off. The text 'works on my machine' can be seen, but is cropped.

Transparent PNG, Scale (fit)

A terminal with an emblem in the background. The emblem fills the terminal window and is shown in full. The text 'works on my machine' can be seen.

A terminal with an emblem in the background. The emblem fills the terminal window and is shown in full. The text 'works on my machine' can be seen.

@ximion
Copy link
Collaborator

ximion commented Feb 22, 2022

Can you maybe clean this PR up a bit and remove all the l10n changes and other unrelated changes that are merged in? Having those makes this very hard to review at the moment.

@PatchMixolydic
Copy link
Author

Sorry about that, will do 👍

The current "Scale" mode crops out part of the image if the scaled
image is larger than the terminal in any direction. This is useful for
most cases, such as wallpapers repurposed as terminal backgrounds.
However, this may be surprising to users coming from xfce4-terminal,
where the equivalent "Scaled" mode tries to fit the background within
the terminal in both dimensions. This new "Scale (fit)" mode is meant
to emulate this behaviour.
@PatchMixolydic
Copy link
Author

PatchMixolydic commented Feb 22, 2022

I've removed the localization changes and tidied up the scaling code. Please let me know if you'd like me to make any further changes.

@ximion ximion removed the incomplete label Feb 22, 2022
Copy link

@Kryslynn93 Kryslynn93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

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.

None yet

3 participants