[Libreoffice-commits] core.git: sc/source vcl/source

Thorsten Wagner (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 17 10:58:29 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 f24e64e8b55b695565109a6742598bcc90e4d9d0
Author:     Thorsten Wagner <thorsten.wagner.4 at gmail.com>
AuthorDate: Tue Jun 16 00:28:41 2020 +0200
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Wed Jun 17 12:57:50 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>

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 58a8a9e861d1..9eb17bcee389 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -82,6 +82,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;
@@ -163,7 +164,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 ),
@@ -204,11 +205,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())
@@ -2116,7 +2113,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