mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
The disk usage is no longer automatically added to the title of the main and "Recordings" menus
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: skinclassic.c 2.6 2011/08/21 11:02:06 kls Exp $
|
||||
* $Id: skinclassic.c 2.7 2012/04/23 08:48:03 kls Exp $
|
||||
*/
|
||||
|
||||
#include "skinclassic.h"
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "i18n.h"
|
||||
#include "osd.h"
|
||||
#include "themes.h"
|
||||
#include "videodir.h"
|
||||
|
||||
#define ScrollWidth (Setup.FontOsdSize / 4)
|
||||
#define TextFrame (Setup.FontOsdSize / 10)
|
||||
@@ -170,7 +171,10 @@ private:
|
||||
int y0, y1, y2, y3, y4, y5;
|
||||
int lineHeight;
|
||||
int dateWidth;
|
||||
cString title;
|
||||
cString lastDate;
|
||||
int lastDiskUsageState;
|
||||
void DrawTitle(void);
|
||||
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
|
||||
void SetTextScrollbar(void);
|
||||
public:
|
||||
@@ -196,6 +200,7 @@ cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(void)
|
||||
{
|
||||
const cFont *font = cFont::GetFont(fontOsd);
|
||||
lineHeight = font->Height();
|
||||
lastDiskUsageState = -1;
|
||||
dateWidth = 0;
|
||||
x0 = 0;
|
||||
x1 = x0 + 2 * TextSpacing;
|
||||
@@ -270,10 +275,17 @@ void cSkinClassicDisplayMenu::Clear(void)
|
||||
osd->DrawRectangle(x0, y1, x3 - 1, y4 - 1, Theme.Color(clrBackground));
|
||||
}
|
||||
|
||||
void cSkinClassicDisplayMenu::SetTitle(const char *Title)
|
||||
void cSkinClassicDisplayMenu::DrawTitle(void)
|
||||
{
|
||||
const cFont *font = cFont::GetFont(fontOsd);
|
||||
osd->DrawText(x0, y0, Title, Theme.Color(clrMenuTitleFg), Theme.Color(clrMenuTitleBg), font, x3 - x0 - dateWidth);
|
||||
bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording;
|
||||
osd->DrawText(x0, y0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, Theme.Color(clrMenuTitleFg), Theme.Color(clrMenuTitleBg), font, x3 - x0 - dateWidth);
|
||||
}
|
||||
|
||||
void cSkinClassicDisplayMenu::SetTitle(const char *Title)
|
||||
{
|
||||
title = Title;
|
||||
DrawTitle();
|
||||
}
|
||||
|
||||
void cSkinClassicDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
|
||||
@@ -422,6 +434,8 @@ const cFont *cSkinClassicDisplayMenu::GetTextAreaFont(bool FixedFont) const
|
||||
|
||||
void cSkinClassicDisplayMenu::Flush(void)
|
||||
{
|
||||
if (cVideoDiskUsage::HasChanged(lastDiskUsageState))
|
||||
DrawTitle();
|
||||
cString date = DayDateTime();
|
||||
if (!*lastDate || strcmp(date, lastDate)) {
|
||||
const cFont *font = cFont::GetFont(fontOsd);
|
||||
|
||||
Reference in New Issue
Block a user