bling icon indicating copy to clipboard operation
bling copied to clipboard

Refactor task widget

Open Kasper24 opened this issue 3 years ago • 3 comments

  • Converted the global show signal into proper methods, show/toggle/hide
  • No enable function, calling bling.widget.task_widget will return an object with the above methods
  • Added the abillity to position the widget differently each time that it is showed. This with the change listed below allows it to align to the currently hovered task widget instead of having a static positon.
  • Added the option to provide a wibox, widget and offset arguements to the show method, allowing to the align the task preview to another widget (possibly the hovered task widget). This is done by the following code:
task_preview:show(client, {wibox = awful.screen.focused().wibar, widget = task_widget, offset = { y = 100}})

Minor changes:

  • Removed the _fn from the placement arguement to keep it consistent with other awesome wiboxes
  • Removed the 'widget' prefix from the arguement provided to the object.

Those 2 aren't that important and can be undone though.

Kasper24 avatar Dec 06 '21 00:12 Kasper24

User Feedback: easy to configure, works like a charm with custom widgets (i have wrapped the tasklist multiple times in containers + using a widget_template for the icons, position can still be accuratly found, awesome!) :+1:

https://user-images.githubusercontent.com/2059141/144948685-cc31a172-5526-4885-a0fc-e34aa6ef55d7.mp4

nawuko avatar Dec 07 '21 01:12 nawuko

@Kasper24 Looks good! I still have no Linux machine (laptop will come in a few days), so once I get it I'll test your PR and give it the thumbs up. Or, we can have @Nooo37 test it as well and merge.

javacafe01 avatar Jan 05 '22 21:01 javacafe01

@Kasper24 Works fine for me, just needs docs.

javacafe01 avatar Jan 08 '22 05:01 javacafe01

Merged into #99

javacafe01 avatar Nov 22 '22 05:11 javacafe01