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

Thorsten Wagner (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 06:27:24 UTC 2020


 vcl/source/control/button.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 6be0a806dcce864fb4d604be68e8b3711fc604d6
Author:     Thorsten Wagner <thorsten.wagner.4 at gmail.com>
AuthorDate: Tue Jul 28 00:36:07 2020 +0200
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
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 <quikee at gmail.com>
    (cherry picked from commit 84b2849512bdb19597739d9515dd55e2d3ba9504)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101857
    Reviewed-by: Thorsten Wagner <thorsten.wagner.4 at gmail.com>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

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.


More information about the Libreoffice-commits mailing list