1
0
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:
Brenden Matthews 2005-08-26 16:29:56 +00:00
parent dd9eed5114
commit bdfab6b089
3 changed files with 28 additions and 11 deletions

View File

@ -1,5 +1,9 @@
# $Id$ # $Id$
2005-08-26
* Fixed slight vertical misalignment of bars/graphs (sf.net 1273994)
* Diskio fixes (sf.net 1274140)
2005-08-25 2005-08-25
* More own_window fixes * More own_window fixes
* applied disk io patch (sf.net patch 1271691) * applied disk io patch (sf.net patch 1271691)

View File

@ -1778,7 +1778,7 @@ static void generate_text()
if (!use_spacer) { if (!use_spacer) {
if (diskio_value > 1024*1024) { if (diskio_value > 1024*1024) {
snprintf(p, n, "%.1fG", snprintf(p, n, "%.1fG",
(double)diskio_value/1024); (double)diskio_value/1024/1024);
} else if (diskio_value > 1024) { } else if (diskio_value > 1024) {
snprintf(p, n, "%.1fM", snprintf(p, n, "%.1fM",
(double)diskio_value/1024); (double)diskio_value/1024);
@ -3217,9 +3217,19 @@ static void draw_line(char *s)
specials[special_index].height; specials[special_index].height;
int bar_usage = int bar_usage =
specials[special_index].arg; specials[special_index].arg;
int by = int by;
cur_y - (font_ascent() +
h) / 2 - 1; #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; w = specials[special_index].width;
if (w == 0) if (w == 0)
w = text_start_x + w = text_start_x +
@ -3264,11 +3274,14 @@ static void draw_line(char *s)
int by; int by;
#ifdef XFT #ifdef XFT
if (use_xft) { if (use_xft) {
by = cur_y - (font_ascent() + h) / 2 + 1; by = cur_y - (font_ascent() + h) / 2 - 1;
} else } else
#endif #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; w = specials[special_index].width;
if (w == 0) if (w == 0)

View File

@ -1089,7 +1089,7 @@ void update_top()
void update_diskio() void update_diskio()
{ {
static unsigned int last = 0; static unsigned int last = UINT_MAX;
static FILE* fp; static FILE* fp;
char buf[512]; char buf[512];
@ -1121,10 +1121,10 @@ void update_diskio()
* "sectors read", and we therefore have to divide by two to * "sectors read", and we therefore have to divide by two to
* get KB */ * get KB */
int tot = ((double)(current-last)/2); int tot = ((double)(current-last)/2);
if (last == 0) { if (last > current) {
/* initial case: return zero since we don't have a /* we hit this either if it's the very first time we
* 'last' value yet; it's a safe assumption that if * run this, or when /proc/diskstats overflows; while
* last isn't zero, since it's counting from the start */ * 0 is not correct, it's at least not way off */
tot = 0; tot = 0;
} }
last = current; last = current;