From ea16f6477342d49e19b20a5af233d354496e720b Mon Sep 17 00:00:00 2001
From: Klaus Schmidinger <vdr@tvdr.de>
Date: Sun, 11 Mar 2012 14:44:49 +0100
Subject: Adapted menu column widths of 'skincurses' to the wider HD OSD sizes

---
 HISTORY                             | 1 +
 PLUGINS/src/skincurses/HISTORY      | 4 ++++
 PLUGINS/src/skincurses/skincurses.c | 8 ++++----
 skins.c                             | 5 ++---
 skins.h                             | 4 +++-
 5 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/HISTORY b/HISTORY
index 346562b3..5913f8c9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7021,3 +7021,4 @@ Video Disk Recorder Revision History
 - Dropped the meanwhile obsolete script 'i18n-to-gettext'.
 - Removed the obsolete function cPlugin::RegisterI18n().
 - Removed the obsolete typedef tI18nPhrase.
+- Adapted menu column widths of 'skincurses' to the wider HD OSD sizes.
diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY
index 90dfbb7d..0ba892ea 100644
--- a/PLUGINS/src/skincurses/HISTORY
+++ b/PLUGINS/src/skincurses/HISTORY
@@ -92,3 +92,7 @@ VDR Plugin 'skincurses' Revision History
 2011-05-15: Version 0.1.10
 
 - Avoiding a gcc 4.6 compiler error (thanks to Tobias Grimm).
+
+2012-03-11: Version 0.1.11
+
+- Adapted menu column widths of 'skincurses' to the wider HD OSD sizes.
diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c
index 74166b33..1f120c7c 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 2.7 2011/08/21 11:04:38 kls Exp $
+ * $Id: skincurses.c 2.8 2012/03/11 14:42:52 kls Exp $
  */
 
 #include <ncurses.h>
@@ -11,7 +11,7 @@
 #include <vdr/plugin.h>
 #include <vdr/skins.h>
 
-static const char *VERSION        = "0.1.10";
+static const char *VERSION        = "0.1.11";
 static const char *DESCRIPTION    = trNOOP("A text only skin");
 static const char *MAINMENUENTRY  = NULL;
 
@@ -375,13 +375,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) / 12;// Tab() is in "pixel" - see also skins.c!!!
+         int xt = Tab(i) / AvgCharWidth();// Tab() is in "pixel" - see also skins.c!!!
          osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - 2 - xt);
          }
       if (!Tab(i + 1))
          break;
       }
-  SetEditableWidth(ScOsdWidth - 2 - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!!
+  SetEditableWidth(ScOsdWidth - 2 - Tab(1) / AvgCharWidth()); // Tab() is in "pixel" - see also skins.c!!!
 }
 
 void cSkinCursesDisplayMenu::SetScrollbar(int Total, int Offset)
diff --git a/skins.c b/skins.c
index ccf8c099..b9c55ef4 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 2.4 2012/02/20 11:47:15 kls Exp $
+ * $Id: skins.c 2.5 2012/03/11 14:36:11 kls Exp $
  */
 
 #include "skins.h"
@@ -78,9 +78,8 @@ void cSkinDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5)
   tabs[3] = Tab3 ? tabs[2] + Tab3 : 0;
   tabs[4] = Tab4 ? tabs[3] + Tab4 : 0;
   tabs[5] = Tab5 ? tabs[4] + Tab5 : 0;
-  int AvgCharWidth = Setup.FontOsdSize * 4 / 6; // just an estimate
   for (int i = 1; i < MaxTabs; i++)
-      tabs[i] *= AvgCharWidth;
+      tabs[i] *= AvgCharWidth();
 }
 
 void cSkinDisplayMenu::Scroll(bool Up, bool Page)
diff --git a/skins.h b/skins.h
index 280a8e23..19bba513 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 2.1 2011/12/04 13:38:17 kls Exp $
+ * $Id: skins.h 2.2 2012/03/11 14:38:23 kls Exp $
  */
 
 #ifndef __SKINS_H
@@ -28,6 +28,8 @@ private:
 public:
   cSkinDisplay(void);
   virtual ~cSkinDisplay();
+  static int AvgCharWidth(void) { return Setup.FontOsdSize * 4 / 6; }
+       ///< Returns the average width of a character in pixel (just a raw estimate).
   int EditableWidth(void) { return editableWidth; }
   void SetEditableWidth(int Width) { editableWidth = Width; }
        ///< If an item is set through a call to cSkinDisplayMenu::SetItem(), this
-- 
cgit v1.2.3