Closed kupiqu closed 4 years ago
Good idea, I can add it as option.
And we need a name for this option, but I am not good at speaking English. So do you know any good name for this option?
This is how it is done in Window Buttons (https://github.com/psifidotos/applet-window-buttons)
You don't need so many options though. You can choose what you think applies best to panon. With a plus if you could replicate the nice Window Buttons "Slice Out Animation" :)
Like this?
Show: Always visible
Only when audio playing
Sure
On a second thought, I think it would be more informative if:
No audio signal: Preserve space
Hide
Because it's not really about showing (there is nothing to show anyways), it's about the space that the applet occupies.
I found it is hard to resize the plasmoid in runtime. Code below can extend the width to 400 when audio is available, but cannot reduce it to 0 when there is no audio signal. Don't know what did I miss comparing to https://github.com/psifidotos/applet-window-buttons.
Item{
Layout.minimumWidth: show_spect? 400:0
Layout.preferredWidth: Layout.minimumWidth
Layout.maximumWidth: Layout.minimumWidth
visible:false // And visible property don't work
I would suggest taking a look to this functionality in applet-window-buttons:
https://github.com/psifidotos/applet-window-buttons/blob/master/package/contents/ui/main.qml
EDIT: Sorry, I read the email and missed that you were having window-buttons as a reference already
EDIT: Not sure qml needs whitespaces or not: perhaps you need a whitespace before ?
in your code above, and/or around :
in 400:0
I think I find the problem now. It comes from this
Layout.fillWidth: showMain ? true:false
This fillWidth
property is not honored in Latte-Dock, after the property is changed by showMain
. If this line is replaced by
Layout.fillWidth: false
it works, but then we lose the fillWidth
option.
ShowMainChanged Event neither helps tell Latte-Dock not to fill width.
onShowMainChanged:{
root.Layout.fillWidth=showMain? true:false
}
Mmm, I see, that's unfortunate. If there's no easy workaround to this, why not letting the users decide between the two options? Could this be done?
I actually set a fixed size (I prefer panon to be minimalistic and there's plenty of things in my latte panel already) so I would very much like panon not to occupy space if empty.
Could this be done?
No problem
Now we can hide the applet when no audio is available. b0509dba81851abd9ecdbad737d85701fe421e54
But there is still a trivia problem. ConfigGeneral.qml
could not reload the value of autoHide
every time you open the configuration window in Latte-Dock
, while in plasmoidviewer
it could. Weird to me.
edit: Oh, and I forgot to make an option for the slide out animation. Is it necessary?
edit: A workaround is to replace the RadioButton
with a CheckBox
or a ComboBox
. I will leave the "RadioButton" version here in issue5 branch, and merge the "CheckBox" version into master branch.
Sorry, I accidentally closed this issue, it was not intended. I don't know how to remove that wrong commit from github.
It works great, thank you!
OK, then I will release a new version.
I wish the widget would not occupy any space when there is no audio signal, so no empty space in the bar when there is no spectrum to show