tdf#160459 embedded starmath doesn't fit inside allocated area

much to and fro with MapModes and rounding issue obscured that
fundmentally that the 'etched-out' GtkScrolledWindow frame requires
space which eats into what is available to show the formula, and
in embedded mode we want the editing area to be equal in size
to the area used for the preview.

Change-Id: I1d126ddcc953131cf4add7da58ccd89e7fa86b66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara 2024-08-16 21:09:04 +01:00
parent 52a2dd0eea
commit ddec502caa
4 changed files with 54 additions and 2 deletions

View file

@ -32,6 +32,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/smath,\
starmath/uiconfig/smath/ui/alignmentdialog \
starmath/uiconfig/smath/ui/catalogdialog \
starmath/uiconfig/smath/ui/editwindow \
starmath/uiconfig/smath/ui/embedwindow \
starmath/uiconfig/smath/ui/fontdialog \
starmath/uiconfig/smath/ui/fontsizedialog \
starmath/uiconfig/smath/ui/fonttypedialog \

View file

@ -105,8 +105,21 @@ using namespace css;
using namespace css::accessibility;
using namespace css::uno;
static OUString GetScrollUIName(const SmViewShell& rShell)
{
const SmDocShell* pShell = rShell.GetDoc();
if (pShell && pShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
{
// This one has no border on the scrolledwindow, to maximize the space
// available when in embedded mode and minimize the difference from
// the ole preview to give a more seamless embedded editing experience.
return "modules/smath/ui/embedwindow.ui";
}
return "modules/smath/ui/mathwindow.ui";
}
SmGraphicWindow::SmGraphicWindow(SmViewShell& rShell)
: InterimItemWindow(&rShell.GetViewFrame().GetWindow(), u"modules/smath/ui/mathwindow.ui"_ustr, u"MathWindow"_ustr)
: InterimItemWindow(&rShell.GetViewFrame().GetWindow(), GetScrollUIName(rShell), u"MathWindow"_ustr)
, nLinePixH(GetSettings().GetStyleSettings().GetScrollBarSize())
, nColumnPixW(nLinePixH)
, nZoom(100)

View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface domain="sm">
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="MathWindow">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="border-width">0</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkDrawingArea" id="mathview">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</interface>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="sm">
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="MathWindow">