aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-08-29 08:33:13 (GMT)
committerrathnor <rathnor>2004-08-29 08:33:13 (GMT)
commit97ef84da598aed61a6cb57a62796f302043181e8 (patch)
treefd68f9ef6703322537eca3743c3217b281d6ce7c /src/FbTk
parent8a59b9b4541490badaf3e1a0503b4ca5f0105c8f (diff)
downloadfluxbox-97ef84da598aed61a6cb57a62796f302043181e8.zip
fluxbox-97ef84da598aed61a6cb57a62796f302043181e8.tar.bz2
a few random fixes
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc11
-rw-r--r--src/FbTk/MenuItem.cc5
-rw-r--r--src/FbTk/XftFontImp.cc7
3 files changed, 16 insertions, 7 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 18c3b75..5fe8e36 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.cc,v 1.74 2004/08/28 19:03:09 rathnor Exp $ 25// $Id: Menu.cc,v 1.75 2004/08/29 08:33:13 rathnor Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -777,12 +777,14 @@ void Menu::redrawTitle() {
777 0, 0, 777 0, 0,
778 m_title_pm.width(), m_title_pm.height()); 778 m_title_pm.width(), m_title_pm.height());
779 779
780 // difference between height based on font, and style-set height
781 int height_offset = theme().titleHeight() - (font.height() + 2*theme().bevelWidth());
780 menu.title.updateTransparent(); 782 menu.title.updateTransparent();
781 font.drawText(m_real_title_pm.drawable(), // drawable 783 font.drawText(m_real_title_pm.drawable(), // drawable
782 screenNumber(), 784 screenNumber(),
783 theme().titleTextGC().gc(), // graphic context 785 theme().titleTextGC().gc(), // graphic context
784 text, len, // text string with lenght 786 text, len, // text string with length
785 dx, theme().titleHeight()/2 + (font.ascent() - theme().bevelWidth())/2); // position 787 dx, font.ascent() + theme().bevelWidth() + height_offset/2); // position
786} 788}
787 789
788 790
@@ -1196,6 +1198,9 @@ void Menu::motionNotifyEvent(XMotionEvent &me) {
1196 int sbl = (me.x / menu.item_w), 1198 int sbl = (me.x / menu.item_w),
1197 i = (me.y / theme().itemHeight()), 1199 i = (me.y / theme().itemHeight()),
1198 w = (sbl * menu.persub) + i; 1200 w = (sbl * menu.persub) + i;
1201
1202 if (w == m_active_index)
1203 return;
1199 1204
1200 if (validIndex(m_active_index) && w != m_active_index) { 1205 if (validIndex(m_active_index) && w != m_active_index) {
1201 1206
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc
index 898bf99..ee1db93 100644
--- a/src/FbTk/MenuItem.cc
+++ b/src/FbTk/MenuItem.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: MenuItem.cc,v 1.5 2004/08/03 21:31:31 fluxgen Exp $ 22// $Id: MenuItem.cc,v 1.6 2004/08/29 08:33:13 rathnor Exp $
23 23
24#include "MenuItem.hh" 24#include "MenuItem.hh"
25#include "Command.hh" 25#include "Command.hh"
@@ -91,7 +91,8 @@ void MenuItem::draw(FbDrawable &draw,
91 91
92 int text_w = theme.frameFont().textWidth(label().c_str(), label().size()); 92 int text_w = theme.frameFont().textWidth(label().c_str(), label().size());
93 93
94 text_y = y - theme.bevelWidth()/2 + theme.frameFont().ascent()/2 + height/2; 94 int height_offset = theme.itemHeight() - (theme.frameFont().height() + 2*theme.bevelWidth());
95 text_y = y + theme.bevelWidth() + theme.frameFont().ascent() + height_offset/2; ///2 + height/2;
95 96
96 switch(theme.frameFontJustify()) { 97 switch(theme.frameFontJustify()) {
97 case FbTk::LEFT: 98 case FbTk::LEFT:
diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc
index c698238..c2f1dc8 100644
--- a/src/FbTk/XftFontImp.cc
+++ b/src/FbTk/XftFontImp.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: XftFontImp.cc,v 1.3 2004/08/10 11:57:35 fluxgen Exp $ 22//$Id: XftFontImp.cc,v 1.4 2004/08/29 08:33:13 rathnor Exp $
23 23
24#include "XftFontImp.hh" 24#include "XftFontImp.hh"
25#include "App.hh" 25#include "App.hh"
@@ -157,7 +157,10 @@ unsigned int XftFontImp::textWidth(const char * const text, unsigned int len) co
157unsigned int XftFontImp::height() const { 157unsigned int XftFontImp::height() const {
158 if (m_xftfont == 0) 158 if (m_xftfont == 0)
159 return 0; 159 return 0;
160 return m_xftfont->height; 160 return m_xftfont->height;
161 //m_xftfont->ascent + m_xftfont->descent;
162 // curiously, fonts seem to have a smaller height, but the "height"
163 // is specified within the actual font, so it must be right, right?
161} 164}
162 165
163}; // end namespace FbTk 166}; // end namespace FbTk