diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-19 16:15:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-19 16:17:25 +0100 |
commit | 3305fd648f9f17145620954e24ade4d4ea62d60f (patch) | |
tree | 7ce50f68b48ddf2810438f63ae77b2d43dbb0c60 /vcl/source | |
parent | b163772e77e64261b62a9e8196799a499e4ef77d (diff) |
Only do the WB_TOP hack for radiobuttons
RadioButtons are the only ones abusing WB_TOP for image align, so only set it
for those.
Change-Id: Ie616b132c6771c4233295703ee56e60131c477cf
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/button.cxx | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 2c447a481906..8b89cd6bee8a 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -610,36 +610,15 @@ bool Button::set_property(const OString &rKey, const OString &rValue) if (rKey == "image-position") { ImageAlign eAlign = IMAGEALIGN_LEFT; - WinBits nBits = GetStyle(); if (rValue == "left") - { - nBits &= ~(WB_CENTER | WB_RIGHT); - nBits |= WB_LEFT; eAlign = IMAGEALIGN_LEFT; - } else if (rValue == "right") - { - nBits &= ~(WB_CENTER | WB_LEFT); - nBits |= WB_RIGHT; eAlign = IMAGEALIGN_RIGHT; - } else if (rValue == "top") - { - nBits &= ~(WB_VCENTER | WB_BOTTOM); - nBits |= WB_TOP; eAlign = IMAGEALIGN_TOP; - } else if (rValue == "bottom") - { - nBits &= ~(WB_VCENTER | WB_TOP); - nBits |= WB_BOTTOM; eAlign = IMAGEALIGN_BOTTOM; - } SetImageAlign(eAlign); - //Its rather mad to have to set these bits when there is the other - //image align. Looks like e.g. the radiobuttons etc weren't converted - //over to image align fully. - SetStyle(nBits); } else return Control::set_property(rKey, rValue); @@ -2886,6 +2865,36 @@ bool RadioButton::set_property(const OString &rKey, const OString &rValue) { if (rKey == "active") SetState(toBool(rValue)); + else if (rKey == "image-position") + { + WinBits nBits = GetStyle(); + if (rValue == "left") + { + nBits &= ~(WB_CENTER | WB_RIGHT); + nBits |= WB_LEFT; + } + else if (rValue == "right") + { + nBits &= ~(WB_CENTER | WB_LEFT); + nBits |= WB_RIGHT; + } + else if (rValue == "top") + { + nBits &= ~(WB_VCENTER | WB_BOTTOM); + nBits |= WB_TOP; + } + else if (rValue == "bottom") + { + nBits &= ~(WB_VCENTER | WB_TOP); + nBits |= WB_BOTTOM; + } + //Its rather mad to have to set these bits when there is the other + //image align. Looks like e.g. the radiobuttons etc weren't converted + //over to image align fully. + SetStyle(nBits); + //Deliberate to set the sane ImageAlign property + return Button::set_property(rKey, rValue); + } else return Button::set_property(rKey, rValue); return true; |