mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
gui/dboxinfo: gui cosmetics
This commit is contained in:
@@ -195,6 +195,10 @@ void CDBoxInfoWidget::paint()
|
|||||||
int icon_w = 0, icon_h = 0;
|
int icon_w = 0, icon_h = 0;
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h);
|
frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h);
|
||||||
|
|
||||||
|
struct statfs rec_s;
|
||||||
|
if (statfs(g_settings.network_nfs_recordingdir.c_str(), &rec_s))
|
||||||
|
memset(&rec_s, 0, sizeof(rec_s));
|
||||||
|
|
||||||
struct statfs s;
|
struct statfs s;
|
||||||
FILE * mountFile;
|
FILE * mountFile;
|
||||||
struct mntent * mnt;
|
struct mntent * mnt;
|
||||||
@@ -231,7 +235,8 @@ void CDBoxInfoWidget::paint()
|
|||||||
}
|
}
|
||||||
height += mheight;
|
height += mheight;
|
||||||
}
|
}
|
||||||
nameOffset = std::max(nameOffset, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(basename(mnt->mnt_dir), true) + icon_w + 20);
|
int icon_space = memcmp(&s.f_fsid, &rec_s.f_fsid, sizeof(s.f_fsid)) ? 0 : (10 + icon_w);
|
||||||
|
nameOffset = std::max(nameOffset, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(basename(mnt->mnt_dir), true) + icon_space + 20);
|
||||||
}
|
}
|
||||||
endmntent(mountFile);
|
endmntent(mountFile);
|
||||||
}
|
}
|
||||||
@@ -271,12 +276,11 @@ void CDBoxInfoWidget::paint()
|
|||||||
offsetw += 20;
|
offsetw += 20;
|
||||||
width = offsetw + 10 + 120;
|
width = offsetw + 10 + 120;
|
||||||
|
|
||||||
int _width = w_max(width, 0);
|
int diff = frameBuffer->getScreenWidth() - width;
|
||||||
if (_width < width) {
|
if (diff < 0) {
|
||||||
int diff = width - _width;
|
width -= diff;
|
||||||
width = _width;
|
|
||||||
offsetw -= diff;
|
offsetw -= diff;
|
||||||
nameOffset -= width;
|
nameOffset -= diff;
|
||||||
}
|
}
|
||||||
height = h_max(height, 0);
|
height = h_max(height, 0);
|
||||||
x = getScreenStartX(width);
|
x = getScreenStartX(width);
|
||||||
@@ -531,9 +535,6 @@ void CDBoxInfoWidget::paint()
|
|||||||
}
|
}
|
||||||
bytes_used = bytes_total - bytes_free;
|
bytes_used = bytes_total - bytes_free;
|
||||||
percent_used = (bytes_used * 200 + bytes_total) / 2 / bytes_total;
|
percent_used = (bytes_used * 200 + bytes_total) / 2 / bytes_total;
|
||||||
struct statfs rec_s;
|
|
||||||
if (statfs(g_settings.network_nfs_recordingdir.c_str(), &rec_s))
|
|
||||||
memset(&rec_s, 0, sizeof(rec_s));
|
|
||||||
//paint mountpoints
|
//paint mountpoints
|
||||||
for (int j = 0; j < headSize; j++) {
|
for (int j = 0; j < headSize; j++) {
|
||||||
int _w = width;
|
int _w = width;
|
||||||
@@ -544,7 +545,7 @@ void CDBoxInfoWidget::paint()
|
|||||||
strncpy(ubuf, basename(mnt->mnt_dir), buf_size);
|
strncpy(ubuf, basename(mnt->mnt_dir), buf_size);
|
||||||
_w = nameOffset - mpOffset;
|
_w = nameOffset - mpOffset;
|
||||||
if (rec_mp)
|
if (rec_mp)
|
||||||
_w -= icon_w;
|
_w -= icon_w + 10;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
mpOffset = nameOffset + 10;
|
mpOffset = nameOffset + 10;
|
||||||
|
Reference in New Issue
Block a user