Kaydet (Commit) 3b67ad5f authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

widgettheme: support multiple spinbox orientations

This adds the ability to define the spinbox orientation that has
decrease and increase buttons on the right side and can be changed
by adding "orientation="edit-decrease-increase" to the Spinbox
"Entire" part in the widget definition.

Change-Id: I3601a987a4abb8d998e9cd2d8973d794d3d66f9b
Reviewed-on: https://gerrit.libreoffice.org/72662
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst c04169c5
......@@ -690,9 +690,11 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
return false;
Size aButtonSizeDown(pButtonDownPart->mnWidth, pButtonDownPart->mnHeight);
OString sOrientation = "decrease-edit-increase";
auto const& pEntirePart
= m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
OString sOrientation = pEntirePart->msOrientation;
if (sOrientation == "decrease-edit-increase")
if (sOrientation.isEmpty() || sOrientation == "decrease-edit-increase")
{
if (ePart == ControlPart::ButtonUp)
{
......@@ -728,7 +730,7 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
return true;
}
}
else
else if (sOrientation == "edit-decrease-increase")
{
if (ePart == ControlPart::ButtonUp)
{
......
......@@ -308,6 +308,12 @@ void WidgetDefinitionReader::readDefinition(tools::XmlWalker& rWalker,
pPart->mnMarginWidth = nMarginWidth;
}
OString sOrientation = rWalker.attribute("orientation");
if (!sOrientation.isEmpty())
{
pPart->msOrientation = sOrientation;
}
rWidgetDefinition.maDefinitions.emplace(ControlTypeAndPart(eType, ePart), pPart);
readPart(rWalker, pPart);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment