mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 02:25:09 +00:00
* Fixed slight vertical misalignment of bars/graphs (sf.net 1273994)
* Diskio fixes (sf.net 1274140 git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@195 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
dd9eed5114
commit
bdfab6b089
@ -1,5 +1,9 @@
|
||||
# $Id$
|
||||
|
||||
2005-08-26
|
||||
* Fixed slight vertical misalignment of bars/graphs (sf.net 1273994)
|
||||
* Diskio fixes (sf.net 1274140)
|
||||
|
||||
2005-08-25
|
||||
* More own_window fixes
|
||||
* applied disk io patch (sf.net patch 1271691)
|
||||
|
25
src/conky.c
25
src/conky.c
@ -1778,7 +1778,7 @@ static void generate_text()
|
||||
if (!use_spacer) {
|
||||
if (diskio_value > 1024*1024) {
|
||||
snprintf(p, n, "%.1fG",
|
||||
(double)diskio_value/1024);
|
||||
(double)diskio_value/1024/1024);
|
||||
} else if (diskio_value > 1024) {
|
||||
snprintf(p, n, "%.1fM",
|
||||
(double)diskio_value/1024);
|
||||
@ -3217,9 +3217,19 @@ static void draw_line(char *s)
|
||||
specials[special_index].height;
|
||||
int bar_usage =
|
||||
specials[special_index].arg;
|
||||
int by =
|
||||
cur_y - (font_ascent() +
|
||||
h) / 2 - 1;
|
||||
int by;
|
||||
|
||||
#ifdef XFT
|
||||
if (use_xft) {
|
||||
by = cur_y - (font_ascent() + h) / 2 - 1;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
by = cur_y - (font_ascent()/2) - 1;
|
||||
}
|
||||
if (h < (font_height())) {
|
||||
by -= h / 2 - 1;
|
||||
}
|
||||
w = specials[special_index].width;
|
||||
if (w == 0)
|
||||
w = text_start_x +
|
||||
@ -3264,11 +3274,14 @@ static void draw_line(char *s)
|
||||
int by;
|
||||
#ifdef XFT
|
||||
if (use_xft) {
|
||||
by = cur_y - (font_ascent() + h) / 2 + 1;
|
||||
by = cur_y - (font_ascent() + h) / 2 - 1;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
by = cur_y - (font_ascent()/2) + 1;
|
||||
by = cur_y - (font_ascent()/2) - 1;
|
||||
}
|
||||
if (h < (font_height())) {
|
||||
by -= h / 2 - 1;
|
||||
}
|
||||
w = specials[special_index].width;
|
||||
if (w == 0)
|
||||
|
10
src/linux.c
10
src/linux.c
@ -1089,7 +1089,7 @@ void update_top()
|
||||
|
||||
void update_diskio()
|
||||
{
|
||||
static unsigned int last = 0;
|
||||
static unsigned int last = UINT_MAX;
|
||||
static FILE* fp;
|
||||
|
||||
char buf[512];
|
||||
@ -1121,10 +1121,10 @@ void update_diskio()
|
||||
* "sectors read", and we therefore have to divide by two to
|
||||
* get KB */
|
||||
int tot = ((double)(current-last)/2);
|
||||
if (last == 0) {
|
||||
/* initial case: return zero since we don't have a
|
||||
* 'last' value yet; it's a safe assumption that if
|
||||
* last isn't zero, since it's counting from the start */
|
||||
if (last > current) {
|
||||
/* we hit this either if it's the very first time we
|
||||
* run this, or when /proc/diskstats overflows; while
|
||||
* 0 is not correct, it's at least not way off */
|
||||
tot = 0;
|
||||
}
|
||||
last = current;
|
||||
|
Loading…
Reference in New Issue
Block a user