Skip to content

Commit

Permalink
Use forced fonts (ie, the currently recording font on the playback sc…
Browse files Browse the repository at this point in the history
…reen) for

drop shadows, too.


git-svn-id: http://svn.mythtv.org/svn/trunk@1783 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
Isaac Richards committed Jul 1, 2003
1 parent 30df17e commit a8a7ed7
Showing 1 changed file with 45 additions and 36 deletions.
81 changes: 45 additions & 36 deletions mythtv/libs/libmyth/uitypes.cpp
Expand Up @@ -1054,31 +1054,39 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
QString tempWrite;
int left = 0;
fontProp *tmpfont = NULL;
if (m_active == true)
tmpfont = &m_fontfcns[m_fonts["active"]];
else
tmpfont = &m_fontfcns[m_fonts["inactive"]];
bool lastShown = true;
QPoint fontdrop = tmpfont->shadowOffset;

dr->setFont(tmpfont->face);
QPoint fontdrop = QPoint(0, 0);

if (m_debug == true)
cerr << " +UIListType::Draw() <- within Layer\n";

for (int i = 0; i < m_count; i++)
{
if (m_active == true)
tmpfont = &m_fontfcns[m_fonts["active"]];
else
tmpfont = &m_fontfcns[m_fonts["inactive"]];

if (forceFonts[i] != "")
tmpfont = &m_fontfcns[forceFonts[i]];

fontdrop = tmpfont->shadowOffset;

dr->setFont(tmpfont->face);

left = m_area.left();
for (int j = 1; j <= m_columns; j++)
{
if (j > 1 && lastShown == true)
left = left + columnWidth[j - 1] + m_pad;

if (m_debug == true)
{
cerr << " -Column #" << j << ", Column Context: " << columnContext[j]
{
cerr << " -Column #" << j
<< ", Column Context: " << columnContext[j]
<< ", Draw Context: " << context << endl;
}

if (columnContext[j] != context && columnContext[j] != -1)
{
lastShown = false;
Expand All @@ -1090,33 +1098,32 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
if (tempWrite != "***FILLER***")
{
if (columnWidth[j] > 0)
tempWrite = cutDown(tempWrite, &(tmpfont->face), false, columnWidth[j]);
tempWrite = cutDown(tempWrite, &(tmpfont->face),
false, columnWidth[j]);
}
else
tempWrite = "";

if (fontdrop.x() != 0 || fontdrop.y() != 0)
{
dr->setBrush(tmpfont->dropColor);
dr->setPen(QPen(tmpfont->dropColor, (int)(2 * m_wmult)));
dr->setPen(QPen(tmpfont->dropColor,
(int)(2 * m_wmult)));
dr->drawText((int)(left + fontdrop.x()),
(int)(m_area.top() + (int)(i*m_selheight) + fontdrop.y()),
m_area.width(), m_selheight, m_justification, tempWrite);
(int)(m_area.top() + (int)(i*m_selheight) +
fontdrop.y()), m_area.width(), m_selheight,
m_justification, tempWrite);
}
dr->setBrush(tmpfont->color);
dr->setPen(QPen(tmpfont->color, (int)(2 * m_wmult)));
if (forceFonts[i] != "")
{
dr->setFont(m_fontfcns[forceFonts[i]].face);
QColor myColor = m_fontfcns[forceFonts[i]].color;
dr->setBrush(myColor);
dr->setPen(QPen(myColor, (int)(2 * m_wmult)));
}

dr->drawText(left, m_area.top() + (int)(i*m_selheight),
m_area.width(), m_selheight, m_justification, tempWrite);
m_area.width(), m_selheight, m_justification,
tempWrite);
dr->setFont(tmpfont->face);
if (m_debug == true)
cerr << " +UIListType::Draw() Data: " << tempWrite << "\n";
cerr << " +UIListType::Draw() Data: "
<< tempWrite << "\n";
lastShown = true;
}
}
Expand All @@ -1137,13 +1144,18 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
tmpfont = &m_fontfcns[m_fonts["selected"]];
else
tmpfont = &m_fontfcns[m_fonts["inactive"]];

if (forceFonts[i] != "")
tmpfont = &m_fontfcns[forceFonts[i]];

bool lastShown = true;
QPoint fontdrop = tmpfont->shadowOffset;

dr->setFont(tmpfont->face);
dr->drawPixmap(m_area.left() + m_selection_loc.x(),
m_area.top() + m_selection_loc.y() + (int)(m_current * m_selheight),
m_selection);
m_area.top() + m_selection_loc.y() +
(int)(m_current * m_selheight),
m_selection);

left = m_area.left();
for (int j = 1; j <= m_columns; j++)
Expand All @@ -1153,7 +1165,8 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)

if (m_debug == true)
{
cerr << " -Column #" << j << ", Column Context: " << columnContext[j]
cerr << " -Column #" << j
<< ", Column Context: " << columnContext[j]
<< ", Draw Context: " << context << endl;
}
if (columnContext[j] != context && columnContext[j] != -1)
Expand All @@ -1165,28 +1178,24 @@ void UIListType::Draw(QPainter *dr, int drawlayer, int context)
tempWrite = listData[i + (int)(100*j)];

if (columnWidth[j] > 0)
tempWrite = cutDown(tempWrite, &(tmpfont->face), false, columnWidth[j]);
tempWrite = cutDown(tempWrite, &(tmpfont->face), false,
columnWidth[j]);

if (fontdrop.x() != 0 || fontdrop.y() != 0)
{
dr->setBrush(tmpfont->dropColor);
dr->setPen(QPen(tmpfont->dropColor, (int)(2 * m_wmult)));
dr->drawText((int)(left + fontdrop.x()),
(int)(m_area.top() + (int)(i*m_selheight) + fontdrop.y()),
m_area.width(), m_selheight, m_justification, tempWrite);
(int)(m_area.top() + (int)(i*m_selheight) +
fontdrop.y()), m_area.width(), m_selheight,
m_justification, tempWrite);
}
dr->setBrush(tmpfont->color);
dr->setPen(QPen(tmpfont->color, (int)(2 * m_wmult)));
if (forceFonts[i] != "")
{
dr->setFont(m_fontfcns[forceFonts[i]].face);
QColor myColor = m_fontfcns[forceFonts[i]].color;
dr->setBrush(myColor);
dr->setPen(QPen(myColor, (int)(2 * m_wmult)));
}

dr->drawText(left, m_area.top() + (int)(i*m_selheight),
m_area.width(), m_selheight, m_justification, tempWrite);
m_area.width(), m_selheight, m_justification,
tempWrite);

dr->setFont(tmpfont->face);
}
Expand Down

0 comments on commit a8a7ed7

Please sign in to comment.