diff --git a/icon-themes/colibre/vcl/res/error.png b/icon-themes/colibre/vcl/res/error.png
new file mode 100644
index 000000000000..23d975167e05
Binary files /dev/null and b/icon-themes/colibre/vcl/res/error.png differ
diff --git a/icon-themes/colibre/vcl/res/information.png b/icon-themes/colibre/vcl/res/information.png
new file mode 100644
index 000000000000..6116fdb25d31
Binary files /dev/null and b/icon-themes/colibre/vcl/res/information.png differ
diff --git a/icon-themes/colibre/vcl/res/warning.png b/icon-themes/colibre/vcl/res/warning.png
new file mode 100644
index 000000000000..ca90c094073b
Binary files /dev/null and b/icon-themes/colibre/vcl/res/warning.png differ
diff --git a/icon-themes/colibre_dark/vcl/res/error.png b/icon-themes/colibre_dark/vcl/res/error.png
new file mode 100644
index 000000000000..487de2137931
Binary files /dev/null and b/icon-themes/colibre_dark/vcl/res/error.png differ
diff --git a/icon-themes/colibre_dark/vcl/res/information.png b/icon-themes/colibre_dark/vcl/res/information.png
new file mode 100644
index 000000000000..90d925859e86
Binary files /dev/null and b/icon-themes/colibre_dark/vcl/res/information.png differ
diff --git a/icon-themes/colibre_dark/vcl/res/warning.png b/icon-themes/colibre_dark/vcl/res/warning.png
new file mode 100644
index 000000000000..5be7ab2d99be
Binary files /dev/null and b/icon-themes/colibre_dark/vcl/res/warning.png differ
diff --git a/icon-themes/colibre_dark_svg/vcl/res/error.svg b/icon-themes/colibre_dark_svg/vcl/res/error.svg
new file mode 100644
index 000000000000..f41640278066
--- /dev/null
+++ b/icon-themes/colibre_dark_svg/vcl/res/error.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icon-themes/colibre_dark_svg/vcl/res/information.svg b/icon-themes/colibre_dark_svg/vcl/res/information.svg
new file mode 100644
index 000000000000..483b97bd90ac
--- /dev/null
+++ b/icon-themes/colibre_dark_svg/vcl/res/information.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icon-themes/colibre_dark_svg/vcl/res/warning.svg b/icon-themes/colibre_dark_svg/vcl/res/warning.svg
new file mode 100644
index 000000000000..d0c8a5f2a9ba
--- /dev/null
+++ b/icon-themes/colibre_dark_svg/vcl/res/warning.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/vcl/res/error.svg b/icon-themes/colibre_svg/vcl/res/error.svg
new file mode 100644
index 000000000000..f5ed3982b566
--- /dev/null
+++ b/icon-themes/colibre_svg/vcl/res/error.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/vcl/res/information.svg b/icon-themes/colibre_svg/vcl/res/information.svg
new file mode 100644
index 000000000000..a069979cf797
--- /dev/null
+++ b/icon-themes/colibre_svg/vcl/res/information.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/vcl/res/warning.svg b/icon-themes/colibre_svg/vcl/res/warning.svg
new file mode 100644
index 000000000000..3ff0db263af9
--- /dev/null
+++ b/icon-themes/colibre_svg/vcl/res/warning.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/include/vcl/toolkit/edit.hxx b/include/vcl/toolkit/edit.hxx
index c731c0b4bbe7..49610dcddd0b 100644
--- a/include/vcl/toolkit/edit.hxx
+++ b/include/vcl/toolkit/edit.hxx
@@ -82,6 +82,7 @@ private:
Link maAutocompleteHdl;
Link maActivateHdl;
std::unique_ptr mpUIBuilder;
+ sal_uInt8 maEntryMessageType;
css::uno::Reference mxBreakIterator;
css::uno::Reference mxISC;
@@ -246,6 +247,8 @@ public:
bool IsPassword() const { return mbPassword; }
bool IsActivePopup() const { return mbActivePopup; }
+
+ void SetEntryMessageType(sal_uInt8 aEntryMessageType) { maEntryMessageType = aEntryMessageType; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst
index da7f30a3ee8b..1723a7cd45ea 100644
--- a/vcl/inc/bitmaps.hlst
+++ b/vcl/inc/bitmaps.hlst
@@ -227,4 +227,8 @@ inline constexpr OUString CHEVRON = u"sfx2/res/chevron.png"_ustr;
inline constexpr OUString RID_UPDATE_AVAILABLE_16 = u"extensions/res/update/ui/onlineupdate_16.png"_ustr;
inline constexpr OUString RID_UPDATE_AVAILABLE_26 = u"extensions/res/update/ui/onlineupdate_26.png"_ustr;
+inline constexpr OUString RID_MSGTYPE_INFO = u"vcl/res/information.png"_ustr;
+inline constexpr OUString RID_MSGTYPE_WARN = u"vcl/res/warning.png"_ustr;
+inline constexpr OUString RID_MSGTYPE_ERR = u"vcl/res/error.png"_ustr;
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6bf73e7b2ffb..eeccc451098f 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3213,14 +3213,14 @@ void set_message_type(Edit* pEntry, weld::EntryMessageType eType)
switch (eType)
{
case weld::EntryMessageType::Normal:
+ case weld::EntryMessageType::Info:
pEntry->SetForceControlBackground(false);
pEntry->SetControlForeground();
pEntry->SetControlBackground();
- break;
- case weld::EntryMessageType::Info:
- pEntry->SetForceControlBackground(true);
- pEntry->SetControlForeground(COL_BLACK);
- pEntry->SetControlBackground(0xb4c7dc); // light blue 3
+ if (eType == weld::EntryMessageType::Normal)
+ pEntry->SetEntryMessageType(0);
+ else
+ pEntry->SetEntryMessageType(1);
break;
case weld::EntryMessageType::Warning:
// tdf#114603: enable setting the background to a different color;
@@ -3228,6 +3228,7 @@ void set_message_type(Edit* pEntry, weld::EntryMessageType eType)
pEntry->SetForceControlBackground(true);
pEntry->SetControlForeground(COL_BLACK);
pEntry->SetControlBackground(0xffffa6); // "light yellow 3"
+ pEntry->SetEntryMessageType(2);
break;
case weld::EntryMessageType::Error:
// tdf#114603: enable setting the background to a different color;
@@ -3235,6 +3236,7 @@ void set_message_type(Edit* pEntry, weld::EntryMessageType eType)
pEntry->SetForceControlBackground(true);
pEntry->SetControlForeground(COL_BLACK); // contrast of 5.87 to the red background
pEntry->SetControlBackground(0xffa6a6); // "light red 3"
+ pEntry->SetEntryMessageType(3);
break;
}
}
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 001314f3fcb0..6e6a2b5f6c91 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
@@ -253,6 +254,7 @@ void Edit::ImplInitEditData()
mpDDInfo = nullptr;
mpIMEInfos = nullptr;
mcEchoChar = 0;
+ maEntryMessageType = 0;
// no default mirroring for Edit controls
// note: controls that use a subedit will revert this (SpinField, ComboBox)
@@ -483,7 +485,16 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl
ImplPaintBorder(rRenderContext);
- bool bDrawSelection = maSelection.Len() && (HasFocus() || (GetStyle() & WB_NOHIDESELECTION) || mbActivePopup);
+ if (maEntryMessageType > 0)
+ {
+ const OUString sType( maEntryMessageType == 1 ? RID_MSGTYPE_INFO
+ : maEntryMessageType == 2 ? RID_MSGTYPE_WARN
+ : RID_MSGTYPE_ERR);
+ const Point aPoint(rRectangle.Right() - 18, rRectangle.Bottom() / 2 - 8);
+ rRenderContext.DrawImage(aPoint, Image(StockImage::Yes, sType));
+ }
+ bool bDrawSelection
+ = maSelection.Len() && (HasFocus() || (GetStyle() & WB_NOHIDESELECTION) || mbActivePopup);
aPos.setX( mnXOffset + ImplGetExtraXOffset() );
if (bPaintPlaceholderText)