[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source vcl/source

Thorsten Wagner (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 17 12:39:11 UTC 2020


 sc/source/ui/app/inputwin.cxx |   17 ++++++++++-------
 vcl/source/window/toolbox.cxx |   12 +++++++-----
 2 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit 4366fdf8cb7b18bfc8f4665aa09f35e20467d3a5
Author:     Thorsten Wagner <thorsten.wagner.4 at gmail.com>
AuthorDate: Tue Jun 16 00:28:41 2020 +0200
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Wed Jun 17 14:38:40 2020 +0200

    tdf#133692: Spacing within Calc formulabar reworked
    
    Change-Id: I4f590589fdc390bfa11f7db86e65ccab3dd084fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96403
    Tested-by: Jenkins
    Tested-by: Andreas Kainz <kainz.a at gmail.com>
    Tested-by: Heiko Tietze <heiko.tietze at documentfoundation.org>
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>
    (cherry picked from commit 45261267964d6fa1e820b0e4a7745e2e10fcb5f7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96503
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index cb2b00b51d58..2c19415363ea 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -81,6 +81,7 @@ const long BUTTON_OFFSET = 2;            // Space between input line and button
 const long MULTILINE_BUTTON_WIDTH = 20;  // Width of the button which opens multiline dropdown
 const long INPUTWIN_MULTILINES = 6;      // Initial number of lines within multiline dropdown
 const long TOOLBOX_WINDOW_HEIGHT = 22;   // Height of toolbox window in pixels - TODO: The same on all systems?
+const long POSITION_COMBOBOX_WIDTH = 18; // Width of position combobox in characters
 
 using com::sun::star::uno::Reference;
 using com::sun::star::uno::UNO_QUERY;
@@ -162,7 +163,7 @@ static VclPtr<ScTextWndBase> lcl_chooseRuntimeImpl( vcl::Window* pParent, const
 
 ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) :
         // With WB_CLIPCHILDREN otherwise we get flickering
-        ToolBox         ( pParent, WinBits(WB_CLIPCHILDREN) ),
+        ToolBox         ( pParent, WinBits(WB_CLIPCHILDREN | WB_BORDER | WB_NOSHADOW) ),
         aWndPos         ( VclPtr<ScPosWnd>::Create(this) ),
         pRuntimeWindow  ( lcl_chooseRuntimeImpl( this, pBind ) ),
         aTextWindow     ( *pRuntimeWindow ),
@@ -203,11 +204,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) :
         InsertItem      (SID_INPUT_OK,       Image(StockImage::Yes, RID_BMP_INPUT_OK), ToolBoxItemBits::NONE, 6);
     }
 
-    if (!comphelper::LibreOfficeKit::isActive())
-    {
-        InsertSeparator (7);
-    }
-    InsertWindow    (7, &aTextWindow, ToolBoxItemBits::NONE, 8);
+    InsertWindow    (7, &aTextWindow, ToolBoxItemBits::NONE, 7);
     SetDropdownClickHdl( LINK( this, ScInputWindow, DropdownClickHdl ));
 
     if (!comphelper::LibreOfficeKit::isActive())
@@ -2115,7 +2112,13 @@ ScPosWnd::ScPosWnd(vcl::Window* pParent)
     , nTipVisible(nullptr)
     , bFormulaMode(false)
 {
-    m_xWidget->set_entry_width_chars(15);
+
+    // Use calculation according to tdf#132338 to align combobox width to width of fontname comboxbox within formatting toolbar;
+    // formatting toolbar is placed above formulabar when using multiple toolbars typically
+
+    m_xWidget->set_entry_width_chars(1);
+    Size aSize(LogicToPixel(Size(POSITION_COMBOBOX_WIDTH * 4, 0), MapMode(MapUnit::MapAppFont)));
+    m_xWidget->set_size_request(aSize.Width(), -1);
     SetSizePixel(m_xContainer->get_preferred_size());
 
     FillRangeNames();
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 182c085a152e..8ddb536f7bb4 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -189,10 +189,10 @@ void ToolBox::ImplCalcBorder( WindowAlign eAlign, long& rLeft, long& rTop,
     ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this );
 
     // reserve DragArea only for dockable toolbars
-    int    dragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? ImplGetDragWidth() : 0;
+    int dragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? ImplGetDragWidth() : 0;
 
-    // no shadow border for dockable toolbars
-    int    borderwidth = pWrapper ? 0: 2;
+    // no shadow border for dockable toolbars and toolbars with WB_NOSHADOW bit set, e.g. Calc's formulabar
+    int borderwidth = ( pWrapper || mnWinStyle & WB_NOSHADOW ) ? 0 : 2;
 
     if ( eAlign == WindowAlign::Top )
     {
@@ -551,8 +551,10 @@ void ToolBox::ImplDrawBorder(vcl::RenderContext& rRenderContext)
 
     ImplDockingWindowWrapper* pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper(this);
 
-    // draw borders for ordinary toolbars only (not dockable)
-    if( pWrapper )
+    // draw borders for ordinary toolbars only (not dockable), do not draw borders for toolbars with WB_NOSHADOW bit set,
+    // e.g. Calc's formulabar
+
+    if( pWrapper || mnWinStyle & WB_NOSHADOW )
         return;
 
     if (meAlign == WindowAlign::Bottom)


More information about the Libreoffice-commits mailing list