Commit Graph

352 Commits

Author SHA1 Message Date
Uli Schlachter 661a8a7b38 Some more minor fixes, make "strict" happy
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 16:27:38 +02:00
Uli Schlachter c271ed7b13 tasklist: Use a fixed layout
We need a fixed layout here to make tag names like "media" work. Without this,
every take would get the same space, no matter how long its name is.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 15:48:50 +02:00
Uli Schlachter b55dc20319 awful.widget.textclock: Port to new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:30:45 +02:00
Uli Schlachter 0cb3569e3e awful.widget.layoutbox: Port to new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:30:00 +02:00
Uli Schlachter 3b9150f05a awful.widget.button: Port to new widget layout
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:28:43 +02:00
Uli Schlachter 1b134b2361 lua.widget.prompt: Port to new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:27:16 +02:00
Uli Schlachter bf23ebdf46 graph,progressbar: Port to new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:25:59 +02:00
Uli Schlachter 97ed5e70b8 {task,tag}list: Port to new widget system
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 14:23:36 +02:00
Uli Schlachter c8b93cec76 progressbar: Remove gradients
gears.color can do the same in better and they are currently broken anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 19:26:23 +02:00
Uli Schlachter d8dce35269 progressbar: Port to oocairo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 19:24:36 +02:00
Uli Schlachter 048064b8ef graph: Remove gradients
They can and should now be done via gears.color instead. It was porting ever
since this was ported to oocairo anyway...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 19:02:03 +02:00
Uli Schlachter 6375ce4175 graph: Port to oocairo
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 18:57:52 +02:00
Uli Schlachter fce09d4d42 tasklist: Remove unused local variables
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 16:18:21 +02:00
Uli Schlachter 40aa974ac2 taglist: Use oocairo instead of image
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 16:17:03 +02:00
Uli Schlachter 523661760a Layoutbox: Use oocairo instead of image
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 16:10:01 +02:00
Uli Schlachter 4279c879b3 awful.widget.button: Use oocairo instead of image
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-29 15:57:10 +02:00
Uli Schlachter 49b4573bc8 awful.widget: Stop using named colors
Those were removed a while ago already.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-18 12:27:09 +02:00
Uli Schlachter 71b15d292c Fix a "table expected instead of nil" error
It seems like with lots of bad luck, the garbage collector manages to "steal"
the table with the buttons right after we decided to use it. Evil collector!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 19:02:15 +02:00
Uli Schlachter 89f05c90ca {tag,task}list: Use a weak-valued table
The data table is used to map objects (clients/tags) to the buttons associated
with them. This is done so that we don't have to re-create the button objects
each time this lists are updated.

The problem was that this weak-keyed table was never cleared, because the value
had a strong reference to the key (via the button's signal):

btn:connect_signal("press", function () b:emit_signal("press", o) end)

"o" is the key in the table and btn is reachable from the value. This prevented
the garbage collection of the key. Using a weak-keyed and weak-valued table
fixes this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-16 17:28:50 +02:00
Uli Schlachter 1ce0b7915b Use signal emitions on classes
Since 3fbb5f1535 "luaobject: emit signals on class too" when a signal
is emitted on some object, it will also be emitted on the class. This means that
we don't have to connect our signals via the "new" signal anymore, but can
instead connect to the signal on the class.

(Of course, the signal on the class gets as first argument the object on which
the signal was emitted)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 18:31:06 +02:00
Julien Danjou 6d332f07a0 lua{class,object}: rename signals functions
I knew this was wrong at the beginning, f*ck.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Uli Schlachter ac2ff7f7a7 prompt: Only show error messages
Ever since awesome.spawn() also returns the pid of the started process, the
prompt accidentally displayed the pid of processes that it started.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-09 14:24:58 +02:00
Konstantin Stepanov 842dfc3064 stack graph mode works with max_value
Signed-off-by: Konstantin Stepanov <kstep@p-nut.info>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-05 14:28:14 +02:00
Uli Schlachter 2e0ea80cb3 Tasklist: Listen to the correct signals
The tasklist shouldn't care about the tag history or new tags showing up and it
also shouldn't care about tags disappearing on other screens (on the current
screen the tasklist needs to update because the tag might have been selected).

On the other hand, the tasklist really should care about tags being selected and
unselected. This worked before because this causes changes to the focus history.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-06-22 16:45:06 +02:00
Uli Schlachter 470c2e20d0 Update the tasklist when a client's icon changes
Thanks to a pidgin-using friend for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:06:02 +02:00
Uli Schlachter 1615cff82a Tasklist: Add some missing parentheses
"a .. b or c" is equivalent to "(a .. b) or c", but we want "a .. (b or c)".
This bug caused an "attempted to concatenate a nil value" error message.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-30 18:53:04 +02:00
Julien Danjou 9ce234a533 awful.widget.tasklist: use symbols chars rather than images
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:28:43 +02:00
Andrei 'Garoth' Thorp b43da6611d docs: progressbar.lua.in missing a dash to prevent luadoc generation
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-03 11:02:20 +02:00
Adrian C. (anrxc) 4f4259c702 awful.widget: add graph stack property
Initial implementation of stacked graphs. Adds two new methods,
set_stack (false by default) and set_stack_colors (i.e. {"red",
"white", "blue"}). The order of the colors matters, because the
add_value method now accepts an (optional) last argument, an index of
a color from your stack color group.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-29 17:39:22 +02:00
Adrian C. (anrxc) 7ea4478b38 awful.widget: add progressbar ticks property
Second implementation of the progressbar ticks. Adds set_ticks,
set_ticks_gap and set_ticks_size methods. Default gap is 1, size 4 in
respect to the default progressbar width of 100px.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-23 10:57:37 +01:00
Adrian C. (anrxc) 54233fa383 awful.widget: add progressbar set_max_value property
The awful.widget.graph allows to change the maximum value a graph can
handle, thus allows users to use widgets and scripts that don't scale
the values down to 0 - 1 range. The progressbars did not allow this
and worked with a hard-coded value of 1.

Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-03-02 11:59:58 +01:00
Lukas Hrazky 19971c4610 taglist: don't pad name with space, use margin
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-05 18:07:37 +01:00
Lukas Hrazky a085a26d99 widget layouts: always set widgets.height as total
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-05 18:07:00 +01:00
lukash 717efb9ae4 awful.widget: few formal fixes for widget layouts
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-11-05 18:05:27 +01:00
Lukas Hrazky 8eece559b9 progressbar: remove minimum size limit
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-26 17:27:09 +01:00
Lukas Hrazky 5f38aadc25 progressbar/graph: fix rounding and graph drawing
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-26 17:27:09 +01:00
Lukas Hrazky a7c5668a92 update simple widgets to new widget layouts
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-26 11:07:43 +01:00
Lukas Hrazky 9a51955279 update taglist and tasklist to new widget layouts
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-26 11:07:42 +01:00
Lukas Hrazky c09582dca3 widget layouts: rewrite
Signed-off-by: Lukas Hrazky <lukkash@email.cz>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-26 11:07:40 +01:00
Felix Herrmann b6e731b566 awful.widget.graph: fix typo in documentation
Signed-off-by: Felix Herrmann <felix@herrmann-koenigsberg.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-30 15:47:43 +02:00
Gregor Best 523fcb1690 widget.layout.horizontal: fix y coordinate
Signed-off-by: Gregor Best <gbe@intepi.net>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 17:06:13 +02:00
Julien Danjou 69999fee93 awful.widget.prompt: change ellipsize to start
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 14:45:42 +02:00
Julien Danjou 107f1cf1dc widget.layout.horizontal: simplify .resize handling
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 14:37:18 +02:00
Julien Danjou f32e6a9b13 awful.widget.tasklist: add label.focused (FS#595)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 11:21:32 +02:00
Cedric GESTES 36180b9a41 tasklist: update tasklist when a client is hidden
Signed-off-by: Cedric GESTES <ctaf42@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 11:08:57 +02:00
Uli Schlachter ab6cd898c1 awful.widget: Don't use a resizable imagebox
awful.widget.graph and progressbar both create an imagebox. The default is
resize = true which means the image is scaled up inside the wibox if
:set_height() is used.

Setting widget.resize = false avoids this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 11:08:14 +02:00
Uli Schlachter ac60bbd147 progressbar: set_value() should update()
set_value() didn't call update() and thus had no visible effect on the
progressbar.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 11:04:18 +02:00
Uli Schlachter 1c57970dd9 awful.widget.{graph,progressbar}: Un-local functions
This code accesses these functions via _M['set_height'], but if these are local
functions they aren't available this way. Un-local-ing helps here.

This was noticed by anrxc when he set a widget's height to 0.9. These functions
should have caught this invalid height and ignore it, but because they weren't
actually used this error checking was bypassed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 11:04:05 +02:00
Julien Danjou 53ca058ebb awful.widget.layout: add support for margins
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 16:42:54 +02:00
Julien Danjou c43e40c05b awful.widget.tasklist: fix double signal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-22 15:04:34 +02:00
Julien Danjou 2b68f6df5e awful.widget.taglist: refresh on tag name changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 21:29:56 +02:00
Julien Danjou e25a8ba6f4 awful.widget.tasklist: fix hide usage
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 21:03:57 +02:00
Julien Danjou 1692496fce awful.widget.taglist: use attached_add_signal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou c66be3aa82 awful.widget.tasklist: use attached_add_signal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou d7a961175f awful.widget.layoutbox: use attached_add_signal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:48 +02:00
Julien Danjou 65825bdd22 awful: move hooks to signals
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 7e92901d76 awful.widget.layoutbox: use signals rather than hooks
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou fc035005ba client: emit signal on list changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 2f93980ff8 awful.widget.common: fix buttons
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 9c40168f02 widget: emit signals on mouse enter and leave
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 27fd05320e button: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:46 +02:00
Julien Danjou c353970500 client: emit signal on unfocus
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-20 10:39:18 +02:00
Julien Danjou cb2cad6b09 client: emit class signal on focus
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-19 16:05:59 +02:00
Julien Danjou 8de5075412 awful.widget.textclock: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-17 17:49:38 +02:00
Julien Danjou 073e0377dd Revert "key, button: use as simple table"
This reverts commit d7454f4307.

Conflicts:

	button.h
	key.h
	lib/awful/titlebar.lua.in
	lib/naughty.lua.in
	wibox.c
	wibox.h
	widget.c
2009-08-14 16:48:52 +02:00
Uli Schlachter f93c91cd1b lib.awful.widget: Return obj in set_* methods
This change enables stuff like the following:

 awful.widget.graph({}):set_color("red"):set_width(40):add_value(0.5)

Additionally, one can use the above directly in th widgets table.

This most likely doesn't break any existing configs and it adds a quite nice
syntax which can be used for in-place configuration of new widgets.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-09 14:15:31 +02:00
Julien Danjou d7454f4307 key, button: use as simple table
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:44:54 +02:00
Julien Danjou 8c08fffaa9 awful.widget: abuse new object item system
We do not need this since we store all Lua refs into env table of
objects.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:41:07 +02:00
Gregor Best 0d39054217 widget.graph/progressbar: add layout parameter to new()
Signed-off-by: Gregor Best <gbe@intepi.net>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-27 11:07:05 +02:00
Gregor Best 2820e5f2e8 awful.widget: add layouts
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-17 16:46:51 +02:00
Uli Schlachter 855e2b9cdf Make awful.widget.graph work with zero values
First, we need to actually draw values which are zero, else the background
"shines through". Since this breaks the border (it draws over the border),
drawing the border needs to be done later.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-06 10:05:15 +02:00
Evan McClain 2cb34a30f2 awful.widget.progressbar: fix vertical gradient rendering
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-23 22:02:32 +02:00
Julien Danjou 3926f62ea3 hooks: remove arrange
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:44:00 +02:00
Julien Danjou ca777201a7 awful.widget.layoutbox: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:42:57 +02:00
Uli Schlachter 22ac877f46 awful.widget.graph: Add a "scale" property
If this is set to true (default is false), then the graph widget automatically
scales its content to make it fit exactly. If "max_value" is also set, this is
the minimum "height" the graph will use.

This can be useful for graphes which monitor things like network bandwidth
which can vary a lot.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-09 10:59:01 +02:00
Uli Schlachter 26f1904bc7 awful.widget.graph: Add a max_value option
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-09 10:58:14 +02:00
koniu eae6b8066f awful.widget.taglist: support for 'hide' property
This allows setting 'hide' property for a tag to prevent it from
showing in the taglist.

Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-05 14:44:58 +02:00
koniu e69f80caf6 client: allow setting skip_taskbar
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-05 14:33:16 +02:00
Julien Danjou 348a4dca19 awful.widget.graph: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:23:10 +02:00
Julien Danjou 90516497a3 awful.widget.progressbar: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:23:02 +02:00
Julien Danjou b546328ae9 lib: stop using unpack where not needed
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-25 11:14:08 +02:00
Julien Danjou a891ffbe2d awful.tag: call property hook on icon changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-18 16:57:12 +02:00
Julien Danjou 5039c24ed0 ta{g,sk}list: fix memory leak on removal
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-08 14:39:06 +02:00
Julien Danjou 95180799cc button: change copy method
We know also copy release.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-08 14:00:43 +02:00
Julien Danjou fe35104bc2 awful.widget: add support for __call on ta{g,sk}list widgets
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-08 11:59:38 +02:00
Ali Polatel 3fca4e0677 awful.widget.taglist: Fix label.all()
awful.util.escape() may return nil

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-04 16:39:01 +02:00
Julien Danjou 1cbb1c0666 awful.widget.prompt: import
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 22:15:01 +02:00
Julien Danjou c6a63d9250 awful.widget.launcher: export really new()
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 21:55:41 +02:00
Julien Danjou 57aeb2b85e awful.widget.launcher: export new correctly
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 18:43:03 +02:00
Julien Danjou 24be8643eb awful.widget.button: export new correctly
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-27 18:43:03 +02:00
Julien Danjou 21978546eb lib: fix libs to use new awful.button
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 18:08:52 +02:00
koniu 3e8506e6cb awful.widget.taglist: remove needless taglist_squares conditions
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-13 13:13:58 +02:00
koniu f0a11b9628 awful.widget.taglist: dont show name if icon_only property is set
Signed-off-by: koniu <gkusnierz@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-13 10:54:20 +02:00
Julien Danjou 81b46f9694 awful.widget.tasklist: remove otable usage
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 2dfbd6ea2c awful.widget.taglist: remove otable usage
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 4db50647fe awful.widget.common: remove otable usage
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Aleksei Gusev 66483beeee awful.widget.tasklist: include sticky windows in the list
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-25 14:51:14 +01:00
Aleksei Gusev ac6ded12a8 awful.widget.tasklist: added posibility to show c.name when iconified instead of <untitled>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-24 14:09:43 +01:00
Julien Danjou eac5936393 lib: use Lua implementation of otable
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-14 17:19:58 +01:00
Maarten Maathuis 0f8c71e17f unbreak "client: stop using otable"
- Some tag icons were disappearing.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-14 16:45:35 +01:00
Julien Danjou 6430738f17 client: stop using otable
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-14 13:47:50 +01:00
Julien Danjou e56f8f30d0 awful.widget: split
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00