// tdf#142458 Measure the preferred width of an empty ScrolledWindow // to add to the width of the union of panel widths when calculating // the minimal width of the deck
mxVerticalScrollBar->set_hpolicy(VclPolicyType::NEVER);
mxVerticalScrollBar->set_vpolicy(VclPolicyType::NEVER);
mnScrolledWindowExtraWidth = mxVerticalScrollBar->get_preferred_size().Width();
mxVerticalScrollBar->set_hpolicy(VclPolicyType::AUTOMATIC);
mxVerticalScrollBar->set_vpolicy(VclPolicyType::AUTOMATIC);
}
// We have to explicitly trigger the destruction of panels. // Otherwise that is done by one of our base class destructors // without updating maPanels. for (auto& rpPanel : aPanels)
rpPanel.reset();
auto childrenNode = rJsonWriter.startArray("children"); for (constauto &it : maPanels)
{ // collapse the panel itself out auto xContent = it->GetContents(); if (!xContent) continue;
auto childNode = rJsonWriter.startStruct(); // JSDialog references widget by vcl id
rJsonWriter.put("id", it->GetContainer()->get_buildable_name());
rJsonWriter.put("name", it->GetId());
rJsonWriter.put("type", "panel");
rJsonWriter.put("text", it->GetTitle());
rJsonWriter.put("enabled", true);
rJsonWriter.put("hidden", it->IsLurking());
rJsonWriter.put("expanded", it->IsExpanded());
if (it->GetTitleBar() && !it->GetTitleBar()->GetMoreOptionsCommand().isEmpty())
rJsonWriter.put("command", it->GetTitleBar()->GetMoreOptionsCommand());
{ auto children2Node = rJsonWriter.startArray("children");
{ auto child2Node = rJsonWriter.startStruct();
xContent->get_property_tree(rJsonWriter);
}
}
}
}
// First hide old panels we don't need just now. for (auto& rpPanel : maPanels)
{ bool bFound = false; for (constauto & i : rPanelContainer)
bFound = bFound || (rpPanel.get() == i.get()); if (!bFound) // this one didn't survive.
{
rpPanel->SetLurkMode(true);
aHiddens.push_back(rpPanel);
}
}
if (mnMinimalWidth)
{ // tdf#142458 at this point mnMinimalWidth contains the width required // by the panels, but extra space may be needed by the scrolledwindow // that will contain the panels
mnMinimalWidth += mnScrolledWindowExtraWidth;
}
}
// Get vertical extent of the panel.
tools::Rectangle aExtents; if (!rPanel.get_extents(aExtents)) return;
auto nPanelTop = aExtents.Top(); auto nPanelBottom = aExtents.Bottom() - 1;
// Determine what the new thumb position should be like. // When the whole panel does not fit then make its top visible // and it off at the bottom.
sal_Int32 nNewThumbPos(mxVerticalScrollBar->vadjustment_get_value()); if (nPanelBottom >= nNewThumbPos + mxVerticalScrollBar->vadjustment_get_page_size())
nNewThumbPos = nPanelBottom - mxVerticalScrollBar->vadjustment_get_page_size(); if (nPanelTop < nNewThumbPos)
nNewThumbPos = nPanelTop;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.