aboutsummaryrefslogtreecommitdiff
path: root/src/TooltipWindow.cc
diff options
context:
space:
mode:
authornacitar sevaht <nacitar@ubercpp.com>2011-05-16 17:21:47 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-05-16 18:03:02 (GMT)
commitfd6fbb80e7a6c1d62d696a4f598edc1101b13194 (patch)
tree2407369a89a05c270916bef2172dc0337ada10f7 /src/TooltipWindow.cc
parent16c90dc19fcd68fccbcfb277b3839e7f41fe9dd3 (diff)
downloadfluxbox-fd6fbb80e7a6c1d62d696a4f598edc1101b13194.zip
fluxbox-fd6fbb80e7a6c1d62d696a4f598edc1101b13194.tar.bz2
TextDialog and ToolTipWindow style rendering bugs fixed
TextDialog windows (such as 'set title', or 'edit clock format') now properly render their titlebar to match the current style. Previously, the titlebar font settings were controlled by window.font.*, and this became apparent because window.font.effect needed to be set to put 'halo' on the titlebar of these TextDialogs. However, window.font.effect controls the effect on the text within the editbox on these as well, having these set in the same location is far from desirable. Specifically because the TextDialog essentially emulates the titlebar of other windows. So, after this change, window.font.effect still controls the text in the editbox, but the titlebar area is themed as the titlebars of other windows. Text justification of titlebar and border width, is now respected in TextDialog. Also, previously the edit box was sized in an odd way; one which left part of the window actually undrawn (so you'd get artifacts from whatever happened to be on the screen in that position when it opened); this has been addressed. TextDialogs, rather than going to the center of the entire desktop, now center on the _current head_, which prevents the awful positioning where half of the window is on one screen and half is on another. Lastly, when hovering your mouse over the iconbar button for a window with a title that's too wide to fit on the button, a tooltip is displayed. This tooltip themes itself to match the button, however it wasn't using the theme properly (similarly to how TextDialog was)... and as such, also wasn't using the proper font effects. This has been addressed just as it was for the TextDialog.
Diffstat (limited to 'src/TooltipWindow.cc')
-rw-r--r--src/TooltipWindow.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/TooltipWindow.cc b/src/TooltipWindow.cc
index 79d4163..0fb7273 100644
--- a/src/TooltipWindow.cc
+++ b/src/TooltipWindow.cc
@@ -55,8 +55,8 @@ void TooltipWindow::raiseTooltip() {
55 55
56 resize(m_lastText); 56 resize(m_lastText);
57 reconfigTheme(); 57 reconfigTheme();
58 int h = theme()->font().height() + theme()->bevelWidth() * 2; 58 int h = theme()->iconbarTheme().text().font().height() + theme()->bevelWidth() * 2;
59 int w = theme()->font().textWidth(m_lastText) + theme()->bevelWidth() * 2; 59 int w = theme()->iconbarTheme().text().font().textWidth(m_lastText) + theme()->bevelWidth() * 2;
60 60
61 Window root_ret; // not used 61 Window root_ret; // not used
62 Window window_ret; // not used 62 Window window_ret; // not used
@@ -90,11 +90,12 @@ void TooltipWindow::raiseTooltip() {
90 90
91 show(); 91 show();
92 clear(); 92 clear();
93 theme()->font().drawText(*this, screen().screenNumber(), 93 // TODO: make this use a TextButton like TextDialog does
94 theme()->iconbarTheme().text().font().drawText(*this, screen().screenNumber(),
94 theme()->iconbarTheme().text().textGC(), 95 theme()->iconbarTheme().text().textGC(),
95 m_lastText, 96 m_lastText,
96 theme()->bevelWidth(), 97 theme()->bevelWidth(),
97 theme()->bevelWidth() + theme()->font().ascent()); 98 theme()->bevelWidth() + theme()->iconbarTheme().text().font().ascent());
98} 99}
99 100
100void TooltipWindow::updateText(const FbTk::BiDiString& text) { 101void TooltipWindow::updateText(const FbTk::BiDiString& text) {