Fixes for TextDialog and ToolTipWindow style rendering bugs.

Commits fd6fbb80e7a6c1d62d696a4f598edc1101b13194 and
822c02e96a88a90540fa622afa5ab196b9ba5a7c.
This commit is contained in:
dcoppa 2011-05-23 09:13:36 +00:00
parent ef45bee41f
commit 3b99c5f001
3 changed files with 129 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.53 2011/05/11 10:05:42 dcoppa Exp $
# $OpenBSD: Makefile,v 1.54 2011/05/23 09:13:36 dcoppa Exp $
COMMENT= window manager based on the original Blackbox code
DISTNAME= fluxbox-1.3.1
REVISION= 1
REVISION= 2
CATEGORIES= x11

View File

@ -0,0 +1,94 @@
$OpenBSD: patch-src_TextDialog_cc,v 1.1 2011/05/23 09:13:36 dcoppa Exp $
Fixes for TextDialog and ToolTipWindow style rendering bugs
(commits fd6fbb80e7a6c1d62d696a4f598edc1101b13194 and
822c02e96a88a90540fa622afa5ab196b9ba5a7c)
--- src/TextDialog.cc.orig Sun May 22 19:28:13 2011
+++ src/TextDialog.cc Sun May 22 19:28:33 2011
@@ -44,7 +44,7 @@ TextDialog::TextDialog(BScreen &screen,
const string &title) :
FbTk::FbWindow(screen.rootWindow().screenNumber(), 0, 0, 200, 1, ExposureMask),
m_textbox(*this, screen.focusedWinFrameTheme()->font(), ""),
- m_label(*this, screen.focusedWinFrameTheme()->font(), title),
+ m_label(*this, screen.focusedWinFrameTheme()->iconbarTheme().text().font(), title),
m_gc(m_textbox),
m_screen(screen),
m_move_x(0),
@@ -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() {
@@ -156,6 +165,7 @@ void TextDialog::init() {
// we listen to motion notify too
m_label.setEventMask(m_label.eventMask() | ButtonPressMask | ButtonMotionMask);
m_label.setGC(m_screen.focusedWinFrameTheme()->iconbarTheme().text().textGC());
+ m_label.setJustify(m_screen.focusedWinFrameTheme()->iconbarTheme().text().justify());
m_label.show();
// setup text box
@@ -167,11 +177,15 @@ void TextDialog::init() {
m_textbox.show();
// setup this window
- setBorderWidth(1);
- setBackgroundColor(white);
- // move to center of the screen
- move((m_screen.width() - width())/2, (m_screen.height() - height())/2);
+ setBorderWidth(m_screen.focusedWinFrameTheme()->border().width());
+ setBorderColor(m_screen.focusedWinFrameTheme()->border().color());
+ // move to center of the current head
+ unsigned int head = m_screen.getCurrHead();
+ move(m_screen.getHeadX(head) + (m_screen.getHeadWidth(head) - width()) / 2,
+ m_screen.getHeadY(head) + (m_screen.getHeadHeight(head) - height()) / 2);
+
+
updateSizes();
resize(width(), m_textbox.height() + m_label.height());
@@ -185,6 +199,6 @@ void TextDialog::updateSizes() {
m_label.moveResize(0, 0,
width(), m_textbox.font().height() + 2);
- m_textbox.moveResize(2, m_label.height(),
- width() - 4, m_textbox.font().height() + 2);
+ m_textbox.moveResize(0, m_label.height(),
+ width(), m_textbox.font().height() + 2);
}

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-src_TooltipWindow_cc,v 1.1 2011/05/23 09:13:36 dcoppa Exp $
Fixes for TextDialog and ToolTipWindow style rendering bugs
(commits fd6fbb80e7a6c1d62d696a4f598edc1101b13194 and
822c02e96a88a90540fa622afa5ab196b9ba5a7c)
--- src/TooltipWindow.cc.orig Thu Sep 9 14:39:18 2010
+++ src/TooltipWindow.cc Sun May 22 19:20:51 2011
@@ -55,8 +55,8 @@ void TooltipWindow::raiseTooltip() {
resize(m_lastText);
reconfigTheme();
- int h = theme()->font().height() + theme()->bevelWidth() * 2;
- int w = theme()->font().textWidth(m_lastText) + theme()->bevelWidth() * 2;
+ int h = theme()->iconbarTheme().text().font().height() + theme()->bevelWidth() * 2;
+ int w = theme()->iconbarTheme().text().font().textWidth(m_lastText) + theme()->bevelWidth() * 2;
Window root_ret; // not used
Window window_ret; // not used
@@ -90,11 +90,11 @@ void TooltipWindow::raiseTooltip() {
show();
clear();
- theme()->font().drawText(*this, screen().screenNumber(),
+ theme()->iconbarTheme().text().font().drawText(*this, screen().screenNumber(),
theme()->iconbarTheme().text().textGC(),
m_lastText,
theme()->bevelWidth(),
- theme()->bevelWidth() + theme()->font().ascent());
+ theme()->bevelWidth() + theme()->iconbarTheme().text().font().ascent());
}
void TooltipWindow::updateText(const FbTk::BiDiString& text) {