diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-11-28 22:12:00 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-12-07 11:52:35 +0100 |
commit | bb05164545cfe7101db8fe300dde22d8bac3fc7d (patch) | |
tree | de3fd06647d36571968eadab1cee8554b8a12c52 /vcl/source | |
parent | 173953dd0ede08ad5972e48286f0d10e0d588733 (diff) |
custom widgets: Better way to find out whether to use the 'stock' theming.
Change-Id: I75ea7b2d407d3acfd3094f17509c89240c48f50a
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/builder.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 210c867c8e38..2f788ce989c4 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1200,9 +1200,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) @@ -2798,17 +2795,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)); |