diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2024-03-22 12:58:07 +0100 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2024-03-23 08:02:18 +0100 |
commit | d7fd378b533c42f51d1d363f5da30b1fa1281f67 (patch) | |
tree | b56cd804cb5e99321945378523d9b0860ef46a45 /vcl/source | |
parent | e83f7b7c84d5345879c5543b78ce6ad2b32dc2bc (diff) |
Harmonization of warning and error colors
* hard-coded colors from infobar moved to settings
* weld::LabelType::Warning and ::Error uses these colors
* gtk3 native configuration removed
Change-Id: Ia80584e9267b8385f7f6b25322f5a85a2570af68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165161
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 53 |
2 files changed, 57 insertions, 4 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4469978be626..3f007783498d 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5949,14 +5949,16 @@ void SalInstanceLabel::set_label_type(weld::LabelType eType) m_xLabel->SetControlBackground(); break; case weld::LabelType::Warning: - m_xLabel->SetControlForeground(); + m_xLabel->SetControlForeground( + m_xLabel->GetSettings().GetStyleSettings().GetWarningTextColor()); m_xLabel->SetControlBackground( m_xLabel->GetSettings().GetStyleSettings().GetWarningColor()); break; case weld::LabelType::Error: - m_xLabel->SetControlForeground(); + m_xLabel->SetControlForeground( + m_xLabel->GetSettings().GetStyleSettings().GetErrorTextColor()); m_xLabel->SetControlBackground( - m_xLabel->GetSettings().GetStyleSettings().GetHighlightColor()); + m_xLabel->GetSettings().GetStyleSettings().GetErrorColor()); break; case weld::LabelType::Title: m_xLabel->SetControlForeground( diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 8d04d9065ea6..6cf975f50d52 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -137,6 +137,9 @@ struct ImplStyleData Color maRadioCheckTextColor; Color maShadowColor; Color maWarningColor; + Color maWarningTextColor; + Color maErrorColor; + Color maErrorTextColor; Color maVisitedLinkColor; Color maToolTextColor; Color maWindowColor; @@ -562,6 +565,9 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : maRadioCheckTextColor( rData.maRadioCheckTextColor ), maShadowColor( rData.maShadowColor ), maWarningColor( rData.maWarningColor ), + maWarningTextColor( rData.maWarningTextColor ), + maErrorColor( rData.maErrorColor ), + maErrorTextColor( rData.maErrorTextColor ), maVisitedLinkColor( rData.maVisitedLinkColor ), maToolTextColor( rData.maToolTextColor ), maWindowColor( rData.maWindowColor ), @@ -662,7 +668,10 @@ void ImplStyleData::SetStandardStyles() maShadowColor = COL_GRAY; maDarkShadowColor = COL_BLACK; - maWarningColor = COL_YELLOW; + maWarningColor = Color(0xFE, 0xEF, 0xB3); // tdf#105829 + maWarningTextColor = Color(0x70, 0x43, 0x00); + maErrorColor = Color(0xFF, 0xBA, 0xBA); + maErrorTextColor = Color(0x7A, 0x00, 0x06); maDefaultButtonTextColor = COL_BLACK; maButtonTextColor = COL_BLACK; @@ -815,6 +824,45 @@ StyleSettings::GetWarningColor() const } void +StyleSettings::SetWarningTextColor( const Color& rColor ) +{ + CopyData(); + mxData->maWarningTextColor = rColor; +} + +const Color& +StyleSettings::GetWarningTextColor() const +{ + return mxData->maWarningTextColor; +} + +void +StyleSettings::SetErrorColor( const Color& rColor ) +{ + CopyData(); + mxData->maErrorColor = rColor; +} + +const Color& +StyleSettings::GetErrorColor() const +{ + return mxData->maErrorColor; +} + +void +StyleSettings::SetErrorTextColor( const Color& rColor ) +{ + CopyData(); + mxData->maErrorTextColor = rColor; +} + +const Color& +StyleSettings::GetErrorTextColor() const +{ + return mxData->maErrorTextColor; +} + +void StyleSettings::SetShadowColor( const Color& rColor ) { CopyData(); @@ -2520,6 +2568,9 @@ bool StyleSettings::operator ==( const StyleSettings& rSet ) const (mxData->maShadowColor == rSet.mxData->maShadowColor) && (mxData->maDarkShadowColor == rSet.mxData->maDarkShadowColor) && (mxData->maWarningColor == rSet.mxData->maWarningColor) && + (mxData->maWarningTextColor == rSet.mxData->maWarningTextColor) && + (mxData->maErrorColor == rSet.mxData->maErrorColor) && + (mxData->maErrorTextColor == rSet.mxData->maErrorTextColor) && (mxData->maButtonTextColor == rSet.mxData->maButtonTextColor) && (mxData->maDefaultActionButtonTextColor == rSet.mxData->maDefaultActionButtonTextColor) && (mxData->maActionButtonTextColor == rSet.mxData->maActionButtonTextColor) && |