summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-06-03 13:21:33 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2006-06-03 13:21:33 +0200
commit9966e03e2925622557d05d49f6bbf76a382fe9b8 (patch)
tree4d065ad25cff0a267203991edbdf471dfa6ccc8a
parenta12a504fad29ce7b9d4bfa7a81aafad07d92fde0 (diff)
downloadvdr-9966e03e2925622557d05d49f6bbf76a382fe9b8.tar.gz
vdr-9966e03e2925622557d05d49f6bbf76a382fe9b8.tar.bz2
Fixed handling tabbed item display in 'skincurses'
-rw-r--r--HISTORY1
-rw-r--r--PLUGINS/src/skincurses/HISTORY4
-rw-r--r--PLUGINS/src/skincurses/skincurses.c9
-rw-r--r--menuitems.c7
-rw-r--r--skins.c4
-rw-r--r--skins.h6
6 files changed, 20 insertions, 11 deletions
diff --git a/HISTORY b/HISTORY
index b17ed304..0d471863 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4763,3 +4763,4 @@ Video Disk Recorder Revision History
- Fixed handling the display of the '*' indicator in the "What's on now/next?"
menu, so that events that haven't been "seen" in the data stream within 30
seconds won't be shown as "running".
+- Fixed handling tabbed item display in 'skincurses'.
diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY
index 841d5505..6c870957 100644
--- a/PLUGINS/src/skincurses/HISTORY
+++ b/PLUGINS/src/skincurses/HISTORY
@@ -29,3 +29,7 @@ VDR Plugin 'skincurses' Revision History
2006-04-14: Version 0.0.6
- Added a missing "Key$" in skincurses.c.
+
+2006-06-03: Version 0.0.7
+
+- Fixed handling tabbed item display.
diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c
index 96b62e31..f9e15dd2 100644
--- a/PLUGINS/src/skincurses/skincurses.c
+++ b/PLUGINS/src/skincurses/skincurses.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: skincurses.c 1.8 2006/04/14 11:35:59 kls Exp $
+ * $Id: skincurses.c 1.9 2006/06/03 13:21:33 kls Exp $
*/
#include <ncurses.h>
@@ -11,7 +11,7 @@
#include <vdr/plugin.h>
#include <vdr/skins.h>
-static const char *VERSION = "0.0.6";
+static const char *VERSION = "0.0.7";
static const char *DESCRIPTION = "A text only skin";
static const char *MAINMENUENTRY = NULL;
@@ -277,6 +277,7 @@ public:
virtual void SetEvent(const cEvent *Event);
virtual void SetRecording(const cRecording *Recording);
virtual void SetText(const char *Text, bool FixedFont);
+ virtual const cFont *GetTextAreaFont(bool FixedFont) const { return &Font; }
virtual void Flush(void);
};
@@ -366,13 +367,13 @@ void cSkinCursesDisplayMenu::SetItem(const char *Text, int Index, bool Current,
for (int i = 0; i < MaxTabs; i++) {
const char *s = GetTabbedText(Text, i);
if (s) {
- int xt = Tab(i);
+ int xt = Tab(i) / 12;// Tab() is in "pixel" - see also skins.c!!!
osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, OsdWidth - xt);
}
if (!Tab(i + 1))
break;
}
- SetEditableWidth(OsdWidth - Tab(1));
+ SetEditableWidth(OsdWidth - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!!
}
void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
diff --git a/menuitems.c b/menuitems.c
index 1bca4873..517664c7 100644
--- a/menuitems.c
+++ b/menuitems.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menuitems.c 1.44 2006/04/25 15:59:02 kls Exp $
+ * $Id: menuitems.c 1.45 2006/06/03 13:20:01 kls Exp $
*/
#include "menuitems.h"
@@ -296,7 +296,10 @@ void cMenuEditStrItem::Set(void)
char buf[1000];
if (InEditMode()) {
- const cFont *font = cFont::GetFont(fontOsd);
+ // This is an ugly hack to make editing strings work with the 'skincurses' plugin.
+ const cFont *font = dynamic_cast<cSkinDisplayMenu *>(cSkinDisplay::Current())->GetTextAreaFont(false);
+ if (!font || font->Width("W") != 1) // all characters have with == 1 in the font used by 'skincurses'
+ font = cFont::GetFont(fontOsd);
strncpy(buf, value, pos);
snprintf(buf + pos, sizeof(buf) - pos - 2, insert && newchar ? "[]%c%s" : "[%c]%s", *(value + pos), value + pos + 1);
int width = cSkinDisplay::Current()->EditableWidth();
diff --git a/skins.c b/skins.c
index 736d7dad..c3c93961 100644
--- a/skins.c
+++ b/skins.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skins.c 1.9 2006/04/09 11:25:30 kls Exp $
+ * $Id: skins.c 1.10 2006/06/03 10:18:07 kls Exp $
*/
#include "skins.h"
@@ -79,7 +79,7 @@ void cSkinDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5)
tabs[4] = Tab4 ? tabs[3] + Tab4 : 0;
tabs[5] = Tab5 ? tabs[4] + Tab5 : 0;
for (int i = 1; i < MaxTabs; i++)
- tabs[i] *= 12;//XXX average character width of font used for items!!!
+ tabs[i] *= 12;//XXX average character width of font used for items - see also skincurses.c!!!
}
void cSkinDisplayMenu::Scroll(bool Up, bool Page)
diff --git a/skins.h b/skins.h
index 225fbc22..9a9ba570 100644
--- a/skins.h
+++ b/skins.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skins.h 1.13 2006/04/09 11:23:35 kls Exp $
+ * $Id: skins.h 1.14 2006/06/03 10:21:45 kls Exp $
*/
#ifndef __SKINS_H
@@ -95,7 +95,7 @@ protected:
cTextScroller textScroller;
int Tab(int n) { return (n >= 0 && n < MaxTabs) ? tabs[n] : 0; }
///< Returns the offset of the given tab from the left border of the
- ///< item display area. The value returned is in pixel.//XXX ncurses???
+ ///< item display area. The value returned is in pixel.
const char *GetTabbedText(const char *s, int Tab);
///< Returns the part of the given string that follows the given
///< Tab (where 0 indicates the beginning of the string). If no such
@@ -104,7 +104,7 @@ public:
cSkinDisplayMenu(void);
virtual void SetTabs(int Tab1, int Tab2 = 0, int Tab3 = 0, int Tab4 = 0, int Tab5 = 0);
///< Sets the tab columns to the given values, which are the number of
- ///< characters in each column.//XXX ncurses???
+ ///< characters in each column.
virtual void Scroll(bool Up, bool Page);
///< If this menu contains a text area that can be scrolled, this function
///< will be called to actually scroll the text. Up indicates whether the