mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
fix clock position & corner
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@403 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: dca2980e30
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2010-02-24 (Wed, 24 Feb 2010)
Origin message was:
------------------
fix clock position & corner
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@403 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -12,12 +12,13 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include "infoclock.h"
|
#include "infoclock.h"
|
||||||
|
|
||||||
#define XOFF 10
|
|
||||||
#define YOFF 0
|
#define YOFF 0
|
||||||
|
|
||||||
CInfoClock::CInfoClock()
|
CInfoClock::CInfoClock()
|
||||||
{
|
{
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
frameBuffer = CFrameBuffer::getInstance();
|
||||||
|
x = frameBuffer->getScreenWidth();
|
||||||
|
y = frameBuffer->getScreenY();
|
||||||
|
|
||||||
time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight();
|
time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight();
|
||||||
int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number);
|
int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number);
|
||||||
@@ -35,9 +36,6 @@ CInfoClock::~CInfoClock()
|
|||||||
|
|
||||||
void CInfoClock::paintTime( bool show_dot)
|
void CInfoClock::paintTime( bool show_dot)
|
||||||
{
|
{
|
||||||
int x = g_settings.screen_EndX - XOFF;
|
|
||||||
int y = g_settings.screen_StartY + YOFF;
|
|
||||||
|
|
||||||
char timestr[10];
|
char timestr[10];
|
||||||
time_t tm;
|
time_t tm;
|
||||||
|
|
||||||
@@ -46,7 +44,7 @@ void CInfoClock::paintTime( bool show_dot)
|
|||||||
strftime((char*) ×tr, 20, "%H:%M:%S", localtime(&tm));
|
strftime((char*) ×tr, 20, "%H:%M:%S", localtime(&tm));
|
||||||
else
|
else
|
||||||
strftime((char*) ×tr, 20, "%H.%M:%S", localtime(&tm));
|
strftime((char*) ×tr, 20, "%H.%M:%S", localtime(&tm));
|
||||||
frameBuffer->paintBoxRel(x - time_width - 15, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, 7);
|
frameBuffer->paintBoxRel(x - time_width - 15, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, RADIUS_SMALL);
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(x - time_width- 10, y+ time_height, time_width, timestr, COL_MENUCONTENT);
|
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(x - time_width- 10, y+ time_height, time_width, timestr, COL_MENUCONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,8 +76,6 @@ void CInfoClock::StartClock()
|
|||||||
|
|
||||||
void CInfoClock::StopClock()
|
void CInfoClock::StopClock()
|
||||||
{
|
{
|
||||||
int x = g_settings.screen_EndX - XOFF;
|
|
||||||
int y = g_settings.screen_StartY + YOFF;
|
|
||||||
if(thrTimer) {
|
if(thrTimer) {
|
||||||
pthread_cancel(thrTimer);
|
pthread_cancel(thrTimer);
|
||||||
thrTimer = 0;
|
thrTimer = 0;
|
||||||
|
@@ -20,7 +20,7 @@ class CInfoClock
|
|||||||
int time_width;
|
int time_width;
|
||||||
int time_height;
|
int time_height;
|
||||||
void paintTime( bool show_dot);
|
void paintTime( bool show_dot);
|
||||||
|
int y,x;
|
||||||
static void CleanUpProc(void* arg);
|
static void CleanUpProc(void* arg);
|
||||||
static void* TimerProc(void *arg);
|
static void* TimerProc(void *arg);
|
||||||
|
|
||||||
|
@@ -69,9 +69,9 @@ void CTimeOSD::show(time_t time_show)
|
|||||||
void CTimeOSD::GetDimensions()
|
void CTimeOSD::GetDimensions()
|
||||||
{
|
{
|
||||||
m_xstart = g_settings.screen_StartX + 10;
|
m_xstart = g_settings.screen_StartX + 10;
|
||||||
m_xend = g_settings.screen_EndX - 10;
|
m_xend = frameBuffer->getScreenWidth();
|
||||||
m_height = g_Font[TIMEOSD_FONT]->getHeight();
|
m_height = g_Font[TIMEOSD_FONT]->getHeight();
|
||||||
m_y = g_settings.screen_StartY + 10;
|
m_y = frameBuffer->getScreenY();
|
||||||
m_width = g_Font[TIMEOSD_FONT]->getRenderWidth("00:00:00");
|
m_width = g_Font[TIMEOSD_FONT]->getRenderWidth("00:00:00");
|
||||||
if(g_settings.mode_clock) {
|
if(g_settings.mode_clock) {
|
||||||
int x1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number);
|
int x1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number);
|
||||||
@@ -127,11 +127,11 @@ void CTimeOSD::updatePos(short runningPercent)
|
|||||||
void CTimeOSD::hide()
|
void CTimeOSD::hide()
|
||||||
{
|
{
|
||||||
GetDimensions();
|
GetDimensions();
|
||||||
printf("CTimeOSD::hide: x %d y %d xend %d yend %d\n", m_xstart, m_y , m_xend - (g_settings.mode_clock ? 35 : 0), m_height + 15);
|
printf("CTimeOSD::hide: x %d y %d xend %d yend %d\n", m_xstart, m_y , m_xend - (g_settings.mode_clock ? m_width-5 : 0), m_height + 15);
|
||||||
if(!visible)
|
if(!visible)
|
||||||
return;
|
return;
|
||||||
//frameBuffer->paintBackgroundBoxRel(m_xstart-10, m_y - 10 , m_xend - (g_settings.mode_clock ? 35 : 0), m_height + 15);
|
//frameBuffer->paintBackgroundBoxRel(m_xstart-10, m_y - 10 , m_xend - (g_settings.mode_clock ? 35 : 0), m_height + 15);
|
||||||
frameBuffer->paintBackgroundBoxRel(m_xstart-2, m_y , m_xend - (g_settings.mode_clock ? 35 : 0), m_height + 15);
|
frameBuffer->paintBackgroundBoxRel(m_xstart-2, m_y , m_xend - (g_settings.mode_clock ? m_width-5 : 0), m_height + 15);
|
||||||
visible=false;
|
visible=false;
|
||||||
timescale->reset();
|
timescale->reset();
|
||||||
}
|
}
|
||||||
|
@@ -3714,11 +3714,16 @@ printf("CNeutrinoApp::setVolume dx %d dy %d\n", dx, dy);
|
|||||||
int vol = g_settings.current_volume;
|
int vol = g_settings.current_volume;
|
||||||
int sw = frameBuffer->getScreenWidth();
|
int sw = frameBuffer->getScreenWidth();
|
||||||
int sh = frameBuffer->getScreenHeight();
|
int sh = frameBuffer->getScreenHeight();
|
||||||
|
int clock_height = 0;
|
||||||
|
|
||||||
switch( g_settings.volume_pos )
|
switch( g_settings.volume_pos )
|
||||||
{
|
{
|
||||||
case 0:// upper right
|
case 0:// upper right
|
||||||
|
if(g_settings.mode_clock){
|
||||||
|
clock_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight();
|
||||||
|
}
|
||||||
x = sw - dx;
|
x = sw - dx;
|
||||||
|
y += clock_height;
|
||||||
break;
|
break;
|
||||||
case 1:// upper left
|
case 1:// upper left
|
||||||
break;
|
break;
|
||||||
@@ -3745,10 +3750,10 @@ printf("CNeutrinoApp::setVolume dx %d dy %d\n", dx, dy);
|
|||||||
if(pixbuf!= NULL)
|
if(pixbuf!= NULL)
|
||||||
frameBuffer->SaveScreen(x, y, dx, dy, pixbuf);
|
frameBuffer->SaveScreen(x, y, dx, dy, pixbuf);
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x , y , dx, dy, COL_INFOBAR_SHADOW_PLUS_1, g_settings.rounded_corners ? dy/2 : 0);
|
frameBuffer->paintBoxRel(x , y , dx, dy, COL_MENUCONTENT_PLUS_0, g_settings.rounded_corners ? dy/2 : 0);
|
||||||
frameBuffer->paintBoxRel (x + dy + (dy/4)-2, y+(dy/4)-2, ((dy/2)*12.5) +4, dy/2+4, COL_INFOBAR_PLUS_3);
|
frameBuffer->paintBoxRel (x + dy + (dy/4)-2, y+(dy/4)-2, ((dy/2)*12.5) +4, dy/2+4, COL_MENUCONTENT_PLUS_3);
|
||||||
frameBuffer->paintBoxRel (x + dy + (dy/4), y+(dy/4), (dy/2)*12.5, dy/2, COL_INFOBAR_PLUS_0);
|
frameBuffer->paintBoxRel (x + dy + (dy/4), y+(dy/4), (dy/2)*12.5, dy/2, COL_MENUCONTENT_PLUS_1);
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_VOLUME,x+dy/2,y+(dy/4), 0, COL_INFOBAR);
|
frameBuffer->paintIcon(NEUTRINO_ICON_VOLUME,x+dy/2,y+(dy/4), 0, COL_MENUCONTENT_PLUS_0);
|
||||||
|
|
||||||
g_volscale->reset();
|
g_volscale->reset();
|
||||||
g_volscale->paintProgressBar2(x + dy+ (dy/4), y +(dy/4), g_settings.current_volume);
|
g_volscale->paintProgressBar2(x + dy+ (dy/4), y +(dy/4), g_settings.current_volume);
|
||||||
|
Reference in New Issue
Block a user