Open SethBarberee opened 4 years ago
First of all, selected
isn't currently implemented well. It was meant to be used with awful.keygrabber
, but I have no example.
As far as how to use action, I knew this issue would be reported sooner or later. There is a planned pull request series in the "API standardization" to address the inability of directly connecting things with the declarative syntax. It looks like this:
local my_object = gears.object {
...
gears.object.connection {
--target = other_object --defaults to parent
signal = "something",
callback = function(self, arg1, arg2)
...
end
},
gears.object.connection {
--target = other_object --defaults to parent
property = "myproperty",
callback = function(self, new_value, old_value)
...
end
},
gears.object.connection {
--target = other_object --defaults to parent
id = "some_objects_id",
callback = function(self, new_value, old_value)
... --called on all instances with this id
end
},
}
However I am not done with that PR yet. I am still trying to get the screen rules out (and that's a lot of work).
edit: and yes, I stole that directly from Qt/QML
How to reproduce the issue:
Currently trying to add buttons (actions) with the new notif rules to skip, play/pause, replay. I've added the following:
This adds the actions correctly but from here, I get a little lost. I figured that I need to implement a handler for each of the actions based on whether they are selected or not. So here's how I attempted to work on it...
Actual result:
When I click an action, I understand that the
invoked
signal is emitted but nothing else happens. I tried to listen for theproperty::selected
signal since this could tell me which action is selected but it is never emitted. This is based onnaughty/action.lua
andnaughty/list/actions.lua
Expected result:
Should the
action.selected
be toggled in theinvoke
method? I can PR but I wanted to make sure.This should hopefully allow me to just match which action was updated and spawn the correct command.