]> Dogcows Code - chaz/openbox/commitdiff
new render system in effect. now ot make it look right
authorDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 01:44:01 +0000 (01:44 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 23 Jan 2003 01:44:01 +0000 (01:44 +0000)
otk/font.cc
otk/font.hh
otk/renderstyle.cc
src/buttonwidget.cc
src/frame.cc
src/labelwidget.cc

index 21b9bfb060d505d9cf2e9e66958c01bd197a286a..4fc09fcfdbad1fee17e0a615ecff4e371cb792e8 100644 (file)
@@ -82,7 +82,7 @@ Font::~Font(void)
 }
 
 
-unsigned int Font::measureString(const ustring &string) const
+int Font::measureString(const ustring &string) const
 {
   XGlyphInfo info;
 
@@ -93,19 +93,19 @@ unsigned int Font::measureString(const ustring &string) const
     XftTextExtents8(**display, _xftfont,
                     (FcChar8*)string.c_str(), string.bytes(), &info);
 
-  return info.xOff + (_shadow ? _offset : 0);
+  return (signed) info.xOff + (_shadow ? _offset : 0);
 }
 
 
-unsigned int Font::height(void) const
+int Font::height(void) const
 {
-  return _xftfont->height + (_shadow ? _offset : 0);
+  return (signed) _xftfont->height + (_shadow ? _offset : 0);
 }
 
 
-unsigned int Font::maxCharWidth(void) const
+int Font::maxCharWidth(void) const
 {
-  return _xftfont->max_advance_width;
+  return (signed) _xftfont->max_advance_width;
 }
 
 }
index afc36deafa06f4599e19e049cc7c745ee41f3d17..16c47f27aed9f2c5c2c28e4cdcc03561ba264209 100644 (file)
@@ -57,10 +57,10 @@ public:
 
   inline const std::string &fontstring() const { return _fontstring; }
 
-  unsigned int height() const;
-  unsigned int maxCharWidth() const;
+  int height() const;
+  int maxCharWidth() const;
 
-  unsigned int measureString(const ustring &string) const;
+  int measureString(const ustring &string) const;
 
   // The RenderControl classes use the internal data to render the fonts, but
   // noone else needs it, so its private.
index c1d5685ed54809bd0fc37ccfd4ab6d2160da4bbe..7e8b6446539b5eb5351e172a6dc3bac3cd08773b 100644 (file)
@@ -168,6 +168,7 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)
                                     0x0);
 
   _label_font = new Font(_screen, "Arial,Sans-9:bold", true, 1, 0x40);
+  _label_justify = RightJustify;
 
   _max_mask = new PixmapMask();
   _max_mask->w = _max_mask->h = 8;
@@ -208,6 +209,9 @@ RenderStyle::RenderStyle(int screen, const std::string &stylefile)
                             display->screenInfo(_screen)->rootWindow(),
                             data, 8, 8);
   }
+
+  _bevel_width = 1;
+  _handle_width = 4;
 }
 
 RenderStyle::~RenderStyle()
index 4c1bd908d0d73958bdec7921efc91fd1e3559178..53a7ffd501a025e1d3a7e3921d7fa16a4d7a4fc7 100644 (file)
@@ -80,6 +80,7 @@ void ButtonWidget::setStyle(otk::RenderStyle *style)
 void ButtonWidget::update()
 {
   printf("ButtonWidget::update()\n");
+  otk::Widget::update();
 }
 
 void ButtonWidget::renderForeground()
@@ -88,6 +89,7 @@ void ButtonWidget::renderForeground()
   int width;
   bool draw = _dirty;
 
+  printf("ButtonWidget::renderForeground()\n");
   otk::Widget::renderForeground();
 
   if (draw) {
index e186e898020acac07cb9877a7dbc63e71682583a..cd73f29ad1addc9db3cefec49d0776d765691d92 100644 (file)
@@ -153,7 +153,7 @@ void Frame::adjustSize()
     _titlebar.setGeometry(-bwidth,
                           -bwidth,
                           width,
-                          _style->labelFont()->height() + bevel * 2);
+                          _style->labelFont()->height() + (bevel * 2));
     _innersize.top += _titlebar.height() + bwidth;
 
     // set the label size
index e45a8835ece099ab3627fa82d6d49cc0a55abced..becb62ed01cf0dd37df3fcd9442d04e19dd3e101 100644 (file)
@@ -70,6 +70,7 @@ void LabelWidget::unfocus()
 void LabelWidget::update()
 {
   printf("LabelWidget::update()\n");
+  otk::Widget::update();
 }
 
 
@@ -77,6 +78,7 @@ void LabelWidget::renderForeground()
 {
   bool draw = _dirty;
 
+  printf("LabelWidget::renderForeground()\n");
   otk::Widget::renderForeground();
 
   if (draw) {
This page took 0.031093 seconds and 4 git commands to generate.