-
Notifications
You must be signed in to change notification settings - Fork 693
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
base: main
Are you sure you want to change the base?
支持修改主页背景的不透明度 #3205
Conversation
There was a problem hiding this 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.
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?
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?
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.) |
Thanks for your reply!
Oh, now I understand. |
config 频繁写入这个问题应当在其他 PR 中给 ConfigHandle 加防抖 |
@SuppressWarnings("FieldCanBeLocal") // Strong reference | ||
private final InvalidationListener changeBackgroundListener; | ||
@SuppressWarnings("FieldCanBeLocal") | ||
private final ChangeListener<Number> changeSettingsListener; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应当使用 ReferenceHolder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我略微看了一下你的代码,感觉有点问题。之后再详细看
20240730.mp4