diff --git a/TODO b/TODO index 3f0dc77..44f9b7d 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -* Continue rebasing from 1d9590907eb3a8cc298f660c1436d0e90808d684 +* Continue rebasing from 2f431b404983b49adfd3cca1c39a9b0a9616e70d * Add a focus listener interface. * Make focus apply synchronously. * Graphics and input objects for DirectX. diff --git a/src/widgets/checkbox.cpp b/src/widgets/checkbox.cpp index bf733e6..64e6fb5 100644 --- a/src/widgets/checkbox.cpp +++ b/src/widgets/checkbox.cpp @@ -99,16 +99,15 @@ namespace gcn else graphics->setColor(Color(128, 128, 128)); - int h = getHeight() + getHeight() / 2; + const int h = getHeight() + getHeight() / 2; graphics->drawText(getCaption(), h - 2, 0); } void CheckBox::drawBox(Graphics* graphics) { - int h = getHeight() - 2; - - int alpha = getBaseColor().a; + const int h = getHeight() - 2; + const int alpha = getBaseColor().a; Color faceColor = getBaseColor(); faceColor.a = alpha; Color highlightColor = faceColor + 0x303030; diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 37e6cef..e197bab 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -70,8 +70,7 @@ namespace gcn : mImage(0) , mInternalImage(false) { - setWidth(0); - setHeight(0); + setSize(0, 0); } Icon::Icon(const std::string& filename) @@ -80,16 +79,14 @@ namespace gcn { mImage = Image::load(filename); mInternalImage = true; - setHeight(mImage->getHeight()); - setWidth(mImage->getWidth()); + setSize(mImage->getWidth(), mImage->getHeight()); } Icon::Icon(const Image* image) : mImage(image), mInternalImage(false) { - setHeight(mImage->getHeight()); - setWidth(mImage->getWidth()); + setSize(mImage->getWidth(), mImage->getHeight()); } Icon::~Icon() @@ -109,6 +106,7 @@ namespace gcn mImage = image; mInternalImage = false; + setSize(mImage->getWidth(), mImage->getHeight()); } const Image* Icon::getImage() const