aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextButton.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2012-10-02 12:24:47 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2012-10-03 08:27:16 (GMT)
commit7b6ab828c7e5453a2720462156d165707935c9ef (patch)
tree3b641791b20b1994935e149fd7461decb11bef8c /src/FbTk/TextButton.hh
parent032a23d1e790c5224194562a837cc80fc157ce9b (diff)
downloadfluxbox_pavel-7b6ab828c7e5453a2720462156d165707935c9ef.zip
fluxbox_pavel-7b6ab828c7e5453a2720462156d165707935c9ef.tar.bz2
Improved vertical alignment of text in FbTk::TextButton
The old formula for vertical align text inside FbTk::TextButton ('height/2 + font_ascent/2 - 1') produced not always good looking results, escpecially when different fonts are involved (eg, ClockTool and WorkspaceName have different fonts and font-sizes). '(height - font_ascent) / 2 - 1' produces better results. Additional changes: * added ASCII-Art to document the involved entities when calculating the baseline * rewritten tests/testFont.cc to accept multiples texts and multiple fonts * removed some internal parts of FbTk::Font from the public interface
Diffstat (limited to 'src/FbTk/TextButton.hh')
-rw-r--r--src/FbTk/TextButton.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh
index a1c8b0e..eb0beca 100644
--- a/src/FbTk/TextButton.hh
+++ b/src/FbTk/TextButton.hh
@@ -56,7 +56,8 @@ public:
56 56
57 void exposeEvent(XExposeEvent &event); 57 void exposeEvent(XExposeEvent &event);
58 58
59 void renderForeground(FbDrawable &drawable); 59 //void renderForeground(FbDrawable &drawable);
60 void renderForeground(FbWindow &win, FbDrawable &drawable);
60 61
61 FbTk::Justify justify() const { return m_justify; } 62 FbTk::Justify justify() const { return m_justify; }
62 const BiDiString &text() const { return m_text; } 63 const BiDiString &text() const { return m_text; }
@@ -65,7 +66,6 @@ public:
65 unsigned int textWidth() const; 66 unsigned int textWidth() const;
66 int bevel() const { return m_bevel; } 67 int bevel() const { return m_bevel; }
67 68
68 void renderForeground(FbWindow &win, FbDrawable &drawable);
69 69
70protected: 70protected:
71 virtual void drawText(int x_offset, int y_offset, FbDrawable *drawable_override); 71 virtual void drawText(int x_offset, int y_offset, FbDrawable *drawable_override);