From 94817cbb43a96bb9bfa26933724570d9a1ad7e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Mon, 7 Apr 2014 21:10:56 +0300 Subject: [PATCH] libappfw|LabelWidget: Content size available as rules --- doomsday/libappfw/include/de/widgets/labelwidget.h | 3 +++ doomsday/libappfw/src/widgets/labelwidget.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/doomsday/libappfw/include/de/widgets/labelwidget.h b/doomsday/libappfw/include/de/widgets/labelwidget.h index f9fc4fc9ff..0847d58cce 100644 --- a/doomsday/libappfw/include/de/widgets/labelwidget.h +++ b/doomsday/libappfw/include/de/widgets/labelwidget.h @@ -101,6 +101,9 @@ class LIBAPPFW_PUBLIC LabelWidget : public GuiWidget, public AssetGroup */ Vector2ui textSize() const; + Rule const &contentWidth() const; + Rule const &contentHeight() const; + /** * Sets the gap between the text and image. Defaults to "label.gap". * diff --git a/doomsday/libappfw/src/widgets/labelwidget.cpp b/doomsday/libappfw/src/widgets/labelwidget.cpp index 42ba3173c9..0a45bbb15e 100644 --- a/doomsday/libappfw/src/widgets/labelwidget.cpp +++ b/doomsday/libappfw/src/widgets/labelwidget.cpp @@ -601,6 +601,16 @@ Vector2ui LabelWidget::textSize() const return d->textSize(); } +Rule const &LabelWidget::contentWidth() const +{ + return *d->width; +} + +Rule const &LabelWidget::contentHeight() const +{ + return *d->height; +} + void LabelWidget::setTextGap(DotPath const &styleRuleId) { d->gapId = styleRuleId;