[Libreoffice-commits] core.git: vcl/osx

2022-08-28 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5bf4f36b509ae2bdc507074d53af007b4852013d
Author: Thorsten Wagner 
AuthorDate: Tue Aug 23 21:25:23 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Aug 29 06:45:07 2022 +0200

Prevent rounding down fontheights depending on display resolution for macOS

Change-Id: Ifb0ba848de3613e49237fd1e4b4739915154f355
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138744
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 2685705287c8..9003a8dbde99 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1181,7 +1181,7 @@ static vcl::Font getFont( NSFont* pFont, sal_Int32 nDPIY, 
const vcl::Font& rDefa
 if( pFont )
 {
 aResult.SetFamilyName( GetOUString( [pFont familyName] ) );
-aResult.SetFontHeight( static_cast(([pFont pointSize] * 72.0 / 
static_cast(nDPIY))+0.5) );
+aResult.SetFontHeight( static_cast(ceil([pFont pointSize] * 72.0 
/ static_cast(nDPIY))) );
 aResult.SetItalic( ([pFont italicAngle] != 0.0) ? ITALIC_NORMAL : 
ITALIC_NONE );
 // FIMXE: bold ?
 }


[Libreoffice-commits] core.git: vcl/osx

2022-08-27 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |   26 +-
 1 file changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 87318da781b429abd8261a8b64bb8d72c79b9da2
Author: Thorsten Wagner 
AuthorDate: Thu Aug 25 10:16:50 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Aug 28 06:20:28 2022 +0200

Adjust button text colors for macOS Big Sur

Change-Id: I1bbdcc97d65afbebce0b2d2e7530f156aa037315
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138799
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 574122a1a91d..2685705287c8 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1288,13 +1288,17 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.SetListBoxWindowHighlightColor( aMenuHighlightColor );
 aStyleSettings.SetListBoxWindowHighlightTextColor( aMenuHighlightTextColor 
);
 
+// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
+// used for some button states and for selected tab text. As a workaround 
the current OS version has to be considered. This code
+// has to be reviewed once issue is covered by documentation.
+
 // Set text colors for buttons and their different status according to OS 
settings, typically white for selected buttons,
 // black otherwise
 
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
 Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
 Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
 
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
@@ -1305,20 +1309,24 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
 
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
-
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
-
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
+if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
+{
+
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+}
+else
+{
+
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+}
 
 // Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
-
-// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
-// used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
-// issue is covered by documentation.
-
-NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 else


[Libreoffice-commits] core.git: svx/source

2021-07-08 Thread Thorsten Wagner (via logerrit)
 svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx |3 ++-
 svx/source/tbxctrls/tbcontrl.cxx|9 ++---
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 396ceb05ef2bb75ba5c81b83f443863c485fa0b9
Author: Thorsten Wagner 
AuthorDate: Mon Jun 28 23:40:12 2021 +0200
Commit: Heiko Tietze 
CommitDate: Thu Jul 8 08:34:05 2021 +0200

tdf#125533 Update Calc style names for style sidebar dropdown

Style names for Calc are updated to current style names. As
default styles shown by sidebar dropdown are hardcoded, styles
Accent 1, Accent 2, and Accent 3 were added to offer a few
more options.

Change-Id: I0e4b00f7e8a64e1ded077c559ed208fe71d784ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118038
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx 
b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
index 47995067ae03..8a96feeb43c9 100644
--- a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
+++ b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
@@ -91,7 +91,8 @@ void StylesPreviewToolBoxControl::InitializeStyles(
 }
 else if 
(xServices->supportsService("com.sun.star.sheet.SpreadsheetDocument"))
 {
-static const char* aCalcStyles[] = { "Default", "Heading1", 
"Result", "Result2" };
+static const char* aCalcStyles[] = { "Default",   "Accent 1",  
"Accent 2", "Accent 3",
+ "Heading 1", "Heading 2", 
"Result" };
 css::uno::Reference xCellStyles;
 xStylesSupplier->getStyleFamilies()->getByName("CellStyles") >>= 
xCellStyles;
 for (const char* pCalcStyle : aCalcStyles)
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 1add34406833..7495876f2563 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2595,9 +2595,12 @@ struct SvxStyleToolBoxControl::Impl
 static const char* aCalcStyles[] =
 {
 "Default",
-"Heading1",
-"Result",
-"Result2"
+"Accent 1",
+"Accent 2",
+"Accent 3",
+"Heading 1",
+"Heading 2",
+"Result"
 };
 Reference xCellStyles;
 xStylesSupplier->getStyleFamilies()->getByName("CellStyles") 
>>= xCellStyles;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/ios vcl/osx vcl/quartz

2021-06-29 Thread Thorsten Wagner (via logerrit)
 vcl/ios/salios.cxx  |  147 ++
 vcl/osx/salmacos.cxx|  152 
 vcl/quartz/salgdicommon.cxx |  147 --
 3 files changed, 299 insertions(+), 147 deletions(-)

New commits:
commit a396dde0907ad87ac928c9a1b9f7640a73910b17
Author: Thorsten Wagner 
AuthorDate: Mon Jun 28 22:36:56 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jun 29 10:29:16 2021 +0200

tdf#142061 Consider window scaling for XOR drawing on macOS

Change-Id: I4261334b6d2d2f34fe3452cc870aba6f88c4069e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118036
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/vcl/ios/salios.cxx b/vcl/ios/salios.cxx
index d1552b8b0bbb..4c8c99b4c4a4 100644
--- a/vcl/ios/salios.cxx
+++ b/vcl/ios/salios.cxx
@@ -331,6 +331,153 @@ void AquaSalGraphics::SetVirDevGraphics(CGLayerHolder 
const & rLayer, CGContextR
 SetState();
 }
 
+void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
+  CGContextRef xTargetContext, CGLayerRef 
xTargetLayer )
+{
+SAL_INFO( "vcl.quartz", "XorEmulation::SetTarget() this=" << this <<
+  " (" << nWidth << "x" << nHeight << ") depth=" << nTargetDepth <<
+  " context=" << xTargetContext << " layer=" << xTargetLayer );
+
+// prepare to replace old mask+temp context
+if( m_xMaskContext )
+{
+// cleanup the mask context
+CGContextRelease( m_xMaskContext );
+delete[] m_pMaskBuffer;
+m_xMaskContext = nullptr;
+m_pMaskBuffer = nullptr;
+
+// cleanup the temp context if needed
+if( m_xTempContext )
+{
+CGContextRelease( m_xTempContext );
+delete[] m_pTempBuffer;
+m_xTempContext = nullptr;
+m_pTempBuffer = nullptr;
+}
+}
+
+// return early if there is nothing more to do
+if( !xTargetContext )
+{
+return;
+}
+// retarget drawing operations to the XOR mask
+m_xTargetLayer = xTargetLayer;
+m_xTargetContext = xTargetContext;
+
+// prepare creation of matching CGBitmaps
+CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
+CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst;
+int nBitDepth = nTargetDepth;
+if( !nBitDepth )
+{
+nBitDepth = 32;
+}
+int nBytesPerRow = 4;
+const size_t nBitsPerComponent = (nBitDepth == 16) ? 5 : 8;
+if( nBitDepth <= 8 )
+{
+aCGColorSpace = GetSalData()->mxGraySpace;
+aCGBmpInfo = kCGImageAlphaNone;
+nBytesPerRow = 1;
+}
+nBytesPerRow *= nWidth;
+m_nBufferLongs = (nHeight * nBytesPerRow + sizeof(sal_uLong)-1) / 
sizeof(sal_uLong);
+
+// create a XorMask context
+m_pMaskBuffer = new sal_uLong[ m_nBufferLongs ];
+m_xMaskContext = CGBitmapContextCreate( m_pMaskBuffer,
+nWidth, nHeight,
+nBitsPerComponent, nBytesPerRow,
+aCGColorSpace, aCGBmpInfo );
+SAL_WARN_IF( !m_xMaskContext, "vcl.quartz", "mask context creation failed" 
);
+
+// reset the XOR mask to black
+memset( m_pMaskBuffer, 0, m_nBufferLongs * sizeof(sal_uLong) );
+
+// a bitmap context will be needed for manual XORing
+// create one unless the target context is a bitmap context
+if( nTargetDepth )
+{
+m_pTempBuffer = static_cast(CGBitmapContextGetData( 
m_xTargetContext ));
+}
+if( !m_pTempBuffer )
+{
+// create a bitmap context matching to the target context
+m_pTempBuffer = new sal_uLong[ m_nBufferLongs ];
+m_xTempContext = CGBitmapContextCreate( m_pTempBuffer,
+nWidth, nHeight,
+nBitsPerComponent, 
nBytesPerRow,
+aCGColorSpace, aCGBmpInfo );
+SAL_WARN_IF( !m_xTempContext, "vcl.quartz", "temp context creation 
failed" );
+}
+
+// initialize XOR mask context for drawing
+CGContextSetFillColorSpace( m_xMaskContext, aCGColorSpace );
+CGContextSetStrokeColorSpace( m_xMaskContext, aCGColorSpace );
+CGContextSetShouldAntialias( m_xMaskContext, false );
+
+// improve the XorMask's XOR emulation a little
+// NOTE: currently only enabled for monochrome contexts
+if( aCGColorSpace == GetSalData()->mxGraySpace )
+{
+CGContextSetBlendMode( m_xMaskContext, kCGBlendModeDifference );
+}
+// initialize the transformation matrix to the drawing target
+const CGAffineTransform aCTM = CGContextGetCTM( xTargetContext );
+CGContextConcatCTM( m_xMaskContext, aCTM );
+if( m_xTempContext )
+{
+CGContextConcatCTM( m_xTempContext, aCTM );
+}
+// 

[Libreoffice-commits] core.git: vcl/ios vcl/osx vcl/quartz

2021-05-22 Thread Thorsten Wagner (via logerrit)
 vcl/ios/salios.cxx  |  147 ++
 vcl/osx/salmacos.cxx|  152 
 vcl/quartz/salgdicommon.cxx |  147 --
 3 files changed, 299 insertions(+), 147 deletions(-)

New commits:
commit 2cce064e6bb570361c845f7b3d82960f89c70bb1
Author: Thorsten Wagner 
AuthorDate: Wed May 19 17:47:58 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat May 22 18:02:29 2021 +0200

tdf#142061 Add window scaling to XOR emulation on macOS

Window scaling for retina displays on macOS has been added to fix
tdf#138122 in commit 1a167625314bf36b735176ed488e6ba9b5e9b675

Missing window scaling for XOR emulation is added by this change.
Code modified for macOS is moved from quartz/salgidcommon.cxx to
osx/salmacos.cxx while original code is copied to ios/salios.cxx
to prevent modifications for iOS.

Change-Id: Ia8c52f9045379cc37d5aff1279650db0dddee8c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115816
Tested-by: Adolfo Jayme Barrientos 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/ios/salios.cxx b/vcl/ios/salios.cxx
index ac11faff3072..335c14264c64 100644
--- a/vcl/ios/salios.cxx
+++ b/vcl/ios/salios.cxx
@@ -325,6 +325,153 @@ void AquaSalGraphics::SetVirDevGraphics(CGLayerHolder 
const & rLayer, CGContextR
 maShared.setState();
 }
 
+void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
+  CGContextRef xTargetContext, CGLayerRef 
xTargetLayer )
+{
+SAL_INFO( "vcl.quartz", "XorEmulation::SetTarget() this=" << this <<
+  " (" << nWidth << "x" << nHeight << ") depth=" << nTargetDepth <<
+  " context=" << xTargetContext << " layer=" << xTargetLayer );
+
+// prepare to replace old mask+temp context
+if( m_xMaskContext )
+{
+// cleanup the mask context
+CGContextRelease( m_xMaskContext );
+delete[] m_pMaskBuffer;
+m_xMaskContext = nullptr;
+m_pMaskBuffer = nullptr;
+
+// cleanup the temp context if needed
+if( m_xTempContext )
+{
+CGContextRelease( m_xTempContext );
+delete[] m_pTempBuffer;
+m_xTempContext = nullptr;
+m_pTempBuffer = nullptr;
+}
+}
+
+// return early if there is nothing more to do
+if( !xTargetContext )
+{
+return;
+}
+// retarget drawing operations to the XOR mask
+m_xTargetLayer = xTargetLayer;
+m_xTargetContext = xTargetContext;
+
+// prepare creation of matching CGBitmaps
+CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace;
+CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst;
+int nBitDepth = nTargetDepth;
+if( !nBitDepth )
+{
+nBitDepth = 32;
+}
+int nBytesPerRow = 4;
+const size_t nBitsPerComponent = (nBitDepth == 16) ? 5 : 8;
+if( nBitDepth <= 8 )
+{
+aCGColorSpace = GetSalData()->mxGraySpace;
+aCGBmpInfo = kCGImageAlphaNone;
+nBytesPerRow = 1;
+}
+nBytesPerRow *= nWidth;
+m_nBufferLongs = (nHeight * nBytesPerRow + sizeof(sal_uLong)-1) / 
sizeof(sal_uLong);
+
+// create a XorMask context
+m_pMaskBuffer = new sal_uLong[ m_nBufferLongs ];
+m_xMaskContext = CGBitmapContextCreate( m_pMaskBuffer,
+nWidth, nHeight,
+nBitsPerComponent, nBytesPerRow,
+aCGColorSpace, aCGBmpInfo );
+SAL_WARN_IF( !m_xMaskContext, "vcl.quartz", "mask context creation failed" 
);
+
+// reset the XOR mask to black
+memset( m_pMaskBuffer, 0, m_nBufferLongs * sizeof(sal_uLong) );
+
+// a bitmap context will be needed for manual XORing
+// create one unless the target context is a bitmap context
+if( nTargetDepth )
+{
+m_pTempBuffer = static_cast(CGBitmapContextGetData( 
m_xTargetContext ));
+}
+if( !m_pTempBuffer )
+{
+// create a bitmap context matching to the target context
+m_pTempBuffer = new sal_uLong[ m_nBufferLongs ];
+m_xTempContext = CGBitmapContextCreate( m_pTempBuffer,
+nWidth, nHeight,
+nBitsPerComponent, 
nBytesPerRow,
+aCGColorSpace, aCGBmpInfo );
+SAL_WARN_IF( !m_xTempContext, "vcl.quartz", "temp context creation 
failed" );
+}
+
+// initialize XOR mask context for drawing
+CGContextSetFillColorSpace( m_xMaskContext, aCGColorSpace );
+CGContextSetStrokeColorSpace( m_xMaskContext, aCGColorSpace );
+CGContextSetShouldAntialias( m_xMaskContext, false );
+
+// improve the XorMask's XOR emulation a little
+// NOTE: currently only enabled for monochrome contexts
+if( aCGColorSpace == 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1-2' - vcl/quartz

2021-03-24 Thread Thorsten Wagner (via logerrit)
 vcl/quartz/salgdicommon.cxx |   42 +-
 1 file changed, 9 insertions(+), 33 deletions(-)

New commits:
commit 852f844366f7efa6a7f1fa2a0500fc0a89c1
Author: Thorsten Wagner 
AuthorDate: Sat Mar 20 21:20:53 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 24 14:46:30 2021 +0100

tdf#141063 Always use region rectangles for clipping on macOS

The use of polygons currently causes misalignment by one pixel.
Use of polygons is dropped on macOS by this change similar it has
been done for SKIA to fix tdf#133208.

Change-Id: I31faf7cf9b33908a52cb60d1b631308b4fe45e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112823
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Tor Lillqvist 
(cherry picked from commit 00d12793f5d9a73f784e23aff61e2618f0fc01c0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112952
Reviewed-by: Xisco Fauli 
(cherry picked from commit 5a90e1bd01044843ee78b3e43ae79b4c4fb6c07e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112954
Reviewed-by: Christian Lohmaier 
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 33ffc43741a1..bbfe185b73d2 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -127,21 +127,6 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
 }
 }
 
-static void AddPolyPolygonToPath( CGMutablePathRef xPath,
-  const basegfx::B2DPolyPolygon& rPolyPoly,
-  bool bPixelSnap, bool bLineDraw )
-{
-// short circuit if there is nothing to do
-if( rPolyPoly.count() == 0 )
-{
-return;
-}
-for(auto const& rPolygon : rPolyPoly)
-{
-AddPolygonToPath( xPath, rPolygon, true, bPixelSnap, bLineDraw );
-}
-}
-
 bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
 const PhysicalFontFace* pFontData,
 const sal_GlyphId* pGlyphIds, const 
sal_uInt8* pEncoding,
@@ -1431,30 +1416,21 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& 
i_rClip )
 mxClipPath = CGPathCreateMutable();
 
 // set current path, either as polypolgon or sequence of rectangles
-if(i_rClip.HasPolyPolygonOrB2DPolyPolygon())
-{
-const basegfx::B2DPolyPolygon aClip(i_rClip.GetAsB2DPolyPolygon());
+RectangleVector aRectangles;
+i_rClip.GetRegionRectangles(aRectangles);
 
-AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAlias(), false );
-}
-else
+for(const auto& rRect : aRectangles)
 {
-RectangleVector aRectangles;
-i_rClip.GetRegionRectangles(aRectangles);
+const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
 
-for(const auto& rRect : aRectangles)
+if(nW)
 {
-const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
+const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 
logic in original
 
-if(nW)
+if(nH)
 {
-const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // 
uses +1 logic in original
-
-if(nH)
-{
-const CGRect aRect = CGRectMake( rRect.Left(), 
rRect.Top(), nW, nH);
-CGPathAddRect( mxClipPath, nullptr, aRect );
-}
+const CGRect aRect = CGRectMake( rRect.Left(), rRect.Top(), 
nW, nH);
+CGPathAddRect( mxClipPath, nullptr, aRect );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/quartz

2021-03-23 Thread Thorsten Wagner (via logerrit)
 vcl/quartz/salgdicommon.cxx |   42 +-
 1 file changed, 9 insertions(+), 33 deletions(-)

New commits:
commit 5a90e1bd01044843ee78b3e43ae79b4c4fb6c07e
Author: Thorsten Wagner 
AuthorDate: Sat Mar 20 21:20:53 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Mar 23 13:29:45 2021 +0100

tdf#141063 Always use region rectangles for clipping on macOS

The use of polygons currently causes misalignment by one pixel.
Use of polygons is dropped on macOS by this change similar it has
been done for SKIA to fix tdf#133208.

Change-Id: I31faf7cf9b33908a52cb60d1b631308b4fe45e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112823
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Tor Lillqvist 
(cherry picked from commit 00d12793f5d9a73f784e23aff61e2618f0fc01c0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112952
Reviewed-by: Xisco Fauli 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 33ffc43741a1..bbfe185b73d2 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -127,21 +127,6 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
 }
 }
 
-static void AddPolyPolygonToPath( CGMutablePathRef xPath,
-  const basegfx::B2DPolyPolygon& rPolyPoly,
-  bool bPixelSnap, bool bLineDraw )
-{
-// short circuit if there is nothing to do
-if( rPolyPoly.count() == 0 )
-{
-return;
-}
-for(auto const& rPolygon : rPolyPoly)
-{
-AddPolygonToPath( xPath, rPolygon, true, bPixelSnap, bLineDraw );
-}
-}
-
 bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
 const PhysicalFontFace* pFontData,
 const sal_GlyphId* pGlyphIds, const 
sal_uInt8* pEncoding,
@@ -1431,30 +1416,21 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& 
i_rClip )
 mxClipPath = CGPathCreateMutable();
 
 // set current path, either as polypolgon or sequence of rectangles
-if(i_rClip.HasPolyPolygonOrB2DPolyPolygon())
-{
-const basegfx::B2DPolyPolygon aClip(i_rClip.GetAsB2DPolyPolygon());
+RectangleVector aRectangles;
+i_rClip.GetRegionRectangles(aRectangles);
 
-AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAlias(), false );
-}
-else
+for(const auto& rRect : aRectangles)
 {
-RectangleVector aRectangles;
-i_rClip.GetRegionRectangles(aRectangles);
+const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
 
-for(const auto& rRect : aRectangles)
+if(nW)
 {
-const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
+const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 
logic in original
 
-if(nW)
+if(nH)
 {
-const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // 
uses +1 logic in original
-
-if(nH)
-{
-const CGRect aRect = CGRectMake( rRect.Left(), 
rRect.Top(), nW, nH);
-CGPathAddRect( mxClipPath, nullptr, aRect );
-}
+const CGRect aRect = CGRectMake( rRect.Left(), rRect.Top(), 
nW, nH);
+CGPathAddRect( mxClipPath, nullptr, aRect );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/quartz

2021-03-23 Thread Thorsten Wagner (via logerrit)
 vcl/quartz/salgdicommon.cxx |   42 +-
 1 file changed, 9 insertions(+), 33 deletions(-)

New commits:
commit 00d12793f5d9a73f784e23aff61e2618f0fc01c0
Author: Thorsten Wagner 
AuthorDate: Sat Mar 20 21:20:53 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Mar 23 10:06:39 2021 +0100

tdf#141063 Always use region rectangles for clipping on macOS

The use of polygons currently causes misalignment by one pixel.
Use of polygons is dropped on macOS by this change similar it has
been done for SKIA to fix tdf#133208.

Change-Id: I31faf7cf9b33908a52cb60d1b631308b4fe45e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112823
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index d82681f1091f..51e35e79905a 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -127,21 +127,6 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
 }
 }
 
-static void AddPolyPolygonToPath( CGMutablePathRef xPath,
-  const basegfx::B2DPolyPolygon& rPolyPoly,
-  bool bPixelSnap, bool bLineDraw )
-{
-// short circuit if there is nothing to do
-if( rPolyPoly.count() == 0 )
-{
-return;
-}
-for(auto const& rPolygon : rPolyPoly)
-{
-AddPolygonToPath( xPath, rPolygon, true, bPixelSnap, bLineDraw );
-}
-}
-
 bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
 const PhysicalFontFace* pFontData,
 const sal_GlyphId* pGlyphIds, const 
sal_uInt8* pEncoding,
@@ -1439,30 +1424,21 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& 
i_rClip )
 mxClipPath = CGPathCreateMutable();
 
 // set current path, either as polypolgon or sequence of rectangles
-if(i_rClip.HasPolyPolygonOrB2DPolyPolygon())
-{
-const basegfx::B2DPolyPolygon aClip(i_rClip.GetAsB2DPolyPolygon());
+RectangleVector aRectangles;
+i_rClip.GetRegionRectangles(aRectangles);
 
-AddPolyPolygonToPath( mxClipPath, aClip, !getAntiAlias(), false );
-}
-else
+for(const auto& rRect : aRectangles)
 {
-RectangleVector aRectangles;
-i_rClip.GetRegionRectangles(aRectangles);
+const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
 
-for(const auto& rRect : aRectangles)
+if(nW)
 {
-const tools::Long nW(rRect.Right() - rRect.Left() + 1); // uses +1 
logic in original
+const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // uses +1 
logic in original
 
-if(nW)
+if(nH)
 {
-const tools::Long nH(rRect.Bottom() - rRect.Top() + 1); // 
uses +1 logic in original
-
-if(nH)
-{
-const CGRect aRect = CGRectMake( rRect.Left(), 
rRect.Top(), nW, nH);
-CGPathAddRect( mxClipPath, nullptr, aRect );
-}
+const CGRect aRect = CGRectMake( rRect.Left(), rRect.Top(), 
nW, nH);
+CGPathAddRect( mxClipPath, nullptr, aRect );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/osx

2021-03-08 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 19badc601594a19b56cff14076435f96e51ce845
Author: Thorsten Wagner 
AuthorDate: Sat Mar 6 23:35:11 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Mar 9 08:04:06 2021 +0100

tdf#138314 Change selected tab text color on macOS Big Sur

Change text color of selected tabs starting with macOS 10.16 (not with
macOS 11.0) to ensure compatibilty with macOS SDKs prior to 11 used
within LibreOffice build process

Backport of d8fc89cdfd0043838c4bc2d3b5a50bf5abfc6738 to LibreOffice 7.1

Change-Id: Ib2b7042878596271c194331eaab1915d11124210
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112105
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 9d4f68827a06..b0fbce1e8a81 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1328,7 +1328,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
 // issue is covered by documentation.
 
-NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/osx vcl/qa vcl/quartz

2021-03-08 Thread Thorsten Wagner (via logerrit)
 vcl/inc/quartz/salgdi.h  |3 -
 vcl/osx/salgdiutils.cxx  |   50 +++
 vcl/osx/salmacos.cxx |4 -
 vcl/qa/cppunit/BackendTest.cxx   |9 
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx |9 +++-
 vcl/qa/cppunit/outdev.cxx|4 +
 vcl/quartz/salgdi.cxx|8 ---
 7 files changed, 48 insertions(+), 39 deletions(-)

New commits:
commit 6b3558e3c563427f1bdff7193151c57c59041ddb
Author: Thorsten Wagner 
AuthorDate: Sat Mar 6 23:51:33 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Mar 8 09:22:42 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

(1) Activate window scaling when at least one retina display is connected

(2) Remove environment variable VCL_MACOS_FORCE_WINDOW_SCALING

(3) Disable related unit tests unless bitmap scaling has been implemented

Backport of 0c36f364b14aacd0eeb53087ae2fce54402dc741 and
06d918dcc47ae3f1c511cbdccfeacc8adb123f28 for LibreOffice 7.1

Change-Id: I20b075bf4e2927d62a04cd935e4496721b4c695d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112106
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index f5ff134259a6..7282c50fef1c 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -175,7 +175,6 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
-boolmbWindowScaling;
 
 #else // IOS
 
@@ -197,7 +196,7 @@ public:
 voidcopyResolution( AquaSalGraphics& );
 voidupdateResolution();
 
-float   GetWindowScaling();
+static floatGetWindowScaling();
 voidSetWindowGraphics( AquaSalFrame* pFrame );
 boolIsWindowGraphics()  const   { return mbWindow; 
}
 voidSetPrinterGraphics(CGContextRef, sal_Int32 
nRealDPIX, sal_Int32 nRealDPIY);
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 892baed13ac9..a1012e704796 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,37 +35,35 @@
 #include 
 #include 
 
-float AquaSalGraphics::GetWindowScaling()
-{
-float fScale = 1.0f;
-
-#ifdef MACOSX
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
-// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
-// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
-// text and graphics.
+// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
+// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
 
-// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
-
-if (mbWindowScaling)
-{
-fScale = 2.0f;
-return fScale;
-}
+// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
+// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
+// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
+// scaling when displays are added while application is running is not 
supported.
 
-#endif
+static bool  bWindowScaling = false;
+static float fWindowScale = 1.0f;
 
-AquaSalFrame *pSalFrame = mpFrame;
-if (!pSalFrame)
-pSalFrame = static_cast(GetSalData()->mpInstance->anyFrame());
-if (pSalFrame)
+float AquaSalGraphics::GetWindowScaling()
+{
+if (!bWindowScaling)
 {
-NSWindow *pNSWindow = pSalFrame->getNSWindow();
-if (pNSWindow)
-fScale = [pNSWindow backingScaleFactor];
+NSArray *aScreens = [NSScreen screens];
+if (aScreens != nullptr)
+{
+int nScreens = [aScreens count];
+for (int i = 0; i < nScreens; i++)
+{
+float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
+if (fScale > fWindowScale)
+  fWindowScale = fScale;
+}
+bWindowScaling = true;
+}
 }
-return fScale;
+return fWindowScale;
 }
 
 void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 

[Libreoffice-commits] core.git: vcl/osx

2021-03-05 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d8fc89cdfd0043838c4bc2d3b5a50bf5abfc6738
Author: Thorsten Wagner 
AuthorDate: Fri Mar 5 23:38:12 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Sat Mar 6 07:18:07 2021 +0100

tdf#138314 Change selected tab text color on macOS Big Sur

Change text color of selected tabs starting with macOS 10.16 (not with
macOS 11.0) to ensure compatibilty with macOS SDKs prior to 11 used
within LibreOffice build process

The version check used in commit 058ad4b900b5e0ee902f3e89ed121c2b5f8c58f1
is amended by this change.

Change-Id: I4814e8edd9aa11794a9fb1b1eaa391451bde4487
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112036
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index c00a976db96a..650526ad08c6 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1328,7 +1328,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
 // issue is covered by documentation.
 
-NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 10, .minorVersion 
= 16, .patchVersion = 0 };
 if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
 aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/qa

2021-03-05 Thread Thorsten Wagner (via logerrit)
 vcl/qa/cppunit/BackendTest.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit f8891b7f87957cc3f66805adf9b1e35a2189946b
Author: Thorsten Wagner 
AuthorDate: Thu Mar 4 20:25:12 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Mar 5 14:22:37 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

Supplemental change to commit 0c36f364b14aacd0eeb53087ae2fce54402dc741
to disable additional unit tests unless bitmap scaling has been implemented

Change-Id: Ic4861dabcb221976fe415b1d7110099ec66bb4ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111977
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 734d255272c2..88ef28fb40e4 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -921,7 +921,11 @@ public:
 CPPUNIT_TEST(testDrawMask);
 CPPUNIT_TEST(testDrawBlend);
 CPPUNIT_TEST(testDrawXor);
+
+// TODO: Following unit test is not executed for macOS unless bitmap scaling 
is implemented
+#ifndef MACOSX
 CPPUNIT_TEST(testDrawTransformedBitmapExAlpha);
+#endif
 
 CPPUNIT_TEST(testClipRectangle);
 CPPUNIT_TEST(testClipPolygon);
@@ -946,8 +950,11 @@ public:
 CPPUNIT_TEST(testDrawBlendExtended);
 CPPUNIT_TEST(testDrawAlphaBitmapMirrored);
 
+// TODO: Following unit tests are not executed for macOS unless bitmap scaling 
is implemented
+#ifndef MACOSX
 CPPUNIT_TEST(testTdf124848);
 CPPUNIT_TEST(testTdf136171);
+#endif
 
 CPPUNIT_TEST_SUITE_END();
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/qa vcl/quartz

2021-02-22 Thread Thorsten Wagner (via logerrit)
 vcl/inc/quartz/salgdi.h  |3 -
 vcl/osx/salgdiutils.cxx  |   50 +++
 vcl/osx/salmacos.cxx |4 -
 vcl/qa/cppunit/BackendTest.cxx   |6 ++
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx |4 +
 vcl/qa/cppunit/outdev.cxx|4 +
 vcl/quartz/salgdi.cxx|8 ---
 7 files changed, 41 insertions(+), 38 deletions(-)

New commits:
commit 0c36f364b14aacd0eeb53087ae2fce54402dc741
Author: Thorsten Wagner 
AuthorDate: Sun Feb 21 01:34:54 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 23 08:22:05 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

(1) Activate window scaling when at least one retina display is connected

(2) Remove environment variable VCL_MACOS_FORCE_WINDOW_SCALING

(3) Disable related unit tests unless bitmap scaling has been implemented

Change-Id: I218119a21e319e22bf17c609608724fce180f000
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111267
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 69b735787bdc..ce68b75b0b06 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,7 +174,6 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
-boolmbWindowScaling;
 
 #else // IOS
 
@@ -196,7 +195,7 @@ public:
 voidcopyResolution( AquaSalGraphics& );
 voidupdateResolution();
 
-float   GetWindowScaling();
+static floatGetWindowScaling();
 voidSetWindowGraphics( AquaSalFrame* pFrame );
 boolIsWindowGraphics()  const   { return mbWindow; 
}
 voidSetPrinterGraphics(CGContextRef, sal_Int32 
nRealDPIX, sal_Int32 nRealDPIY);
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 01626d348999..f3ddd946f699 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,37 +35,35 @@
 #include 
 #include 
 
-float AquaSalGraphics::GetWindowScaling()
-{
-float fScale = 1.0f;
-
-#ifdef MACOSX
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
-// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
-// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
-// text and graphics.
+// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
+// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
 
-// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
-
-if (mbWindowScaling)
-{
-fScale = 2.0f;
-return fScale;
-}
+// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
+// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
+// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
+// scaling when displays are added while application is running is not 
supported.
 
-#endif
+static bool  bWindowScaling = false;
+static float fWindowScale = 1.0f;
 
-AquaSalFrame *pSalFrame = mpFrame;
-if (!pSalFrame)
-pSalFrame = static_cast(GetSalData()->mpInstance->anyFrame());
-if (pSalFrame)
+float AquaSalGraphics::GetWindowScaling()
+{
+if (!bWindowScaling)
 {
-NSWindow *pNSWindow = pSalFrame->getNSWindow();
-if (pNSWindow)
-fScale = [pNSWindow backingScaleFactor];
+NSArray *aScreens = [NSScreen screens];
+if (aScreens != nullptr)
+{
+int nScreens = [aScreens count];
+for (int i = 0; i < nScreens; i++)
+{
+float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
+if (fScale > fWindowScale)
+  fWindowScale = fScale;
+}
+bWindowScaling = true;
+}
 }
-return fScale;
+return fWindowScale;
 }
 
 void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 0f41dd9e8c4a..f6403dea2725 100644
--- a/vcl/osx/salmacos.cxx
+++ b/vcl/osx/salmacos.cxx
@@ -19,7 +19,7 @@
 
 // This file contains the 

[Libreoffice-commits] core.git: vcl/inc vcl/osx vcl/quartz

2021-01-27 Thread Thorsten Wagner (via logerrit)
 vcl/inc/quartz/salgdi.h |1 
 vcl/osx/salgdiutils.cxx |   50 +++-
 vcl/osx/salmacos.cxx|2 -
 vcl/quartz/salgdi.cxx   |8 ---
 4 files changed, 25 insertions(+), 36 deletions(-)

New commits:
commit f318b856ed055f1952276355f811153f6b29c93e
Author: Thorsten Wagner 
AuthorDate: Wed Jan 27 01:01:10 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Wed Jan 27 10:09:59 2021 +0100

tdf#138122 Detect window scaling for multi display configurations on macOS

(1) Activate window scaling when at least one retina display is connected

(2) Remove environment variable VCL_MACOS_FORCE_WINDOW_SCALING

Change-Id: If6926ace7238f2be4ae91290872dbb3dbf658221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110002
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 69b735787bdc..4897d96c6089 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,7 +174,6 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
-boolmbWindowScaling;
 
 #else // IOS
 
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx
index 01626d348999..f3ddd946f699 100644
--- a/vcl/osx/salgdiutils.cxx
+++ b/vcl/osx/salgdiutils.cxx
@@ -35,37 +35,35 @@
 #include 
 #include 
 
-float AquaSalGraphics::GetWindowScaling()
-{
-float fScale = 1.0f;
-
-#ifdef MACOSX
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable
-// whose setting is stored in mbWindowScaling. After implementation of 
full support of scaled displays window scaling will be
-// set to 2.0f for macOS as default. This will allow moving of windows 
between non retina and retina displays without blurry
-// text and graphics.
+// TODO: Scale will be set to 2.0f as default after implementation of full 
scaled display support . This will allow moving of
+// windows between non retina and retina displays without blurry text and 
graphics. Static variables have to be removed thereafter.
 
-// TODO: After implementation of full support of scaled displays code has 
to be modified to set a scaling of 2.0f as default.
-
-if (mbWindowScaling)
-{
-fScale = 2.0f;
-return fScale;
-}
+// Currently scaled display support is not implemented for bitmaps. This will 
cause a slight performance degradation on displays
+// with single precision. To preserve performance for now, window scaling is 
only activated if at least one display with double
+// precision is present. Moving windows between displays is then possible 
without blurry text and graphics too. Adapting window
+// scaling when displays are added while application is running is not 
supported.
 
-#endif
+static bool  bWindowScaling = false;
+static float fWindowScale = 1.0f;
 
-AquaSalFrame *pSalFrame = mpFrame;
-if (!pSalFrame)
-pSalFrame = static_cast(GetSalData()->mpInstance->anyFrame());
-if (pSalFrame)
+float AquaSalGraphics::GetWindowScaling()
+{
+if (!bWindowScaling)
 {
-NSWindow *pNSWindow = pSalFrame->getNSWindow();
-if (pNSWindow)
-fScale = [pNSWindow backingScaleFactor];
+NSArray *aScreens = [NSScreen screens];
+if (aScreens != nullptr)
+{
+int nScreens = [aScreens count];
+for (int i = 0; i < nScreens; i++)
+{
+float fScale = [[aScreens objectAtIndex:i] backingScaleFactor];
+if (fScale > fWindowScale)
+  fWindowScale = fScale;
+}
+bWindowScaling = true;
+}
 }
-return fScale;
+return fWindowScale;
 }
 
 void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx
index 0f41dd9e8c4a..5b1265130cd0 100644
--- a/vcl/osx/salmacos.cxx
+++ b/vcl/osx/salmacos.cxx
@@ -19,7 +19,7 @@
 
 // This file contains the macOS-specific versions of the functions which were 
touched in the commit
 // to fix tdf#138122. The iOS-specific versions of these functions are kept 
(for now, when this
-// comment is written) as they were before that commit in vcl/isx/salios.cxx.
+// comment is written) as they were before that commit in vcl/ios/salios.cxx.
 
 #include 
 #include 
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 8dd9ec9222ad..ae6a40cfd4e2 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -205,14 +205,6 @@ AquaSalGraphics::AquaSalGraphics()
 , mbVirDev( false )
 #ifdef MACOSX
 , mbWindow( false )
-
-// Window scaling independent from main display may be forced by setting 
VCL_MACOS_FORCE_WINDOW_SCALING environment variable. If
-// unset window scaling from main display will be used. After 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1-0' - desktop/Executable_soffice_bin.mk vcl/inc vcl/osx vcl/quartz

2021-01-25 Thread Thorsten Wagner (via logerrit)
 desktop/Executable_soffice_bin.mk |   12 -
 vcl/inc/quartz/salgdi.h   |   16 +
 vcl/osx/salinst.cxx   |   15 +
 vcl/quartz/salbmp.cxx |   22 +-
 vcl/quartz/salgdi.cxx |8 
 vcl/quartz/salgdicommon.cxx   |  315 +++---
 vcl/quartz/salgdiutils.cxx|   41 
 vcl/quartz/salvd.cxx  |  119 +-
 8 files changed, 260 insertions(+), 288 deletions(-)

New commits:
commit a5cd681dce3f7f941ae00cfc4aab2718941d8fcd
Author: Thorsten Wagner 
AuthorDate: Sun Jan 10 23:49:25 2021 +0100
Commit: Christian Lohmaier 
CommitDate: Mon Jan 25 12:54:47 2021 +0100

tdf#138122 Add window scaling for retina displays on macOS

(1) Remove hack to make application look as if being linked against SDK 
10.13

(2) Use quad storage size on virtual devices for displaying on retina 
displays thereafter

(3) Apply workaround to downsample bitmaps from scaled layers (to be 
implemented)

(4) Disable dark mode (to be implemented)

(5) Provide new environment variables:

VCL_MACOS_FORCE_WINDOW_SCALING:
window scaling on non retina displays

VCL_MACOS_FORCE_DARK_MODE:
enable dark mode (macOS 10.14, iOS 13 and newer)

VCL_MACOS_USE_SYSTEM_APPEARANCE:
use light mode or dark mode (macOS 10.14, iOS 13 and newer) as configured 
by system preferences

Change-Id: I99877cd62a98cb91bcbf27af62b043c31c5f5fc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109072
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109495
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109557
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/desktop/Executable_soffice_bin.mk 
b/desktop/Executable_soffice_bin.mk
index 5c895ed0e7cb..9c08a28361df 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -23,18 +23,6 @@ $(eval $(call gb_Executable_add_cobjects,soffice_bin,\
 desktop/source/app/main \
 ))
 
-ifeq ($(OS),MACOSX)
-# At least when building against SDK 10.15, changing the LC_VERSION_MIN_MACOSX 
load command's sdk
-# value from 10.15 to "n/a" (i.e., 0.0.0) is necessary to avoid blurry text in 
the LO UI (see
-# 

-# "[driver][darwin] Pass -platform_version flag to the linker instead of the
-# -_version_min flag", 
clang/test/Driver/darwin-ld-platform-version-macos.c in particular,
-# for the -platform_version that Clang passes by default to new-enough ld):
-$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
--Xlinker -platform_version -Xlinker macos -Xlinker 
$(MACOSX_DEPLOYMENT_TARGET) -Xlinker 0.0.0 \
-))
-endif
-
 ifeq ($(OS),WNT)
 
 $(eval $(call gb_Executable_set_targettype_gui,soffice_bin,NO))
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index d718cf788dcc..64eb003e16cd 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -175,6 +175,7 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
+boolmbWindowScaling;
 
 #else // IOS
 
@@ -190,10 +191,10 @@ public:
 boolIsPenVisible() const{ return 
maLineColor.IsVisible(); }
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
+float   GetWindowScaling();
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics(
-CGContextRef, sal_Int32 nRealDPIX, sal_Int32 nRealDPIY );
-voidSetVirDevGraphics(CGLayerHolder const & rLayer, 
CGContextRef, int nBitDepth = 0);
+voidSetPrinterGraphics(CGContextRef, sal_Int32 
nRealDPIX, sal_Int32 nRealDPIY);
+voidSetVirDevGraphics(CGLayerHolder const , 
CGContextRef, int nBitDepth = 0);
 #ifdef MACOSX
 voidinitResolution( NSWindow* );
 voidcopyResolution( AquaSalGraphics& );
@@ -300,9 +301,14 @@ public:
 virtual booldrawAlphaRect( tools::Long nX, tools::Long nY, 
tools::Long nWidth,
tools::Long nHeight, sal_uInt8 
nTransparency ) override;
 
+protected:
+virtual voidcopyScaledArea( tools::Long nDestX, tools::Long 
nDestY, tools::Long nSrcX, tools::Long nSrcY,
+tools::Long nSrcWidth, 
tools::Long nSrcHeight, SalGraphics* pSrcGraphics );
+
 // native widget rendering methods that require mirroring
+
 #ifdef MACOSX
-protected:
+
 virtual boolisNativeControlSupported( ControlType nType, 
ControlPart nPart ) override;
 
 

[Libreoffice-commits] core.git: Branch 'private/tml/lov-7.0.4' - 5 commits - desktop/Executable_soffice_bin.mk include/sal sot/source vcl/inc vcl/osx vcl/quartz

2021-01-18 Thread Thorsten Wagner (via logerrit)
 desktop/Executable_soffice_bin.mk |   12 -
 include/sal/log-areas.dox |1 
 sot/source/base/exchange.cxx  |8 
 vcl/inc/quartz/CGHelpers.hxx  |2 
 vcl/inc/quartz/salgdi.h   |   11 +
 vcl/osx/DataFlavorMapping.cxx |   79 +
 vcl/osx/salframe.cxx  |   32 ++-
 vcl/osx/salinst.cxx   |   15 +
 vcl/quartz/salbmp.cxx |   22 +-
 vcl/quartz/salgdi.cxx |8 
 vcl/quartz/salgdicommon.cxx   |  314 +++---
 vcl/quartz/salgdiutils.cxx|   41 
 vcl/quartz/salvd.cxx  |  113 +
 13 files changed, 330 insertions(+), 328 deletions(-)

New commits:
commit 2ca3dad5f5604890fa83ed8220cf7deeab26250e
Author: Thorsten Wagner 
AuthorDate: Sun Jan 17 20:24:26 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Mon Jan 18 15:53:50 2021 +0200

tdf#138314 Change selected tab text color on macOS Big Sur

Starting with macOS Big Sur, coloring has changed. Currently there is
no documentation which system color should be used for selected tab
text. As a workaround text color is changed for macOS Big Sur and
newer only.

Change-Id: I2e8c83527775c17f95e5e4afe70577442e14715e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109479
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 71cc5a4f1982..f4c7379cf42b 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1301,27 +1301,37 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // black otherwise
 
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
-Color aSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
+Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
-aStyleSettings.SetDefaultActionButtonTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
 
-// Set text colors for tabs according to OS settings, typically white for 
selected buttons, black otherwise
+// Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
-aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+
+// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
+// used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
+// issue is covered by documentation.
+
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
+aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+else
+
aStyleSettings.SetTabHighlightTextColor(aAlternateSelectedControlTextColor);
 
 aStyleSettings.SetCursorBlinkTime( 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - desktop/Executable_soffice_bin.mk vcl/inc vcl/osx vcl/quartz

2021-01-17 Thread Thorsten Wagner (via logerrit)
 desktop/Executable_soffice_bin.mk |   12 -
 vcl/inc/quartz/salgdi.h   |   16 +
 vcl/osx/salinst.cxx   |   15 +
 vcl/quartz/salbmp.cxx |   22 +-
 vcl/quartz/salgdi.cxx |8 
 vcl/quartz/salgdicommon.cxx   |  315 +++---
 vcl/quartz/salgdiutils.cxx|   41 
 vcl/quartz/salvd.cxx  |  119 +-
 8 files changed, 260 insertions(+), 288 deletions(-)

New commits:
commit 44dfa5ef2ffac1740ba270978de3e1b12484b5e8
Author: Thorsten Wagner 
AuthorDate: Sun Jan 10 23:49:25 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Jan 18 08:28:24 2021 +0100

tdf#138122 Add window scaling for retina displays on macOS

(1) Remove hack to make application look as if being linked against SDK 
10.13

(2) Use quad storage size on virtual devices for displaying on retina 
displays thereafter

(3) Apply workaround to downsample bitmaps from scaled layers (to be 
implemented)

(4) Disable dark mode (to be implemented)

(5) Provide new environment variables:

VCL_MACOS_FORCE_WINDOW_SCALING:
window scaling on non retina displays

VCL_MACOS_FORCE_DARK_MODE:
enable dark mode (macOS 10.14, iOS 13 and newer)

VCL_MACOS_USE_SYSTEM_APPEARANCE:
use light mode or dark mode (macOS 10.14, iOS 13 and newer) as configured 
by system preferences

Change-Id: I99877cd62a98cb91bcbf27af62b043c31c5f5fc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109072
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109495
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/desktop/Executable_soffice_bin.mk 
b/desktop/Executable_soffice_bin.mk
index 5c895ed0e7cb..9c08a28361df 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -23,18 +23,6 @@ $(eval $(call gb_Executable_add_cobjects,soffice_bin,\
 desktop/source/app/main \
 ))
 
-ifeq ($(OS),MACOSX)
-# At least when building against SDK 10.15, changing the LC_VERSION_MIN_MACOSX 
load command's sdk
-# value from 10.15 to "n/a" (i.e., 0.0.0) is necessary to avoid blurry text in 
the LO UI (see
-# 

-# "[driver][darwin] Pass -platform_version flag to the linker instead of the
-# -_version_min flag", 
clang/test/Driver/darwin-ld-platform-version-macos.c in particular,
-# for the -platform_version that Clang passes by default to new-enough ld):
-$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
--Xlinker -platform_version -Xlinker macos -Xlinker 
$(MACOSX_DEPLOYMENT_TARGET) -Xlinker 0.0.0 \
-))
-endif
-
 ifeq ($(OS),WNT)
 
 $(eval $(call gb_Executable_set_targettype_gui,soffice_bin,NO))
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index d718cf788dcc..64eb003e16cd 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -175,6 +175,7 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
+boolmbWindowScaling;
 
 #else // IOS
 
@@ -190,10 +191,10 @@ public:
 boolIsPenVisible() const{ return 
maLineColor.IsVisible(); }
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
+float   GetWindowScaling();
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics(
-CGContextRef, sal_Int32 nRealDPIX, sal_Int32 nRealDPIY );
-voidSetVirDevGraphics(CGLayerHolder const & rLayer, 
CGContextRef, int nBitDepth = 0);
+voidSetPrinterGraphics(CGContextRef, sal_Int32 
nRealDPIX, sal_Int32 nRealDPIY);
+voidSetVirDevGraphics(CGLayerHolder const , 
CGContextRef, int nBitDepth = 0);
 #ifdef MACOSX
 voidinitResolution( NSWindow* );
 voidcopyResolution( AquaSalGraphics& );
@@ -300,9 +301,14 @@ public:
 virtual booldrawAlphaRect( tools::Long nX, tools::Long nY, 
tools::Long nWidth,
tools::Long nHeight, sal_uInt8 
nTransparency ) override;
 
+protected:
+virtual voidcopyScaledArea( tools::Long nDestX, tools::Long 
nDestY, tools::Long nSrcX, tools::Long nSrcY,
+tools::Long nSrcWidth, 
tools::Long nSrcHeight, SalGraphics* pSrcGraphics );
+
 // native widget rendering methods that require mirroring
+
 #ifdef MACOSX
-protected:
+
 virtual boolisNativeControlSupported( ControlType nType, 
ControlPart nPart ) override;
 
 virtual boolhitTestNativeControl( ControlType nType, 
ControlPart nPart, const tools::Rectangle& rControlRegion,
@@ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/osx

2021-01-17 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |   32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

New commits:
commit 1cf7ce5a57e50a734258b83a3919a59aa535241f
Author: Thorsten Wagner 
AuthorDate: Sun Jan 17 20:24:26 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Jan 18 08:06:03 2021 +0100

tdf#138314 Change selected tab text color on macOS Big Sur

Starting with macOS Big Sur, coloring has changed. Currently there is
no documentation which system color should be used for selected tab
text. As a workaround text color is changed for macOS Big Sur and
newer only.

Change-Id: I2e8c83527775c17f95e5e4afe70577442e14715e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109479
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109502
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index b4168a2142e7..9d4f68827a06 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1302,27 +1302,37 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // black otherwise
 
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
-Color aSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
+Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
-aStyleSettings.SetDefaultActionButtonTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
 
-// Set text colors for tabs according to OS settings, typically white for 
selected buttons, black otherwise
+// Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
-aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+
+// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
+// used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
+// issue is covered by documentation.
+
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
+aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+else
+
aStyleSettings.SetTabHighlightTextColor(aAlternateSelectedControlTextColor);
 
 aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/Executable_soffice_bin.mk solenv/clang-format vcl/inc vcl/ios vcl/Library_vcl.mk vcl/Library_vclplug_osx.mk vcl/osx vcl/quart

2021-01-17 Thread Thorsten Wagner (via logerrit)
 desktop/Executable_soffice_bin.mk |   13 -
 solenv/clang-format/blacklist |4 
 vcl/Library_vcl.mk|1 
 vcl/Library_vclplug_osx.mk|3 
 vcl/inc/quartz/salgdi.h   |   15 -
 vcl/ios/salios.cxx|  433 ++
 vcl/osx/salgdiutils.cxx   |   41 ++-
 vcl/osx/salinst.cxx   |   15 +
 vcl/osx/salmacos.cxx  |  383 +
 vcl/quartz/salbmp.cxx |   50 
 vcl/quartz/salgdi.cxx |8 
 vcl/quartz/salgdicommon.cxx   |  236 
 vcl/quartz/salvd.cxx  |  133 ---
 13 files changed, 894 insertions(+), 441 deletions(-)

New commits:
commit f55352d5e79980c358653d18008ac047dc3e0118
Author: Thorsten Wagner 
AuthorDate: Sun Jan 10 23:49:25 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Mon Jan 18 00:25:20 2021 +0100

tdf#138122 Add window scaling for retina displays on macOS, plus fixes for 
iOS

(1) Remove hack to make application look as if being linked against SDK 
10.13

(2) Use quad storage size on virtual devices for displaying on retina 
displays thereafter

(3) Apply workaround to downsample bitmaps from scaled layers (to be 
implemented)

(4) Disable dark mode (to be implemented)

(5) Provide new environment variables:

VCL_MACOS_FORCE_WINDOW_SCALING:
window scaling on non retina displays

VCL_MACOS_FORCE_DARK_MODE:
enable dark mode (macOS 10.14, iOS 13 and newer)

VCL_MACOS_USE_SYSTEM_APPEARANCE:
use light mode or dark mode (macOS 10.14, iOS 13 and newer) as configured 
by system preferences

In this branch, this change also contains the below follow-up fix by
tml in order to pass Jenkins for iOS:

Make vcl compile again for iOS and make the Collabora Office iOS app
work again when built against a master build of core.

For now, keep the old versions of the functions touched by [this
change] in vcl/ios/salios.cxx, and move the modified versions to the
new file vcl/osx/salmacos.cxx.

Keep the functions as they were except that ifdefs for MACOSX or IOS
are expanded. Keep the formatting as it was to make comparisons
easier. Thus add the new files to the clang-format exclusion list.

While at it, also move vcl/quartz/salgdiutils.cxx to vcl/osx as it is
compiled only for macOS anyway.

Change-Id: I99877cd62a98cb91bcbf27af62b043c31c5f5fc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109072
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109493
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/Executable_soffice_bin.mk 
b/desktop/Executable_soffice_bin.mk
index ecf75893ab96..cabd31af29f2 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -31,19 +31,6 @@ $(eval $(call gb_Executable_set_ldflags,\
 
 endif
 
-ifeq ($(OS)-$(HAVE_MACOS_LD_PLATFORMVERSION),MACOSX-TRUE)
-# At least when building against SDK 10.15, changing the LC_VERSION_MIN_MACOSX 
load command's sdk
-# value from 10.15 to "n/a" (i.e., 0.0.0) is necessary to avoid blurry text in 
the LO UI (see
-# 

-# "[driver][darwin] Pass -platform_version flag to the linker instead of the
-# -_version_min flag", 
clang/test/Driver/darwin-ld-platform-version-macos.c in particular,
-# for the -platform_version that Clang passes by default to new-enough ld):
-$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
--Xlinker -platform_version -Xlinker macos -Xlinker 
$(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS) \
--Xlinker 0.0.0 \
-))
-endif
-
 ifeq ($(OS),WNT)
 
 $(eval $(call gb_Executable_set_targettype_gui,soffice_bin,NO))
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 521ff3e43683..864518c389e4 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -17554,6 +17554,7 @@ vcl/inc/window.h
 vcl/inc/wizdlg.hxx
 vcl/ios/dummies.cxx
 vcl/ios/iosinst.cxx
+vcl/ios/salios.cxx
 vcl/null/printerinfomanager.cxx
 vcl/opengl/DeviceInfo.cxx
 vcl/opengl/FixedTextureAtlas.cxx
@@ -17623,7 +17624,9 @@ vcl/osx/documentfocuslistener.cxx
 vcl/osx/documentfocuslistener.hxx
 vcl/osx/saldata.cxx
 vcl/osx/salframe.cxx
+vcl/osx/salgdiutils.cxx
 vcl/osx/salinst.cxx
+vcl/osx/salmacos.cxx
 vcl/osx/salmenu.cxx
 vcl/osx/salnativewidgets.cxx
 vcl/osx/salobj.cxx
@@ -17656,7 +17659,6 @@ vcl/quartz/ctfonts.cxx
 vcl/quartz/salbmp.cxx
 vcl/quartz/salgdi.cxx
 vcl/quartz/salgdicommon.cxx
-vcl/quartz/salgdiutils.cxx
 vcl/quartz/salvd.cxx
 vcl/quartz/utils.cxx
 vcl/source/app/ITiledRenderable.cxx
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 9afdac80ef86..15a083df19a6 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -671,6 +671,7 @@ $(eval $(call 

[Libreoffice-commits] core.git: vcl/osx

2021-01-17 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salframe.cxx |   32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

New commits:
commit 058ad4b900b5e0ee902f3e89ed121c2b5f8c58f1
Author: Thorsten Wagner 
AuthorDate: Sun Jan 17 20:24:26 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Sun Jan 17 21:38:12 2021 +0100

tdf#138314 Change selected tab text color on macOS Big Sur

Starting with macOS Big Sur, coloring has changed. Currently there is
no documentation which system color should be used for selected tab
text. As a workaround text color is changed for macOS Big Sur and
newer only.

Change-Id: I2e8c83527775c17f95e5e4afe70577442e14715e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109479
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index b4168a2142e7..9d4f68827a06 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1302,27 +1302,37 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 // black otherwise
 
 Color aControlTextColor(getColor([NSColor controlTextColor], COL_BLACK, 
mpNSWindow));
-Color aSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
-aStyleSettings.SetDefaultButtonTextColor(aSelectedControlTextColor);
+Color aSelectedControlTextColor(getColor([NSColor 
selectedControlTextColor], COL_BLACK, mpNSWindow));
+Color aAlternateSelectedControlTextColor(getColor([NSColor 
alternateSelectedControlTextColor], COL_WHITE, mpNSWindow));
+
aStyleSettings.SetDefaultButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonTextColor(aControlTextColor);
-aStyleSettings.SetDefaultActionButtonTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetActionButtonRolloverTextColor(aControlTextColor);
 aStyleSettings.SetFlatButtonRolloverTextColor(aControlTextColor);
-
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
-
aStyleSettings.SetActionButtonPressedRolloverTextColor(aSelectedControlTextColor);
+
aStyleSettings.SetDefaultButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetDefaultActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
+
aStyleSettings.SetActionButtonPressedRolloverTextColor(aAlternateSelectedControlTextColor);
 aStyleSettings.SetFlatButtonPressedRolloverTextColor(aControlTextColor);
 
-// Set text colors for tabs according to OS settings, typically white for 
selected buttons, black otherwise
+// Set text colors for tabs according to OS settings
 
 aStyleSettings.SetTabTextColor(aControlTextColor);
-aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+
+// FIXME: Starting with macOS Big Sur, coloring has changed. Currently 
there is no documentation which system color should be
+// used for selected tab text. As a workaround the current OS version has 
to be considered. This code has to be reviewed once
+// issue is covered by documentation.
+
+NSOperatingSystemVersion aOSVersion = { .majorVersion = 11, .minorVersion 
= 0, .patchVersion = 0 };
+if ([NSProcessInfo.processInfo isOperatingSystemAtLeastVersion: 
aOSVersion])
+aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor);
+else
+
aStyleSettings.SetTabHighlightTextColor(aAlternateSelectedControlTextColor);
 
 aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/Executable_soffice_bin.mk vcl/inc vcl/osx vcl/quartz

2021-01-17 Thread Thorsten Wagner (via logerrit)
 desktop/Executable_soffice_bin.mk |   12 -
 vcl/inc/quartz/salgdi.h   |   16 +
 vcl/osx/salinst.cxx   |   15 +
 vcl/quartz/salbmp.cxx |   22 +-
 vcl/quartz/salgdi.cxx |8 
 vcl/quartz/salgdicommon.cxx   |  315 +++---
 vcl/quartz/salgdiutils.cxx|   41 
 vcl/quartz/salvd.cxx  |  124 +-
 8 files changed, 260 insertions(+), 293 deletions(-)

New commits:
commit 1a167625314bf36b735176ed488e6ba9b5e9b675
Author: Thorsten Wagner 
AuthorDate: Sun Jan 10 23:49:25 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Sun Jan 17 19:21:15 2021 +0100

tdf#138122 Add window scaling for retina displays on macOS

(1) Remove hack to make application look as if being linked against SDK 
10.13

(2) Use quad storage size on virtual devices for displaying on retina 
displays thereafter

(3) Apply workaround to downsample bitmaps from scaled layers (to be 
implemented)

(4) Disable dark mode (to be implemented)

(5) Provide new environment variables:

VCL_MACOS_FORCE_WINDOW_SCALING:
window scaling on non retina displays

VCL_MACOS_FORCE_DARK_MODE:
enable dark mode (macOS 10.14, iOS 13 and newer)

VCL_MACOS_USE_SYSTEM_APPEARANCE:
use light mode or dark mode (macOS 10.14, iOS 13 and newer) as configured 
by system preferences

Change-Id: I99877cd62a98cb91bcbf27af62b043c31c5f5fc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109072
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/Executable_soffice_bin.mk 
b/desktop/Executable_soffice_bin.mk
index 5c895ed0e7cb..9c08a28361df 100644
--- a/desktop/Executable_soffice_bin.mk
+++ b/desktop/Executable_soffice_bin.mk
@@ -23,18 +23,6 @@ $(eval $(call gb_Executable_add_cobjects,soffice_bin,\
 desktop/source/app/main \
 ))
 
-ifeq ($(OS),MACOSX)
-# At least when building against SDK 10.15, changing the LC_VERSION_MIN_MACOSX 
load command's sdk
-# value from 10.15 to "n/a" (i.e., 0.0.0) is necessary to avoid blurry text in 
the LO UI (see
-# 

-# "[driver][darwin] Pass -platform_version flag to the linker instead of the
-# -_version_min flag", 
clang/test/Driver/darwin-ld-platform-version-macos.c in particular,
-# for the -platform_version that Clang passes by default to new-enough ld):
-$(eval $(call gb_Executable_add_ldflags,soffice_bin, \
--Xlinker -platform_version -Xlinker macos -Xlinker 
$(MACOSX_DEPLOYMENT_TARGET) -Xlinker 0.0.0 \
-))
-endif
-
 ifeq ($(OS),WNT)
 
 $(eval $(call gb_Executable_set_targettype_gui,soffice_bin,NO))
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 6d7db6a6dd60..eb3e7563c898 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -174,6 +174,7 @@ class AquaSalGraphics : public SalGraphics
 #ifdef MACOSX
 /// is this a window graphics
 boolmbWindow;
+boolmbWindowScaling;
 
 #else // IOS
 
@@ -189,10 +190,10 @@ public:
 boolIsPenVisible() const{ return 
maLineColor.IsVisible(); }
 boolIsBrushVisible() const  { return 
maFillColor.IsVisible(); }
 
+float   GetWindowScaling();
 voidSetWindowGraphics( AquaSalFrame* pFrame );
-voidSetPrinterGraphics(
-CGContextRef, sal_Int32 nRealDPIX, sal_Int32 nRealDPIY );
-voidSetVirDevGraphics(CGLayerHolder const & rLayer, 
CGContextRef, int nBitDepth = 0);
+voidSetPrinterGraphics(CGContextRef, sal_Int32 
nRealDPIX, sal_Int32 nRealDPIY);
+voidSetVirDevGraphics(CGLayerHolder const , 
CGContextRef, int nBitDepth = 0);
 #ifdef MACOSX
 voidinitResolution( NSWindow* );
 voidcopyResolution( AquaSalGraphics& );
@@ -299,9 +300,14 @@ public:
 virtual booldrawAlphaRect( tools::Long nX, tools::Long nY, 
tools::Long nWidth,
tools::Long nHeight, sal_uInt8 
nTransparency ) override;
 
+protected:
+virtual voidcopyScaledArea( tools::Long nDestX, tools::Long 
nDestY, tools::Long nSrcX, tools::Long nSrcY,
+tools::Long nSrcWidth, 
tools::Long nSrcHeight, SalGraphics* pSrcGraphics );
+
 // native widget rendering methods that require mirroring
+
 #ifdef MACOSX
-protected:
+
 virtual boolisNativeControlSupported( ControlType nType, 
ControlPart nPart ) override;
 
 virtual boolhitTestNativeControl( ControlType nType, 
ControlPart nPart, const tools::Rectangle& rControlRegion,
@@ -313,9 +319,9 @@ protected:
 const ImplControlValue& 
aValue, const 

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

2020-09-09 Thread Thorsten Wagner (via logerrit)
 vcl/source/control/button.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 6be0a806dcce864fb4d604be68e8b3711fc604d6
Author: Thorsten Wagner 
AuthorDate: Tue Jul 28 00:36:07 2020 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 9 08:26:52 2020 +0200

tdf#134708 Text coloring of buttons within forms amended

Change-Id: I55f91ff626a55ab588ac49a085070c0d9f919e68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99564
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 84b2849512bdb19597739d9515dd55e2d3ba9504)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101857
Reviewed-by: Thorsten Wagner 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 7e0a1bfa81fa..048ff2181c25 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -752,6 +752,13 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice 
*pDev, DrawFlags nDrawFl
 if (nDrawFlags & DrawFlags::Mono)
 aColor = COL_BLACK;
 
+// Custom foreground color is reasonable on stock controls only. Stock 
controls are used if a custom background has been set
+// (and thus no native controls are able to be used) or no native controls 
are available.
+
+else if (IsControlForeground()
+ && (IsControlBackground() || 
!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire)))
+aColor = GetControlForeground();
+
 // Button types with possibly different text coloring are flat buttons and 
regular buttons. Regular buttons may be action
 // buttons and may have an additional default status. Moreover all buttons 
may have an additional pressed and rollover
 // (highlight) status. Pressed buttons are always in rollover status.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-02 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salnativewidgets.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit cb8bf2cea598b48783e2d7d60ef711ec438719a4
Author: Thorsten Wagner 
AuthorDate: Sat Aug 1 19:49:38 2020 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 2 12:22:34 2020 +0200

tdf#133564: Text coloring of buttons within non key windows on macOS amended

Change-Id: I815fcf82440a7e5d14ae457cc659a5fe6a9f8c52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99946
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 4b1ecab984dc46ad7dfdd8a071c94553a6c03633)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99920
Reviewed-by: Xisco Fauli 

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 230735401993..54e2cde82e23 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -232,7 +232,12 @@ bool AquaSalGraphics::hitTestNativeControl(ControlType 
nType, ControlPart nPart,
 
 UInt32 AquaSalGraphics::getState(ControlState nState)
 {
-const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() 
isKeyWindow];
+
+// there are non key windows which are childs of key windows, e.g. 
autofilter configuration dialog or sidebar dropdown dialogs.
+// To handle these windows correctly, parent frame's key window state is 
considered here additionally.
+
+const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() 
isKeyWindow]
+ || mpFrame->mpParent == nullptr || 
[mpFrame->mpParent->getNSWindow() isKeyWindow];
 if (!(nState & ControlState::ENABLED) || !bDrawActive)
 {
 return kThemeStateInactive;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/osx

2020-09-02 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salnativewidgets.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7e7af0658d9c769d9e5b3614e5f3fef3187ea833
Author: Thorsten Wagner 
AuthorDate: Thu Aug 13 10:57:59 2020 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 2 12:21:53 2020 +0200

tdf#133564: Text coloring of buttons within non key windows on macOS 
reworked

Change-Id: Ida31f59c853eb3312175cd6dd99b7b1006e014a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100650
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index e01470a58e76..7776009e9704 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -237,7 +237,7 @@ UInt32 AquaSalGraphics::getState(ControlState nState)
 // To handle these windows correctly, parent frame's key window state is 
considered here additionally.
 
 const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() 
isKeyWindow]
- || (mpFrame->mpParent != nullptr && 
[mpFrame->mpParent->getNSWindow() isKeyWindow]);
+ || mpFrame->mpParent == nullptr || 
[mpFrame->mpParent->getNSWindow() isKeyWindow];
 if (!(nState & ControlState::ENABLED) || !bDrawActive)
 {
 return kThemeStateInactive;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-27 Thread Thorsten Wagner (via logerrit)
 vcl/source/control/button.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 84b2849512bdb19597739d9515dd55e2d3ba9504
Author: Thorsten Wagner 
AuthorDate: Tue Jul 28 00:36:07 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 27 12:55:40 2020 +0200

tdf#134708 Text coloring of buttons within forms amended

Change-Id: I55f91ff626a55ab588ac49a085070c0d9f919e68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99564
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 49dd0c204dbb..531315a09233 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -752,6 +752,13 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice 
*pDev, DrawFlags nDrawFl
 if (nDrawFlags & DrawFlags::Mono)
 aColor = COL_BLACK;
 
+// Custom foreground color is reasonable on stock controls only. Stock 
controls are used if a custom background has been set
+// (and thus no native controls are able to be used) or no native controls 
are available.
+
+else if (IsControlForeground()
+ && (IsControlBackground() || 
!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Entire)))
+aColor = GetControlForeground();
+
 // Button types with possibly different text coloring are flat buttons and 
regular buttons. Regular buttons may be action
 // buttons and may have an additional default status. Moreover all buttons 
may have an additional pressed and rollover
 // (highlight) status. Pressed buttons are always in rollover status.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/osx

2020-08-02 Thread Thorsten Wagner (via logerrit)
 vcl/osx/salnativewidgets.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 4b1ecab984dc46ad7dfdd8a071c94553a6c03633
Author: Thorsten Wagner 
AuthorDate: Sat Aug 1 19:49:38 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sun Aug 2 11:00:57 2020 +0200

tdf#133564: Text coloring of buttons within non key windows on macOS amended

Change-Id: I815fcf82440a7e5d14ae457cc659a5fe6a9f8c52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99946
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 230735401993..d50c3956cdf6 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -232,7 +232,12 @@ bool AquaSalGraphics::hitTestNativeControl(ControlType 
nType, ControlPart nPart,
 
 UInt32 AquaSalGraphics::getState(ControlState nState)
 {
-const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() 
isKeyWindow];
+
+// there are non key windows which are childs of key windows, e.g. 
autofilter configuration dialog or sidebar dropdown dialogs.
+// To handle these windows correctly, parent frame's key window state is 
considered here additionally.
+
+const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() 
isKeyWindow]
+ || (mpFrame->mpParent != nullptr && 
[mpFrame->mpParent->getNSWindow() isKeyWindow]);
 if (!(nState & ControlState::ENABLED) || !bDrawActive)
 {
 return kThemeStateInactive;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-17 Thread Thorsten Wagner (via logerrit)
 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 
AuthorDate: Tue Jun 16 00:28:41 2020 +0200
Commit: Adolfo Jayme Barrientos 
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 
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 
(cherry picked from commit 45261267964d6fa1e820b0e4a7745e2e10fcb5f7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96503
Reviewed-by: Adolfo Jayme Barrientos 

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 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::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, , ToolBoxItemBits::NONE, 8);
+InsertWindow(7, , 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
-intdragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? 
ImplGetDragWidth() : 0;
+int dragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? ImplGetDragWidth() 
: 0;
 
-// no shadow border for dockable toolbars
-intborderwidth = 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)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2020-06-17 Thread Thorsten Wagner (via logerrit)
 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 
AuthorDate: Tue Jun 16 00:28:41 2020 +0200
Commit: Heiko Tietze 
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 
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

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 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::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, , ToolBoxItemBits::NONE, 8);
+InsertWindow(7, , 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
-intdragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? 
ImplGetDragWidth() : 0;
+int dragwidth = ( pWrapper && !pWrapper->IsLocked() ) ? ImplGetDragWidth() 
: 0;
 
-// no shadow border for dockable toolbars
-intborderwidth = 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)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/vcl vcl/headless vcl/inc vcl/osx vcl/qt5 vcl/source vcl/unx vcl/win

2020-03-06 Thread Thorsten Wagner (via logerrit)
 include/vcl/settings.hxx|   31 
 vcl/headless/CustomWidgetDraw.cxx   |   17 ++
 vcl/inc/WidgetThemeLibrary.hxx  |   12 +
 vcl/inc/widgetdraw/WidgetDefinition.hxx |   12 +
 vcl/osx/salframe.cxx|   34 
 vcl/qt5/Qt5Frame.cxx|   11 +
 vcl/source/app/settings.cxx |  192 
 vcl/source/control/button.cxx   |   86 +++-
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx |   17 ++
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx   |7 -
 vcl/win/window/salframe.cxx |   37 +++--
 11 files changed, 373 insertions(+), 83 deletions(-)

New commits:
commit 8d11b953c0a69f4f5eb5ca42dec3812a62d0cd0f
Author: Thorsten Wagner 
AuthorDate: Sun Feb 23 21:11:05 2020 +0100
Commit: Tomaž Vajngerl 
CommitDate: Fri Mar 6 20:36:23 2020 +0100

tdf#125532: White text on default/action buttons and selected tabs on macOS

Change-Id: I58ce75e711504553c8fc606382866754286f1aa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89313
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 347c861bc5aa..6adda0d66fa2 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -245,6 +245,9 @@ public:
 voidSetDarkShadowColor( const Color& rColor );
 const Color&GetDarkShadowColor() const;
 
+voidSetDefaultButtonTextColor( const Color& 
rColor );
+const Color&GetDefaultButtonTextColor() const;
+
 voidSetButtonTextColor( const Color& rColor );
 const Color&GetButtonTextColor() const;
 
@@ -254,15 +257,39 @@ public:
 voidSetActionButtonTextColor( const Color& 
rColor );
 const Color&GetActionButtonTextColor() const;
 
-voidSetActionButtonRolloverTextColor( const 
Color& rColor );
-const Color&GetActionButtonRolloverTextColor() const;
+voidSetFlatButtonTextColor( const Color& 
rColor );
+const Color&GetFlatButtonTextColor() const;
+
+voidSetDefaultButtonRolloverTextColor( const 
Color& rColor );
+const Color&GetDefaultButtonRolloverTextColor() const;
 
 voidSetButtonRolloverTextColor( const Color& 
rColor );
 const Color&GetButtonRolloverTextColor() const;
 
+voidSetDefaultActionButtonRolloverTextColor( 
const Color& rColor );
+const Color&GetDefaultActionButtonRolloverTextColor() 
const;
+
+voidSetActionButtonRolloverTextColor( const 
Color& rColor );
+const Color&GetActionButtonRolloverTextColor() const;
+
+voidSetFlatButtonRolloverTextColor( const 
Color& rColor );
+const Color&GetFlatButtonRolloverTextColor() const;
+
+voidSetDefaultButtonPressedRolloverTextColor( 
const Color& rColor );
+const Color&GetDefaultButtonPressedRolloverTextColor() 
const;
+
 voidSetButtonPressedRolloverTextColor( const 
Color& rColor );
 const Color&GetButtonPressedRolloverTextColor() const;
 
+void
SetDefaultActionButtonPressedRolloverTextColor( const Color& rColor );
+const Color&
GetDefaultActionButtonPressedRolloverTextColor() const;
+
+voidSetActionButtonPressedRolloverTextColor( 
const Color& rColor );
+const Color&GetActionButtonPressedRolloverTextColor() 
const;
+
+voidSetFlatButtonPressedRolloverTextColor( 
const Color& rColor );
+const Color&GetFlatButtonPressedRolloverTextColor() 
const;
+
 voidSetRadioCheckTextColor( const Color& 
rColor );
 const Color&GetRadioCheckTextColor() const;
 
diff --git a/vcl/headless/CustomWidgetDraw.cxx 
b/vcl/headless/CustomWidgetDraw.cxx
index 343f5cd75a4e..600875d5c4ca 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -344,11 +344,26 @@ bool CustomWidgetDraw::updateSettings(AllSettings& 
rSettings)
 aStyleSet.SetLightBorderColor(aStyle.maLightBorderColor);
 aStyleSet.SetShadowColor(aStyle.maShadowColor);
 aStyleSet.SetDarkShadowColor(aStyle.maDarkShadowColor);
+aStyleSet.SetDefaultButtonTextColor(aStyle.maDefaultButtonTextColor);
 aStyleSet.SetButtonTextColor(aStyle.maButtonTextColor);
-

[Libreoffice-commits] core.git: cui/uiconfig

2020-03-05 Thread Thorsten Wagner (via logerrit)
 cui/uiconfig/ui/cellalignment.ui |   36 ++--
 1 file changed, 10 insertions(+), 26 deletions(-)

New commits:
commit d264170ebbc92f8a920cd51d7f6f2744aa465be1
Author: Thorsten Wagner 
AuthorDate: Sun Feb 2 15:32:53 2020 +0100
Commit: Heiko Tietze 
CommitDate: Thu Mar 5 12:26:12 2020 +0100

tdf#128943: Remove frame around reference edge widget

Change-Id: I27412f62574ec6f8c86b7cfa2f7da7344c151064
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87422
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

diff --git a/cui/uiconfig/ui/cellalignment.ui b/cui/uiconfig/ui/cellalignment.ui
index a9074c61a943..1bc1261d2e13 100644
--- a/cui/uiconfig/ui/cellalignment.ui
+++ b/cui/uiconfig/ui/cellalignment.ui
@@ -72,44 +72,28 @@
   
 
 
-  
+  
 True
 True
-start
-never
-never
-in
-
-  
-True
-False
-
-  
-True
-True
-GDK_BUTTON_PRESS_MASK 
| GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_STRUCTURE_MASK
-start
-  
-
-  
-
+True
+adjustmentSpinDegrees
+True
   
   
 1
-1
+0
   
 
 
-  
+  
 True
-True
-True
-adjustmentSpinDegrees
-True
+False
+GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_STRUCTURE_MASK
+start
   
   
 1
-0
+1
   
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cui/uiconfig

2020-01-25 Thread Thorsten Wagner (via logerrit)
 cui/uiconfig/ui/rotationtabpage.ui |   33 ++---
 1 file changed, 10 insertions(+), 23 deletions(-)

New commits:
commit 4623b903e16c379a56c63c31ba84cf447bcfe7f9
Author: Thorsten Wagner 
AuthorDate: Fri Jan 24 15:44:26 2020 +
Commit: Caolán McNamara 
CommitDate: Sat Jan 25 18:31:17 2020 +0100

tdf#128942 Remove frame around rotation wheel within Position and Size 
dialog

Change-Id: I62ed118ba862a164b6cbd21ad5757b7d3731cd44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87348
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/cui/uiconfig/ui/rotationtabpage.ui 
b/cui/uiconfig/ui/rotationtabpage.ui
index a4f1b0eb6d73..5d3f9a1acbe5 100644
--- a/cui/uiconfig/ui/rotationtabpage.ui
+++ b/cui/uiconfig/ui/rotationtabpage.ui
@@ -257,43 +257,30 @@
 vertical
 6
 
-  
+  
 True
 False
-Default _settings:
-True
+GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_STRUCTURE_MASK
+Rotation Angle
+center
   
   
 False
 True
-1
+0
   
 
 
-  
+  
 True
-True
-center
-in
-
-  
-True
-False
-
-  
-True
-False
-GDK_BUTTON_PRESS_MASK 
| GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_STRUCTURE_MASK
-Rotation 
Angle
-  
-
-  
-
+False
+Default _settings:
+True
   
   
 False
 True
-0
+1
   
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - vcl/inc vcl/osx

2020-01-03 Thread Thorsten Wagner (via logerrit)
 vcl/inc/osx/salnativewidgets.h |   60 -
 vcl/osx/salnativewidgets.cxx   | 1625 ++---
 2 files changed, 768 insertions(+), 917 deletions(-)

New commits:
commit 3367c986b78397c05e051daede2a8b60d705bffb
Author: Thorsten Wagner 
AuthorDate: Wed Jan 1 14:43:38 2020 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jan 4 06:08:37 2020 +0100

tdf#125536 macOS native Carbon widgets reworked

Change-Id: Id60895a48f59cb3c55db39d18cd27fed2108727e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86066
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 9d31d8f1d8d3a73f8c07ca39f5ed45e2bb7b088c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86155
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/inc/osx/salnativewidgets.h b/vcl/inc/osx/salnativewidgets.h
index 1ba697afafa2..67d3a37612e7 100644
--- a/vcl/inc/osx/salnativewidgets.h
+++ b/vcl/inc/osx/salnativewidgets.h
@@ -20,42 +20,50 @@
 #ifndef INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 #define INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 
-// since 10.4 ... no metrics are returned, and we have to fix the values
-#define BUTTON_WIDTH 16
-#define BUTTON_HEIGHT 17
+#define TAB_HEIGHT 20 // height of tab header in pixels
+#define TAB_TEXT_MARGIN 12// left/right margin of text within tab 
headers
+#define VCL_TAB_TEXT_SEPARATOR 2  // Space between two tabs required by VCL
 
-//standard height of the AHIG
-//tabs
-#define TAB_HEIGHT_NORMAL 20
+#define FOCUS_RING_WIDTH 4  // width of focus ring in pixels
 
-#define TAB_TEXT_OFFSET 12
-#define VCL_TAB_TEXT_OFFSET 2
+#define MEDIUM_PROGRESS_INDICATOR_HEIGHT 10  // height of medium progress 
indicator in pixels
+#define LARGE_PROGRESS_INDICATOR_HEIGHT 16   // height of large progress 
indicator in pixels
 
-//listboxes, comboboxes (they have the same dimensions)
-#define COMBOBOX_HEIGHT_NORMAL 20
-#define DROPDOWN_BUTTON_WIDTH 20
+#define PUSH_BUTTON_NORMAL_HEIGHT 21  // height of normal push button without 
focus ring in pixels
+#define PUSH_BUTTON_SMALL_HEIGHT 15   // height of small push button without 
focus ring in pixels
 
-//text edit
-#define TEXT_EDIT_HEIGHT_NORMAL 22
+#define RADIO_BUTTON_SMALL_SIZE 14 // width/height of small radio button 
without focus ring in pixels
+#define RADIO_BUTTON_TEXT_SEPARATOR 3  // space between radio button and 
following text in pixels
 
-//spin box
-#define SPIN_BUTTON_SPACE   2
-#define SPIN_BUTTON_WIDTH   13
-#define SPIN_UPPER_BUTTON_HEIGHT11
-#define SPIN_LOWER_BUTTON_HEIGHT10
+#define CHECKBOX_SMALL_SIZE 14 // width/heiht of checkbox without focus 
ring in pixels
+#define CHECKBOX_TEXT_SEPARATOR 3  // space between checkbox and following 
text in pixels
 
-// progress bar
-#define INTRO_PROGRESS_HEIGHT 9
+#define SLIDER_WIDTH 19   // width of slider in pixels
+#define SLIDER_HEIGHT 18  // height of slider in pixels
 
-// for some controls, like spinbuttons + spinboxes, or listboxes
-// we need it to adjust text position beside radio and check buttons
+#define EDITBOX_HEIGHT 21   // height of editbox without focus ring in 
pixels
+#define EDITBOX_BORDER_WIDTH 1  // width of editbox border in pixels
+#define EDITBOX_INSET_MARGIN 1  // width of left/right as well as top/bottom 
editbox margin in pixels
 
-#define TEXT_SEPARATOR 3
+#define COMBOBOX_HEIGHT 20// height of combobox without focus ring in 
pixels
+#define COMBOBOX_BUTTON_WIDTH 18  // width of combobox button without focus 
ring in pixels
+#define COMBOBOX_BORDER_WIDTH 1   // width of combobox border in pixels
+#define COMBOBOX_TEXT_MARGIN 1// left/right margin of text in pixels
 
-// extra border for focus ring
-#define FOCUS_RING_WIDTH 4
+#define LISTBOX_HEIGHT 20// height of listbox without focus ring in 
pixels
+#define LISTBOX_BUTTON_WIDTH 18  // width of listbox button without focus ring 
in pixels
+#define LISTBOX_BORDER_WIDTH 1   // width of listbox border in pixels
+#define LISTBOX_TEXT_MARGIN 1// left/right margin of text in pixels
 
-#define CLIP_FUZZ 1
+#define SPIN_BUTTON_WIDTH 13 // width of spin button without focus 
ring in pixels
+#define SPIN_UPPER_BUTTON_HEIGHT 11  // height of upper spin button without 
focus ring in pixels
+#define SPIN_LOWER_BUTTON_HEIGHT 11  // height of lower spin button without 
focus ring in pixels
+
+// FIXME: spinboxes are positioned one pixel shifted to the right by VCL. As 
positioning as well as size should be equal to
+// corresponing editboxes, comboboxes or listboxes, positioning of spinboxes 
should by equal too. Issue cannot be fixed within
+// native widget drawing code. As a workaround, an offset is considered for 
spinboxes to align spinboxes correctly.
+
+#define SPINBOX_OFFSET 1  // left offset for alignment with editboxes, 
comboboxes, and listboxes
 
 #endif // INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 
diff --git a/vcl/osx/salnativewidgets.cxx 

[Libreoffice-commits] core.git: vcl/inc vcl/osx

2020-01-02 Thread Thorsten Wagner (via logerrit)
 vcl/inc/osx/salnativewidgets.h |   60 -
 vcl/osx/salnativewidgets.cxx   | 1625 ++---
 2 files changed, 768 insertions(+), 917 deletions(-)

New commits:
commit 9d31d8f1d8d3a73f8c07ca39f5ed45e2bb7b088c
Author: Thorsten Wagner 
AuthorDate: Wed Jan 1 14:43:38 2020 +0100
Commit: Noel Grandin 
CommitDate: Thu Jan 2 19:15:07 2020 +0100

tdf#125536 macOS native Carbon widgets reworked

Change-Id: Id60895a48f59cb3c55db39d18cd27fed2108727e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86066
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/osx/salnativewidgets.h b/vcl/inc/osx/salnativewidgets.h
index 1ba697afafa2..67d3a37612e7 100644
--- a/vcl/inc/osx/salnativewidgets.h
+++ b/vcl/inc/osx/salnativewidgets.h
@@ -20,42 +20,50 @@
 #ifndef INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 #define INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 
-// since 10.4 ... no metrics are returned, and we have to fix the values
-#define BUTTON_WIDTH 16
-#define BUTTON_HEIGHT 17
+#define TAB_HEIGHT 20 // height of tab header in pixels
+#define TAB_TEXT_MARGIN 12// left/right margin of text within tab 
headers
+#define VCL_TAB_TEXT_SEPARATOR 2  // Space between two tabs required by VCL
 
-//standard height of the AHIG
-//tabs
-#define TAB_HEIGHT_NORMAL 20
+#define FOCUS_RING_WIDTH 4  // width of focus ring in pixels
 
-#define TAB_TEXT_OFFSET 12
-#define VCL_TAB_TEXT_OFFSET 2
+#define MEDIUM_PROGRESS_INDICATOR_HEIGHT 10  // height of medium progress 
indicator in pixels
+#define LARGE_PROGRESS_INDICATOR_HEIGHT 16   // height of large progress 
indicator in pixels
 
-//listboxes, comboboxes (they have the same dimensions)
-#define COMBOBOX_HEIGHT_NORMAL 20
-#define DROPDOWN_BUTTON_WIDTH 20
+#define PUSH_BUTTON_NORMAL_HEIGHT 21  // height of normal push button without 
focus ring in pixels
+#define PUSH_BUTTON_SMALL_HEIGHT 15   // height of small push button without 
focus ring in pixels
 
-//text edit
-#define TEXT_EDIT_HEIGHT_NORMAL 22
+#define RADIO_BUTTON_SMALL_SIZE 14 // width/height of small radio button 
without focus ring in pixels
+#define RADIO_BUTTON_TEXT_SEPARATOR 3  // space between radio button and 
following text in pixels
 
-//spin box
-#define SPIN_BUTTON_SPACE   2
-#define SPIN_BUTTON_WIDTH   13
-#define SPIN_UPPER_BUTTON_HEIGHT11
-#define SPIN_LOWER_BUTTON_HEIGHT10
+#define CHECKBOX_SMALL_SIZE 14 // width/heiht of checkbox without focus 
ring in pixels
+#define CHECKBOX_TEXT_SEPARATOR 3  // space between checkbox and following 
text in pixels
 
-// progress bar
-#define INTRO_PROGRESS_HEIGHT 9
+#define SLIDER_WIDTH 19   // width of slider in pixels
+#define SLIDER_HEIGHT 18  // height of slider in pixels
 
-// for some controls, like spinbuttons + spinboxes, or listboxes
-// we need it to adjust text position beside radio and check buttons
+#define EDITBOX_HEIGHT 21   // height of editbox without focus ring in 
pixels
+#define EDITBOX_BORDER_WIDTH 1  // width of editbox border in pixels
+#define EDITBOX_INSET_MARGIN 1  // width of left/right as well as top/bottom 
editbox margin in pixels
 
-#define TEXT_SEPARATOR 3
+#define COMBOBOX_HEIGHT 20// height of combobox without focus ring in 
pixels
+#define COMBOBOX_BUTTON_WIDTH 18  // width of combobox button without focus 
ring in pixels
+#define COMBOBOX_BORDER_WIDTH 1   // width of combobox border in pixels
+#define COMBOBOX_TEXT_MARGIN 1// left/right margin of text in pixels
 
-// extra border for focus ring
-#define FOCUS_RING_WIDTH 4
+#define LISTBOX_HEIGHT 20// height of listbox without focus ring in 
pixels
+#define LISTBOX_BUTTON_WIDTH 18  // width of listbox button without focus ring 
in pixels
+#define LISTBOX_BORDER_WIDTH 1   // width of listbox border in pixels
+#define LISTBOX_TEXT_MARGIN 1// left/right margin of text in pixels
 
-#define CLIP_FUZZ 1
+#define SPIN_BUTTON_WIDTH 13 // width of spin button without focus 
ring in pixels
+#define SPIN_UPPER_BUTTON_HEIGHT 11  // height of upper spin button without 
focus ring in pixels
+#define SPIN_LOWER_BUTTON_HEIGHT 11  // height of lower spin button without 
focus ring in pixels
+
+// FIXME: spinboxes are positioned one pixel shifted to the right by VCL. As 
positioning as well as size should be equal to
+// corresponing editboxes, comboboxes or listboxes, positioning of spinboxes 
should by equal too. Issue cannot be fixed within
+// native widget drawing code. As a workaround, an offset is considered for 
spinboxes to align spinboxes correctly.
+
+#define SPINBOX_OFFSET 1  // left offset for alignment with editboxes, 
comboboxes, and listboxes
 
 #endif // INCLUDED_VCL_INC_OSX_SALNATIVEWIDGETS_H
 
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 6e94cd3e4df3..5248251480c5 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -36,6 +36,22 @@
 
 #include "cuidraw.hxx"
 
+// 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source

2019-09-08 Thread Thorsten Wagner (via logerrit)
 sc/source/ui/app/inputwin.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit cd28e8b36c95a8de71b9a8a0ac6702b8018eedac
Author: Thorsten Wagner 
AuthorDate: Mon Aug 26 15:18:51 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Sep 8 13:56:09 2019 +0200

tdf#127066 Font size of Calc input bar aligned to UI font size

Change-Id: I1f1aa4195c4b4be8987b0686d3f157ecea3fecce
Reviewed-on: https://gerrit.libreoffice.org/78140
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 
(cherry picked from commit e757a88f5141a2816d6c69bff5234c9f8802c79a)
Reviewed-on: https://gerrit.libreoffice.org/78764
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e206a3506669..216a5bd6477e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -74,7 +74,6 @@ namespace com::sun::star::accessibility { class XAccessible; }
 
 const long THESIZE = 100;// Should be more than enough!
 const long INPUTLINE_INSET_MARGIN = 2;   // Space between border and interior 
widgets of input line
-const long MIN_FONT_SIZE = 16;   // Minimum font size of input line in 
pixels
 const long LEFT_OFFSET = 5;  // Left offset of input line
 const long BUTTON_OFFSET = 2;// Space between input line and 
button to expand/collapse
 const long MULTILINE_BUTTON_WIDTH = 20;  // Width of the button which opens 
multiline dropdown
@@ -1434,8 +1433,6 @@ ScTextWnd::ScTextWnd(ScTextWndGroup* pParent, 
ScTabViewShell* pViewSh)
 vcl::Font aAppFont = GetFont();
 aTextFont = aAppFont;
 Size aFontSize = aAppFont.GetFontSize();
-if (aFontSize.Height() < MIN_FONT_SIZE)
-aFontSize.setHeight(MIN_FONT_SIZE);
 aTextFont.SetFontSize(PixelToLogic(aFontSize, MapMode(MapUnit::MapTwip)));
 
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3-2' - sc/source

2019-09-08 Thread Thorsten Wagner (via logerrit)
 sc/source/ui/app/inputwin.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit b613ca105b080bb275d6f687b6b443b10b27c284
Author: Thorsten Wagner 
AuthorDate: Mon Aug 26 15:18:51 2019 +0200
Commit: Heiko Tietze 
CommitDate: Sun Sep 8 09:50:41 2019 +0200

tdf#127066 Font size of Calc input bar aligned to UI font size

Change-Id: I1f1aa4195c4b4be8987b0686d3f157ecea3fecce
Reviewed-on: https://gerrit.libreoffice.org/78140
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 
(cherry picked from commit e757a88f5141a2816d6c69bff5234c9f8802c79a)
Reviewed-on: https://gerrit.libreoffice.org/78748

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e206a3506669..216a5bd6477e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -74,7 +74,6 @@ namespace com::sun::star::accessibility { class XAccessible; }
 
 const long THESIZE = 100;// Should be more than enough!
 const long INPUTLINE_INSET_MARGIN = 2;   // Space between border and interior 
widgets of input line
-const long MIN_FONT_SIZE = 16;   // Minimum font size of input line in 
pixels
 const long LEFT_OFFSET = 5;  // Left offset of input line
 const long BUTTON_OFFSET = 2;// Space between input line and 
button to expand/collapse
 const long MULTILINE_BUTTON_WIDTH = 20;  // Width of the button which opens 
multiline dropdown
@@ -1434,8 +1433,6 @@ ScTextWnd::ScTextWnd(ScTextWndGroup* pParent, 
ScTabViewShell* pViewSh)
 vcl::Font aAppFont = GetFont();
 aTextFont = aAppFont;
 Size aFontSize = aAppFont.GetFontSize();
-if (aFontSize.Height() < MIN_FONT_SIZE)
-aFontSize.setHeight(MIN_FONT_SIZE);
 aTextFont.SetFontSize(PixelToLogic(aFontSize, MapMode(MapUnit::MapTwip)));
 
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-04 Thread Thorsten Wagner (via logerrit)
 sc/source/ui/app/inputwin.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit e757a88f5141a2816d6c69bff5234c9f8802c79a
Author: Thorsten Wagner 
AuthorDate: Mon Aug 26 15:18:51 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Sep 5 05:14:26 2019 +0200

tdf#127066 Font size of Calc input bar aligned to UI font size

Change-Id: I1f1aa4195c4b4be8987b0686d3f157ecea3fecce
Reviewed-on: https://gerrit.libreoffice.org/78140
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3d0f598d902f..3d77c561468e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -75,7 +75,6 @@ namespace com::sun::star::accessibility { class XAccessible; }
 
 const long THESIZE = 100;// Should be more than enough!
 const long INPUTLINE_INSET_MARGIN = 2;   // Space between border and interior 
widgets of input line
-const long MIN_FONT_SIZE = 16;   // Minimum font size of input line in 
pixels
 const long LEFT_OFFSET = 5;  // Left offset of input line
 const long BUTTON_OFFSET = 2;// Space between input line and 
button to expand/collapse
 const long MULTILINE_BUTTON_WIDTH = 20;  // Width of the button which opens 
multiline dropdown
@@ -1440,8 +1439,6 @@ ScTextWnd::ScTextWnd(ScTextWndGroup* pParent, 
ScTabViewShell* pViewSh)
 vcl::Font aAppFont = GetFont();
 aTextFont = aAppFont;
 Size aFontSize = aAppFont.GetFontSize();
-if (aFontSize.Height() < MIN_FONT_SIZE)
-aFontSize.setHeight(MIN_FONT_SIZE);
 aTextFont.SetFontSize(PixelToLogic(aFontSize, MapMode(MapUnit::MapTwip)));
 
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-18 Thread Thorsten Wagner (via logerrit)
 sc/source/ui/app/inputwin.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2b4efc32e822bf41c4b729137718f3c70f692a89
Author: Thorsten Wagner 
AuthorDate: Mon Jun 17 22:30:15 2019 +0200
Commit: Katarina Behrens 
CommitDate: Thu Jul 18 10:09:13 2019 +0200

tdf#101443 Horizontal inset margin of Calc input bar increased

Change-Id: Ic609da4b8b5fae0f556761c4493e490c82a6386d
Reviewed-on: https://gerrit.libreoffice.org/74214
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 14cd3595c5be..5732411a5bbf 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -999,9 +999,9 @@ ScTextWndGroup::ScTextWndGroup(vcl::Window* pParent, 
ScTabViewShell* pViewSh)
   maTextWnd(VclPtr::Create(this, pViewSh)),
   maScrollBar(VclPtr::Create(this, WB_TABSTOP | WB_VERT | 
WB_DRAG))
 {
-maTextWnd->SetPosPixel(Point(gnBorderWidth, gnBorderHeight));
+maTextWnd->SetPosPixel(Point(2 * gnBorderWidth, gnBorderHeight));
 Size aSize = GetSizePixel();
-maTextWnd->SetSizePixel(Size(aSize.Width() - 2 * gnBorderWidth, 
aSize.Height() - 2 * gnBorderHeight));
+maTextWnd->SetSizePixel(Size(aSize.Width() - 4 * gnBorderWidth, 
aSize.Height() - 2 * gnBorderHeight));
 maTextWnd->Show();
 maTextWnd->SetQuickHelpText(ScResId(SCSTR_QHELP_INPUTWND));
 maTextWnd->SetHelpId(HID_INSWIN_INPUT);
@@ -,13 +,13 @@ void ScTextWndGroup::Resize()
 maScrollBar->SetLineSize(maTextWnd->GetTextHeight());
 maScrollBar->Resize();
 maScrollBar->Show();
-maTextWnd->SetSizePixel(Size(aSize.Width() - aScrollBarSize.Width() - 
gnBorderWidth - 1,
+maTextWnd->SetSizePixel(Size(aSize.Width() - aScrollBarSize.Width() - 
3 * gnBorderWidth - 1,
  aSize.Height() - 2 * gnBorderHeight));
 }
 else
 {
 maScrollBar->Hide();
-maTextWnd->SetSizePixel(Size(aSize.Width() - 2 * gnBorderWidth, 
aSize.Height() - 2 * gnBorderHeight));
+maTextWnd->SetSizePixel(Size(aSize.Width() - 4 * gnBorderWidth, 
aSize.Height() - 2 * gnBorderHeight));
 }
 maTextWnd->Resize();
 Invalidate();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-24 Thread Thorsten Wagner (via logerrit)
 include/vcl/toolbox.hxx   |   15 +
 sc/source/ui/app/inputwin.cxx |  345 --
 sc/source/ui/inc/inputwin.hxx |   93 +++
 vcl/source/window/toolbox.cxx |  150 +-
 4 files changed, 383 insertions(+), 220 deletions(-)

New commits:
commit 04b60370a73b79e3aa0a04bc7cff45dff1db6286
Author: Thorsten Wagner 
AuthorDate: Tue May 21 13:36:32 2019 +0200
Commit: Eike Rathke 
CommitDate: Fri May 24 19:53:30 2019 +0200

tdf#101443 Calc multiline input bar reworked

Change-Id: Ic35c9898624f0c13b6d64725808e765a64c17081
Reviewed-on: https://gerrit.libreoffice.org/71937
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 19e02a0d85e7..8b43fa65d75b 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -68,11 +68,13 @@ enum class ToolBoxButtonSize
 Size32,
 };
 
-// ToolBoxLayoutMode::Normal   - traditional layout, items are centered in the 
toolbar
-// ToolBoxLayoutMode::LockVert - special mode (currently used for calc 
input/formula
-//   bar) where item's vertical position is locked, e.g.
-//   toolbox is prevented from centering the items
-enum class ToolBoxLayoutMode { Normal, LockVert };
+enum class ToolBoxLayoutMode
+{
+Normal,  // traditional layout, items are centered in the toolbar
+Locked   // horizontal positions of all items remain unchanged,
+ // vertical positions of items smaller than first item are 
aligned to first item's vertical center,
+ // vertical positions of items larger than first item remain 
unchanged
+};
 
 // Position of the text when icon and text are painted
 enum class ToolBoxTextPosition { Right, Bottom };
@@ -149,7 +151,8 @@ private:
 mbIsKeyEvent:1,
 mbChangingHighlight:1,
 mbImagesMirrored:1,
-mbLineSpacing:1;
+mbLineSpacing:1,
+mbIsArranged:1;
 WindowAlign meAlign;
 WindowAlign meDockAlign;
 ButtonType  meButtonType;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 031546dc0f78..e206a3506669 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -72,14 +72,14 @@
 
 namespace com::sun::star::accessibility { class XAccessible; }
 
-#define THESIZE 100 // Should be more than enough!
-#define TBX_WINDOW_HEIGHT   22 // in pixel - TODO: The same on all systems?
-#define MULTILINE_BUTTON_WIDTH 20 // Width of the button which opens the 
multiline dropdown
-#define LEFT_OFFSET 5
-#define INPUTWIN_MULTILINES 6
-const long BUTTON_OFFSET = 2; ///< space between input line and the button to 
expand / collapse
-const long ADDITIONAL_BORDER = 1; ///< height of the line at the bottom
-const long ADDITIONAL_SPACE = 4; ///< additional vertical space when the 
multiline edit has more lines
+const long THESIZE = 100;// Should be more than enough!
+const long INPUTLINE_INSET_MARGIN = 2;   // Space between border and interior 
widgets of input line
+const long MIN_FONT_SIZE = 16;   // Minimum font size of input line in 
pixels
+const long LEFT_OFFSET = 5;  // Left offset of input line
+const long BUTTON_OFFSET = 2;// Space between input line and 
button to expand/collapse
+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?
 
 using com::sun::star::uno::Reference;
 using com::sun::star::uno::UNO_QUERY;
@@ -247,6 +247,8 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
 else if (pViewSh)
 pViewSh->UpdateInputHandler(true); // Absolutely necessary update
 
+SetToolbarLayoutMode( ToolBoxLayoutMode::Locked );
+
 SetAccessibleName(ScResId(STR_ACC_TOOLBAR_FORMULA));
 }
 
@@ -390,10 +392,8 @@ void ScInputWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::Recta
 ToolBox::Paint(rRenderContext, rRect);
 
 // draw a line at the bottom to distinguish that from the grid
-// (we have space for that thanks to ADDITIONAL_BORDER)
 const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
-
 Size aSize = GetSizePixel();
 rRenderContext.DrawLine(Point(0, aSize.Height() - 1),
 Point(aSize.Width() - 1, aSize.Height() - 1));
@@ -402,21 +402,23 @@ void ScInputWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::Recta
 void ScInputWindow::Resize()
 {
 ToolBox::Resize();
-
 aTextWindow.Resize();