new render system in effect. now ot make it look right
This commit is contained in:
parent
46441f7d60
commit
e64d90be4d
6 changed files with 18 additions and 10 deletions
12
otk/font.cc
12
otk/font.cc
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue