TextDialog now handles parentrelative labels

Prior to this patch, TextDialog did not handle parentrelative labels;
borrowing code from OSDWindow, now TextDialog properly handles this.

Eventually, I plan to combine the good parts of TextDialog and OSDWindow
into OSDWindow, and then let TextDialog derive from OSDWindow... but for
now, here's the band-aid fix for the issue without the refactorization.
This commit is contained in:
nacitar sevaht 2011-05-16 15:05:30 -05:00 committed by Mathias Gumz
parent fd6fbb80e7
commit 822c02e96a

View file

@ -135,19 +135,28 @@ void TextDialog::keyPressEvent(XKeyEvent &event) {
}
void TextDialog::render() {
Pixmap tmp = m_pixmap;
if (!m_screen.focusedWinFrameTheme()->iconbarTheme().texture().usePixmap()) {
m_label.setBackgroundColor(m_screen.focusedWinFrameTheme()->iconbarTheme().texture().color());
m_pixmap = 0;
if (m_screen.focusedWinFrameTheme()->iconbarTheme().texture().type() &
FbTk::Texture::PARENTRELATIVE) {
if (!m_screen.focusedWinFrameTheme()->titleTexture().usePixmap()) {
m_pixmap = None;
m_label.setBackgroundColor(m_screen.focusedWinFrameTheme()->titleTexture().color());
} else {
m_pixmap = m_screen.imageControl().renderImage(m_label.width(), m_label.height(),
m_screen.focusedWinFrameTheme()->titleTexture());
m_label.setBackgroundPixmap(m_pixmap);
}
} else {
m_pixmap = m_screen.imageControl().renderImage(m_label.width(), m_label.height(),
m_screen.focusedWinFrameTheme()->iconbarTheme().texture());
m_label.setBackgroundPixmap(m_pixmap);
if (!m_screen.focusedWinFrameTheme()->iconbarTheme().texture().usePixmap()) {
m_pixmap = None;
m_label.setBackgroundColor(m_screen.focusedWinFrameTheme()->iconbarTheme().texture().color());
} else {
m_pixmap = m_screen.imageControl().renderImage(m_label.width(), m_label.height(),
m_screen.focusedWinFrameTheme()->iconbarTheme().texture());
m_label.setBackgroundPixmap(m_pixmap);
}
}
if (tmp)
m_screen.imageControl().removeImage(tmp);
if (m_pixmap)
m_screen.imageControl().removeImage(m_pixmap);
}
void TextDialog::init() {