Skip to content

Commit

Permalink
libappfw: Minor ProceduralImage improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 17, 2016
1 parent b55b37e commit ec2820f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/sdk/libappfw/include/de/framework/proceduralimage.h
Expand Up @@ -63,6 +63,8 @@ class LIBAPPFW_PUBLIC ProceduralImage
virtual void glDeinit();
virtual void glMakeGeometry(DefaultVertexBuf::Builder &verts, Rectanglef const &rect) = 0;

DENG2_AS_IS_METHODS()

private:
Size _size;
Color _color;
Expand Down
10 changes: 10 additions & 0 deletions doomsday/sdk/libappfw/include/de/framework/styleproceduralimage.h
Expand Up @@ -43,6 +43,11 @@ class StyleProceduralImage : public ProceduralImage
}
}

GuiWidget &owner()
{
return _owner;
}

GuiRootWidget &root()
{
return _owner.root();
Expand All @@ -59,6 +64,11 @@ class StyleProceduralImage : public ProceduralImage
setSize(root().atlas().imageRect(_id).size());
}

Id const &allocId() const
{
return _id;
}

void glInit()
{
alloc();
Expand Down
2 changes: 2 additions & 0 deletions doomsday/sdk/libappfw/include/de/widgets/labelwidget.h
Expand Up @@ -84,6 +84,8 @@ class LIBAPPFW_PUBLIC LabelWidget : public GuiWidget, public AssetGroup
*/
void setImage(ProceduralImage *procImage);

ProceduralImage *image() const;

/**
* Sets an overlay image that gets drawn over the label contents.
*
Expand Down
5 changes: 5 additions & 0 deletions doomsday/sdk/libappfw/src/widgets/labelwidget.cpp
Expand Up @@ -623,6 +623,11 @@ void LabelWidget::setImage(ProceduralImage *procImage)
d->image.reset(procImage);
}

ProceduralImage *LabelWidget::image() const
{
return d->image.data();
}

void LabelWidget::setOverlayImage(ProceduralImage *overlayProcImage, ui::Alignment const &alignment)
{
d->overlayImage.reset(overlayProcImage);
Expand Down

0 comments on commit ec2820f

Please sign in to comment.