summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/button.cxx7
1 files changed, 7 insertions, 0 deletions
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.