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.
nacitar sevaht nacitar@ubercpp.com
1 files changed,
20 insertions(+),
11 deletions(-)
jump to
M
src/TextDialog.cc
→
src/TextDialog.cc
@@ -135,19 +135,28 @@
} 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() {