Commit Graph

54 Commits

Author SHA1 Message Date
marco candrian 4a7ebc9c5c [widgets/progressbar] fix FS#145 - empty progressbar draws one pixel too far
+ check_settings should be below the check for data_items (count).
+ some fix on check_settings
2008-04-02 15:51:30 +02:00
Julien Danjou c582f4397b [widgets] Check for no value in uicb_widget_tell and only update sbar on no error
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-02 15:31:19 +02:00
Julien Danjou c43054bc4d [progressbar] check_settings should be static
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-02 08:46:32 +02:00
marco candrian ed231336fb [widgets/progressbar] try to prevent the bug FS#141
The real cause for it is unknown to me. I personally can't reproduce it.

Even when it won't fix, that patch makes still sense so:
no drawing of a rectangle what will get 'overdrawn' fully anyway.
2008-04-02 06:26:17 +02:00
marco candrian 30de23d8c7 [widgets/progressbar] fix x-offset value (pb_x actually) 2008-04-02 06:26:17 +02:00
Julien Danjou c4cc8c5e04 [widgets] Remove paddings
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-31 10:04:03 +02:00
marco candrian 0e1dbe40d2 [widgets/progressbar.c] x_offset+1 and bg color fix
the widget got drawn 1 pixel to much on the left.
adding one progressbar x offset (pb_x) seems to work nicely.

also. bg shall draw (according to the manpage), the gaps
between the 'ticks' + the padding between the border and the ticks
(... everthing inside the border only the ticks)

so, an additional rectangle draw line to achieve that basic bg color.
2008-03-28 09:53:50 +01:00
Julien Danjou 3ea69238ae [widgets/progressbar] Initialize unit value to 0
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-26 10:59:06 +01:00
marco candrian 89f4e22255 [widgets] new progressbar options
if a ticks_count is defined (!= 0), round the value to them ('ticks')
and draw finally some gaps.

Also an important issue: since the bar needs to be 'homogenous', they may won't
match a given height. Some value tweaking will be necessary then.

An alternative would be a not homogenous bar, what is worse I think.

The values, when there are 'ticks', get rounded up somebit. So they get turned on,
when half of them is reached - or so.

new options (see awesomerc.5.txt for a more detailed description):

border_width
border_padding
fg_off

ticks_count
ticks_gap

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-26 10:02:37 +01:00
marco candrian b92a292e43 additional line width argument to draw_rectangle[_gradient] in draw.c
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:22 +01:00
Julien Danjou 0a6c6e017b Store physical screen id in statusbar and client, change get_phys_s() to screen_virttophys()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:22 +01:00
Julien Danjou 2a47aa7f0b Add cfg_getalignment() functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
Julien Danjou 19656fc36d Add a CFG_ALIGNMENT type and use it
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
Julien Danjou c6eec955c8 Rename Area to area_t 2008-03-23 15:52:18 +01:00
Julien Danjou fa47024714 Change colors infrastructure to style: rename colors_ctx_t to style_t and add font in it 2008-03-23 15:52:18 +01:00
marco candrian d1e216936c try to calculated the height etc in the same way on progressbar and graph
some issue is still there (anyway). When there are e.g. 5 horizontal bars
the width of that progressbar (multiply of 5 or similar) may won't be the
same like a graph.

So some tweaking on the graphs' height is necessary then.
2008-03-23 15:52:18 +01:00
Julien Danjou 0a980095b3 Rework colors stuff, add a common colors_ctx_t containing colors and shadow options 2008-03-23 15:52:17 +01:00
marco candrian 04ff373a63 New progressbar option: vertical=<boolean>
if 'true', draws the whole progressbar-block vertically
instead of horizontally.
2008-03-23 15:52:16 +01:00
marco candrian 6216d25bc6 new progressbar option for reversing the drawing
inside a data section, with reverse=<boolean> it's possible to reverse the
drawing i.e instead of left to right, from right to left. etc.
2008-03-23 15:52:16 +01:00
marco candrian 397aa33163 widget error infrastructure additions 2008-03-23 15:52:16 +01:00
Julien Danjou 0e69534a65 Add a common error infratructure for widget_tell
Signed-off-by: Marco Candrian <mac@calmar.ws>
2008-03-23 15:52:16 +01:00
marco candrian 0c4dc79bb6 progressbar widget handles property arguments now
data section values:

echo '0 widget_tell progess data title new_value' ...

data properties: fg, bg, fg_center, fg_end, bordercolor works like this:

echo '0 widget_tell progess fg_end title new_color' ...

universal settings to tune are gap, width, height, padding:

echo '0 widget_tell progess padding value' ...
2008-03-23 15:52:16 +01:00
marco candrian 3569ab617d new property argument to widget _tell functions
actually the _tell function won't handle the new argument.
Coming patches will handle them.

it will need now something like this:

echo '0 widget_tell widget property value'

where property can be anything used in the awesomerc file,
that means what will be supported. Like: fg, fg_end, width, font...

(actually it ignores the property value and changes what have been changed in
the past as well.)
2008-03-23 15:52:16 +01:00
Julien Danjou ae75f55acd change draw_color_new() proto to fill the struct and return status 2008-02-13 08:58:21 +01:00
Julien Danjou 0bfa880b0f add align option to widget to specify their alignment 2008-02-08 10:59:55 +01:00
marco candrian 8567009d22 rename of fg_middle/fg_half to fg_center and fg_full to fg_end
A hint from maxauthority. The names would be unified now in the progressbar
and the graph widget. And (hopefully) it's easier to guess what they mean now.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-06 07:32:22 +01:00
marco candrian a28f931d08 awesomerc(1) update for progressbar widget option fg_half
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-05 12:04:03 +01:00
marco candrian 09e60cb95e adds fg_half as an option to the progressbar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-05 07:16:12 +01:00
marco candrian b024b0c0cf draw_rectangle_gradient() for the progressbar widget; + fg_full option
Adds an optional additional foreground color option to a bar: fg_full = <color>

A value of 0 represents the fg-color, and a value of 100 (a full graph) the
fg_full-color.

Example:

progressbar xy
{
  bar { fg = "#111155" fg_full = "#3333cc"  bg = "#000000" bordercolor = "#4444cc"}
  ....
}

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-04 11:16:30 +01:00
Julien Danjou 42d4686282 change padding_left to padding for progressbar 2008-01-29 08:44:16 +01:00
Julien Danjou b6642e45c8 rename initxcolor to draw_color_new() and move it to draw.c 2008-01-27 18:56:37 +01:00
Julien Danjou 2ac27fdac4 move draw files to common/ 2008-01-24 18:48:11 +01:00
marco candrian ec7ab36814 max values must be > 0 on the graph-widget
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-22 15:01:21 +01:00
Julien Danjou 668702b777 move list.h and util.[ch] to common/ 2008-01-21 18:14:59 +01:00
Julien Danjou 9f28582820 add Display as arg 2008-01-21 16:31:14 +01:00
Julien Danjou d59fc62739 draw rectangle take an Area as arg 2008-01-21 16:31:14 +01:00
Nikos Ntarmos 32163d80e1 Clipping instead of ignoring for progressbar widget
FS#25
2008-01-07 09:29:11 +01:00
marco candrian 40dc6eab21 rounding on progressbar fixed 2008-01-07 09:24:21 +01:00
marco candrian 37da7d0d01 graph widget added
example config:

graph gr_cpu {
  width = 80
  height = "0.8"
  fg = "#336633"
  bg = "#000000"
  bordercolor = "#669966"
  padding_left = 0
  mouse = {...}
  x = ...
  y = ...
}

Looks like here: http://www.calmar.ws/tmp/112-Sun-screen.png

I renamed lpadding to padding_left, and bcolor to bordercolor
also on the progressbar widget.

The awesomerc page would still be to write, when this patch will get accepted.

Hints are always welcomed.
2008-01-06 20:51:40 +01:00
Julien Danjou b1c62a618f store widget height 2008-01-05 12:44:14 +01:00
Julien Danjou 609318cbec use 2 vars for knowing if users supplied coords 2008-01-05 12:35:12 +01:00
Nikos Ntarmos 64658bcf93 widgets/textbox.c area.x miscalculation due to variable width 2008-01-05 09:12:20 +01:00
Julien Danjou a4c09d142c add support for x,y coords supplying in widgets 2008-01-04 22:05:52 +01:00
Julien Danjou 6ca7d7b2db use Area in Widget 2008-01-04 21:46:25 +01:00
Julien Danjou 9fc22e9e4e remove some get_phys_screen() calls 2008-01-02 17:41:03 +01:00
Julien Danjou 437bc5c22c add 2008 copyright notice 2008-01-02 16:59:43 +01:00
Julien Danjou 4f65aa8f51 rework headers inclusion 2008-01-01 18:02:36 +01:00
calmar b832f96ba1 fix border color 2008-01-01 17:04:06 +01:00
Julien Danjou c4b4a1fded change warn() message and use simply , as strtok delimiter 2008-01-01 16:29:59 +01:00
Julien Danjou bb06e80199 simplify some stuff, cosmetic 2008-01-01 16:29:58 +01:00