summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-11-28 22:12:00 +0100
committerJan Holesovsky <kendy@collabora.com>2018-12-10 12:37:18 +0100
commit8852f1170aae61471f04528de44db5da9ac2490e (patch)
treee2eeef9f5cfbee839b756fcde37723e943881831 /vcl
parent34ba7f337cb93dbc0bb628f2ff0ba0c0f9fc2d48 (diff)
custom widgets: Better way to find out whether to use the 'stock' theming.
Change-Id: I75ea7b2d407d3acfd3094f17509c89240c48f50a
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/builder.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index f40ac4696481..fb9ed2e014c1 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -804,9 +804,6 @@ namespace
xWindow = VclPtr<PushButton>::Create(pParent, nBits);
xWindow->SetText(getStockText(sType));
}
- PushButton* pPushButton = dynamic_cast<PushButton*>(xWindow.get());
- if (pPushButton)
- pPushButton->setStock(true);
}
if (!xWindow)
@@ -2160,17 +2157,23 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader)
}
}
+ bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr;
+
//To-Do make reorder a virtual in Window, move this foo
//there and see above
std::vector<vcl::Window*> aChilds;
for (vcl::Window* pChild = pCurrentChild->GetWindow(GetWindowType::FirstChild); pChild;
pChild = pChild->GetWindow(GetWindowType::Next))
{
+ if (bIsButtonBox)
+ {
+ if (PushButton* pPushButton = dynamic_cast<PushButton*>(pChild))
+ pPushButton->setStock(true);
+ }
+
aChilds.push_back(pChild);
}
- bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr;
-
//sort child order within parent so that tabbing
//between controls goes in a visually sensible sequence
std::stable_sort(aChilds.begin(), aChilds.end(), sortIntoBestTabTraversalOrder(this));