Commit Graph

18 Commits

Author SHA1 Message Date
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 95fc524993 set widget alignment for graph 2008-02-11 19:01:48 +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
Julien Danjou 0e890697ac fix uninit warning 2008-02-05 15:40:16 +01:00
marco candrian ff753f1f14 Adds fg_middle + fg_end color option for the graph widget
Draws a color-gradient beginning from fg and
if either fg_middle or fg_end is set, through them.

example config:

    graph gr_cpu
    {
      data { scale = false max = 100  style = bottom
             fg = "#cc6666" fg_half = "#cc6666" fg_full = "#998888"}
      ...
      ...
    }

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-05 15:37:21 +01:00
marco candrian be0779d0fa graph widget adopted to the latest statusbar changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-31 20:43:42 +01:00
Julien Danjou 3d74f42446 tmp_color can be uninitialized 2008-01-27 19:10:15 +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
marco candrian c73e0bd72e Additional graph widget options
There are the new styles:

bottom (fill the graph to the bottom of widget-square)
top (fill the graph to the top of the widget-square
line (just print a line representing the values)

E.g when there are multiple 'bottom'-style graphs, it will print the larger
part on top of the smaller.  When two values are the same, it will (actually)
just print it with one color (something to improve maybe).

bottom-style overdraws top-style, and line-style overdraws top and bottom style
(= gets drawn at the end)

An example configuration:

    graph gr_cpu
    {
      data { scale = false max = 100 fg = "#669966" style = bottom} # total
      data { scale = false max = 100 fg = "#cc9966" style = bottom} # user
      data { scale = false max = 100 fg = "#ffffff" style = bottom} # nice-processes
      width = 50
      height = "0.80"
      bg = "#000000"
      bordercolor = "#669966"
    }

With the 'line' style, there is a bug (draws sometimes over the rectangle).
I checked the values and didn't find any value what actually should do that.
So I have no idea why that is... needs a recheck, because it's not really nice..
Happens especially when scale=true and after a rescaling takes place.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-25 22:53:20 +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
marco candrian b8ff99f652 graph-widgets works with floats now
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-21 16:31:13 +01:00
marco candrian 4f05f954d0 direct calculating of the line length to draw
the graph_tell() does not modify directly the line-lenght to draw, rather
then calculating the value in percent and in the graph_draw, calculating
the line length ouf of that the percent.

(while trying to fix something little, a whole new scale thing resulted;
also I didn't really understand the old system, my fault that is)
2008-01-09 10:10:29 +01:00
Nikos Ntarmos 348440bc8e autoscale graph widget
FS#26
2008-01-07 09:28:07 +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