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

支持修改主页背景的不透明度 #3205

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

TunYuntuwuQWQ
Copy link

20240730.mp4

Copy link
Contributor

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

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

Four comments.


When select a background type and then move the opacity slider to 0, the background may have a residual image.

Entering 0 in the right input box will not appear. It has a chance of happening, but it will not happen every time. This seems to happen when the pulling frequency is relatively high. I am not sure if it is a code implementation issue or a software framework issue, just mentioning it.

Preview


Every time I pull the opacity slider, if the range is large, a lot of stuff appears in the log. Is it possible to optimize this, such as saving the configuration after the pull stops?


Translucent types are not affected by the opacity setting below. That being the case, is it possible to hide the opacity setting when selecting a translucency type?

Preview


If the content of the right input box is empty, or contains illegal characters, there seems to be no special mechanism to intervene. Is it possible to follow the behavior of other HMCL input boxes and intervene on empty/illegal characters?

Preview

@TunYuntuwuQWQ
Copy link
Author

TunYuntuwuQWQ commented Jul 30, 2024

Four comments.

When select a background type and then move the opacity slider to 0, the background may have a residual image.

Entering 0 in the right input box will not appear. It has a chance of happening, but it will not happen every time. This seems to happen when the pulling frequency is relatively high. I am not sure if it is a code implementation issue or a software framework issue, just mentioning it.

Preview
Every time I pull the opacity slider, if the range is large, a lot of stuff appears in the log. Is it possible to optimize this, such as saving the configuration after the pull stops?

Translucent types are not affected by the opacity setting below. That being the case, is it possible to hide the opacity setting when selecting a translucency type?

Preview
If the content of the right input box is empty, or contains illegal characters, there seems to be no special mechanism to intervene. Is it possible to follow the behavior of other HMCL input boxes and intervene on empty/illegal characters?

Preview

Regarding comments 1, 3, and 4:

I have submitted new content, and these three suggestions should already be completed or resolved.

Regarding comment 2:

The frequent logs occur because of the constant writing to the configuration file. Each time the slider value changes, this value is first written to the configuration file. The image processing and background updates will read the values from the configuration file to make corresponding updates. If you choose 'saving the configuration after the pull stops' the background will not update as the slider moves. Almost all sliders in HMCL are implemented in this way and contain the issue you mentioned. Considering that the impact of this issue is not significant, I have chosen to follow the existing design pattern.

(Using translation software.)

@3gf8jv4dv
Copy link
Contributor

3gf8jv4dv commented Jul 30, 2024

Thanks for your reply!

The frequent logs occur because of the constant writing to the configuration file. Each time the slider value changes, this value is first written to the configuration file. The image processing and background updates will read the values from the configuration file to make corresponding updates. If you choose 'saving the configuration after the pull stops' the background will not update as the slider moves. Almost all sliders in HMCL are implemented in this way and contain the issue you mentioned. Considering that the impact of this issue is not significant, I have chosen to follow the existing design pattern.

Oh, now I understand.

@burningtnt
Copy link
Member

config 频繁写入这个问题应当在其他 PR 中给 ConfigHandle 加防抖

@SuppressWarnings("FieldCanBeLocal") // Strong reference
private final InvalidationListener changeBackgroundListener;
@SuppressWarnings("FieldCanBeLocal")
private final ChangeListener<Number> changeSettingsListener;
Copy link
Member

Choose a reason for hiding this comment

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

应当使用 ReferenceHolder

Copy link
Member

Choose a reason for hiding this comment

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

我略微看了一下你的代码,感觉有点问题。之后再详细看

@Glavo Glavo changed the title 支持修改主页背景的不透明度 Support for modifying the opacity of the background 支持修改主页背景的不透明度 Oct 6, 2024
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.

3 participants