diff options
23 files changed, 351 insertions, 2 deletions
diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx index 35d9dab77234..79f23aa46985 100644 --- a/forms/source/inc/frm_strings.hxx +++ b/forms/source/inc/frm_strings.hxx @@ -213,6 +213,8 @@ inline constexpr OUStringLiteral PROPERTY_BACKGROUNDCOLOR = u"BackgroundColor"; inline constexpr OUStringLiteral PROPERTY_ICONSIZE = u"IconSize"; inline constexpr OUStringLiteral PROPERTY_TEXTLINECOLOR = u"TextLineColor"; inline constexpr OUStringLiteral PROPERTY_HIDEINACTIVESELECTION = u"HideInactiveSelection"; +inline constexpr OUStringLiteral PROPERTY_HIGHLIGHT_COLOR = u"HighlightColor"; +inline constexpr OUStringLiteral PROPERTY_HIGHLIGHT_TEXT_COLOR = u"HighlightTextColor"; inline constexpr OUStringLiteral PROPERTY_SHOW_POSITION = u"ShowPosition"; inline constexpr OUStringLiteral PROPERTY_SHOW_NAVIGATION = u"ShowNavigation"; diff --git a/include/toolkit/helper/property.hxx b/include/toolkit/helper/property.hxx index 4a8fe2385317..92adc587d171 100644 --- a/include/toolkit/helper/property.hxx +++ b/include/toolkit/helper/property.hxx @@ -204,7 +204,9 @@ namespace com::sun::star::uno { #define BASEPROPERTY_INACTIVE_SEL_BACKGROUND_COLOR 166 #define BASEPROPERTY_ACTIVE_SEL_TEXT_COLOR 167 #define BASEPROPERTY_INACTIVE_SEL_TEXT_COLOR 168 -#define BASEPROPERTY_TYPEDITEMLIST 169 // AnySequence +#define BASEPROPERTY_HIGHLIGHT_COLOR 169 +#define BASEPROPERTY_HIGHLIGHT_TEXT_COLOR 170 +#define BASEPROPERTY_TYPEDITEMLIST 171 // AnySequence // These properties are not bound, they are always extracted from the BASEPROPERTY_FONTDESCRIPTOR property diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx index bdc415744662..f5d8a10f1ced 100644 --- a/include/vcl/toolkit/combobox.hxx +++ b/include/vcl/toolkit/combobox.hxx @@ -106,6 +106,8 @@ public: void DrawEntry( const UserDrawEvent& rEvt ); void SetBorderStyle( WindowBorderStyle nBorderStyle ); + void SetHighlightColor(const Color& rColor); + void SetHighlightTextColor(const Color& rColor); /** * Adds a new separator at the given position n. diff --git a/include/vcl/toolkit/lstbox.hxx b/include/vcl/toolkit/lstbox.hxx index e3bcc1297082..8890fb7ec931 100644 --- a/include/vcl/toolkit/lstbox.hxx +++ b/include/vcl/toolkit/lstbox.hxx @@ -209,6 +209,8 @@ public: void EnableMultiSelection( bool bMulti ); bool IsMultiSelectionEnabled() const; + void SetHighlightColor(const Color& rColor); + void SetHighlightTextColor(const Color& rColor); void SetReadOnly( bool bReadOnly = true ); bool IsReadOnly() const; diff --git a/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl b/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl index 6f21f0ff913f..929586f5f5fc 100644 --- a/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl +++ b/offapi/com/sun/star/awt/UnoControlComboBoxModel.idl @@ -196,6 +196,18 @@ published service UnoControlComboBoxModel @since LibreOffice 5.4 */ [optional, property] sequence<any> TypedItemList; + + /** specifies the background color (RGB) of selected items in the control which are highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected items in the control which are highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl b/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl index f6e50b2c8cea..17858c37e29e 100644 --- a/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl +++ b/offapi/com/sun/star/awt/UnoControlCurrencyFieldModel.idl @@ -214,6 +214,18 @@ published service UnoControlCurrencyFieldModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl b/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl index e1e0bff11c7a..82ccd12c0a1a 100644 --- a/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl +++ b/offapi/com/sun/star/awt/UnoControlDateFieldModel.idl @@ -225,6 +225,18 @@ published service UnoControlDateFieldModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlEditModel.idl b/offapi/com/sun/star/awt/UnoControlEditModel.idl index c8072ee2becf..9ce4c0408546 100644 --- a/offapi/com/sun/star/awt/UnoControlEditModel.idl +++ b/offapi/com/sun/star/awt/UnoControlEditModel.idl @@ -226,6 +226,18 @@ published service UnoControlEditModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl b/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl index 5657c19c15af..c5c1f6fbba54 100644 --- a/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl +++ b/offapi/com/sun/star/awt/UnoControlFixedTextModel.idl @@ -136,6 +136,18 @@ published service UnoControlFixedTextModel @since OOo 2.4 */ [optional, property] boolean NoLabel; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl b/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl index c77b3f45210c..36a55fa3b8cc 100644 --- a/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl +++ b/offapi/com/sun/star/awt/UnoControlFormattedFieldModel.idl @@ -253,6 +253,18 @@ published service UnoControlFormattedFieldModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl index 65629c9f3692..965f3be42b8d 100644 --- a/offapi/com/sun/star/awt/UnoControlListBoxModel.idl +++ b/offapi/com/sun/star/awt/UnoControlListBoxModel.idl @@ -189,6 +189,18 @@ published service UnoControlListBoxModel @since LibreOffice 5.4 */ [optional, property] sequence<any> TypedItemList; + + /** specifies the background color (RGB) of selected items in the control which are highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected items in the control which are highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl b/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl index 5ca7fb756274..c54b10105bc0 100644 --- a/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl +++ b/offapi/com/sun/star/awt/UnoControlNumericFieldModel.idl @@ -204,6 +204,18 @@ published service UnoControlNumericFieldModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl b/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl index a05788a2fb1e..8cc043183500 100644 --- a/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl +++ b/offapi/com/sun/star/awt/UnoControlPatternFieldModel.idl @@ -168,6 +168,18 @@ published service UnoControlPatternFieldModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl b/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl index 79638707d8fd..a97ec8c71a14 100644 --- a/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl +++ b/offapi/com/sun/star/awt/UnoControlTimeFieldModel.idl @@ -209,6 +209,18 @@ published service UnoControlTimeFieldModel @since OOo 3.3 */ [optional, property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the background color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightColor; + + /** specifies the text color (RGB) of selected text in the control which is highlighted. + + @since LibreOffice 7.5 + */ + [optional, property] com::sun::star::util::Color HighlightTextColor; }; diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 6f34c7bdcc88..98342be8b72b 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -1702,6 +1702,46 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any& pWindow->GetOutDev()->SetLineColor( nColor ); } break; + case BASEPROPERTY_HIGHLIGHT_COLOR: + { + Color nColor = 0; + if ( bVoid ) + { + nColor = Application::GetSettings().GetStyleSettings().GetHighlightColor(); + } + else + { + if (!(Value >>= nColor)) + break; + } + + AllSettings aSettings(pWindow->GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightColor(nColor); + aSettings.SetStyleSettings(aStyle); + pWindow->SetSettings(aSettings); + } + break; + case BASEPROPERTY_HIGHLIGHT_TEXT_COLOR: + { + Color nColor = 0; + if (bVoid) + { + nColor = Application::GetSettings().GetStyleSettings().GetHighlightTextColor(); + } + else + { + if (!(Value >>= nColor)) + break; + } + + AllSettings aSettings(pWindow->GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightTextColor(nColor); + aSettings.SetStyleSettings(aStyle); + pWindow->SetSettings(aSettings); + } + break; case BASEPROPERTY_BORDER: { WinBits nStyle = pWindow->GetStyle(); @@ -2027,6 +2067,12 @@ css::uno::Any VCLXWindow::getProperty( const OUString& PropertyName ) case BASEPROPERTY_LINECOLOR: aProp <<= GetWindow()->GetOutDev()->GetLineColor(); break; + case BASEPROPERTY_HIGHLIGHT_COLOR: + aProp <<= GetWindow()->GetSettings().GetStyleSettings().GetHighlightColor(); + break; + case BASEPROPERTY_HIGHLIGHT_TEXT_COLOR: + aProp <<= GetWindow()->GetSettings().GetStyleSettings().GetHighlightTextColor(); + break; case BASEPROPERTY_BORDER: { WindowBorderStyle nBorder = WindowBorderStyle::NONE; diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index cfc5f345c1aa..eb1421d291a4 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -1512,6 +1512,8 @@ void VCLXListBox::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_REFERENCE_DEVICE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXWindow::ImplGetPropertyIds( rIds ); } @@ -1926,6 +1928,38 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const css::uno::Any } } break; + case BASEPROPERTY_HIGHLIGHT_COLOR: + { + Color nColor = 0; + bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID; + if (bVoid) + { + nColor = Application::GetSettings().GetStyleSettings().GetHighlightColor(); + } + else + { + if (!(Value >>= nColor)) + break; + } + pListBox->SetHighlightColor(nColor); + } + break; + case BASEPROPERTY_HIGHLIGHT_TEXT_COLOR: + { + Color nColor = 0; + bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID; + if (bVoid) + { + nColor = Application::GetSettings().GetStyleSettings().GetHighlightTextColor(); + } + else + { + if (!(Value >>= nColor)) + break; + } + pListBox->SetHighlightTextColor(nColor); + } + break; default: { VCLXWindow::setProperty( PropertyName, Value ); @@ -3119,6 +3153,8 @@ void VCLXFixedText::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_REFERENCE_DEVICE, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXWindow::ImplGetPropertyIds( rIds ); } @@ -3760,6 +3796,8 @@ void VCLXEdit::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_VERTICALALIGN, BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXWindow::ImplGetPropertyIds( rIds ); } @@ -4140,6 +4178,8 @@ void VCLXComboBox::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_REFERENCE_DEVICE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); // no, don't call VCLXEdit here - it has properties which we do *not* want to have at combo box // #i92690# / 2008-08-12 / frank.schoenheit@sun.com @@ -4308,6 +4348,7 @@ void VCLXComboBox::setProperty( const OUString& PropertyName, const css::uno::An if ( !pComboBox ) return; + bool bVoid = Value.getValueType().getTypeClass() == css::uno::TypeClass_VOID; sal_uInt16 nPropType = GetPropertyId( PropertyName ); switch ( nPropType ) { @@ -4341,6 +4382,36 @@ void VCLXComboBox::setProperty( const OUString& PropertyName, const css::uno::An } } break; + case BASEPROPERTY_HIGHLIGHT_COLOR: + { + Color nColor = 0; + if (bVoid) + { + nColor = Application::GetSettings().GetStyleSettings().GetHighlightColor(); + } + else + { + if (!(Value >>= nColor)) + break; + } + pComboBox->SetHighlightColor(nColor); + } + break; + case BASEPROPERTY_HIGHLIGHT_TEXT_COLOR: + { + Color nColor = 0; + if (bVoid) + { + nColor = Application::GetSettings().GetStyleSettings().GetHighlightTextColor(); + } + else + { + if (!(Value >>= nColor)) + break; + } + pComboBox->SetHighlightTextColor(nColor); + } + break; default: { VCLXEdit::setProperty( PropertyName, Value ); @@ -4743,6 +4814,8 @@ void VCLXDateField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXFormattedSpinField::ImplGetPropertyIds( rIds ); } @@ -5096,6 +5169,8 @@ void VCLXTimeField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXFormattedSpinField::ImplGetPropertyIds( rIds ); } @@ -5412,6 +5487,8 @@ void VCLXNumericField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXFormattedSpinField::ImplGetPropertyIds( rIds ); } @@ -6023,6 +6100,8 @@ void VCLXPatternField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXFormattedSpinField::ImplGetPropertyIds( rIds ); } @@ -7628,6 +7707,8 @@ void SVTXCurrencyField::ImplGetPropertyIds( std::vector< sal_uInt16 > &rIds ) BASEPROPERTY_WRITING_MODE, BASEPROPERTY_CONTEXT_WRITING_MODE, BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR, + BASEPROPERTY_HIGHLIGHT_COLOR, + BASEPROPERTY_HIGHLIGHT_TEXT_COLOR, 0); VCLXWindow::ImplGetPropertyIds( rIds ); } diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index cee4d4a7a4db..238c8d5876f3 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -132,6 +132,8 @@ namespace toolkit ImplRegisterProperty( BASEPROPERTY_WRITING_MODE ); ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE ); ImplRegisterProperty( BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR ); + ImplRegisterProperty( BASEPROPERTY_HIGHLIGHT_COLOR ); + ImplRegisterProperty( BASEPROPERTY_HIGHLIGHT_TEXT_COLOR ); Any aTreatAsNumber; aTreatAsNumber <<= true; diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 986f55efbc50..c5e8165f60b8 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -208,7 +208,9 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const case BASEPROPERTY_SCROLLVALUE: case BASEPROPERTY_VISIBLESIZE: case BASEPROPERTY_BACKGROUNDCOLOR: - case BASEPROPERTY_FILLCOLOR: break; // Void + case BASEPROPERTY_FILLCOLOR: + case BASEPROPERTY_HIGHLIGHT_COLOR: + case BASEPROPERTY_HIGHLIGHT_TEXT_COLOR: break; // Void case BASEPROPERTY_FONTRELIEF: case BASEPROPERTY_FONTEMPHASISMARK: diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx index 4fe5e9bba471..f05fee0aea7e 100644 --- a/toolkit/source/helper/property.cxx +++ b/toolkit/source/helper/property.cxx @@ -154,6 +154,8 @@ static ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) DECL_PROP_2 ( "HighContrastMode", HIGHCONTRASTMODE, bool, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "HScroll", HSCROLL, bool, BOUND, MAYBEDEFAULT ), DECL_PROP_2 ( "HardLineBreaks", HARDLINEBREAKS, bool, BOUND, MAYBEDEFAULT ), + DECL_PROP_3 ( "HighlightColor", HIGHLIGHT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID), + DECL_PROP_3 ( "HighlightTextColor", HIGHLIGHT_TEXT_COLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID), DECL_PROP_2 ( "ImageAlign", IMAGEALIGN, sal_Int16, BOUND, MAYBEDEFAULT), DECL_PROP_2 ( "ImagePosition", IMAGEPOSITION, sal_Int16, BOUND, MAYBEDEFAULT), DECL_PROP_2 ( "ImageURL", IMAGEURL, css::uno::Any, BOUND, MAYBEDEFAULT ), diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx index fca82a20cf05..8aa23e90cff8 100644 --- a/vcl/inc/listbox.hxx +++ b/vcl/inc/listbox.hxx @@ -484,6 +484,8 @@ public: void SetCallSelectionChangedHdl( bool bCall ) { maLBWindow->GetEntryList().SetCallSelectionChangedHdl( bCall ); } bool IsSelectionChanged() const { return maLBWindow->IsSelectionChanged(); } sal_uInt16 GetSelectModifier() const { return maLBWindow->GetSelectModifier(); } + void SetHighlightColor(const Color& rColor); + void SetHighlightTextColor(const Color& rColor); void SetMRUEntries( std::u16string_view rEntries, sal_Unicode cSep ); OUString GetMRUEntries( sal_Unicode cSep ) const; diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 568b91d6cf31..1a8f7ef0673c 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1405,6 +1405,40 @@ void ComboBox::SetBorderStyle( WindowBorderStyle nBorderStyle ) } } +void ComboBox::SetHighlightColor( const Color& rColor ) +{ + AllSettings aSettings(GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightColor(rColor); + aSettings.SetStyleSettings(aStyle); + SetSettings(aSettings); + + AllSettings aSettingsSubEdit(m_pImpl->m_pSubEdit->GetSettings()); + StyleSettings aStyleSubEdit(aSettingsSubEdit.GetStyleSettings()); + aStyleSubEdit.SetHighlightColor(rColor); + aSettingsSubEdit.SetStyleSettings(aStyleSubEdit); + m_pImpl->m_pSubEdit->SetSettings(aSettings); + + m_pImpl->m_pImplLB->SetHighlightColor(rColor); +} + +void ComboBox::SetHighlightTextColor( const Color& rColor ) +{ + AllSettings aSettings(GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightTextColor(rColor); + aSettings.SetStyleSettings(aStyle); + SetSettings(aSettings); + + AllSettings aSettingsSubEdit(m_pImpl->m_pSubEdit->GetSettings()); + StyleSettings aStyleSubEdit(aSettingsSubEdit.GetStyleSettings()); + aStyleSubEdit.SetHighlightTextColor(rColor); + aSettingsSubEdit.SetStyleSettings(aStyleSubEdit); + m_pImpl->m_pSubEdit->SetSettings(aSettings); + + m_pImpl->m_pImplLB->SetHighlightTextColor(rColor); +} + ImplListBoxWindow* ComboBox::GetMainWindow() const { return m_pImpl->m_pImplLB->GetMainWindow(); diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index bdc3f833f270..033f477a9185 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -2477,6 +2477,36 @@ void ImplListBox::SetEdgeBlending(bool bNew) } } +void ImplListBox::SetHighlightColor(const Color& rColor) +{ + AllSettings aSettings(GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightColor(rColor); + aSettings.SetStyleSettings(aStyle); + SetSettings(aSettings); + + AllSettings aSettingsLB(maLBWindow->GetSettings()); + StyleSettings aStyleLB(aSettingsLB.GetStyleSettings()); + aStyleLB.SetListBoxWindowHighlightColor(rColor); + aSettingsLB.SetStyleSettings(aStyleLB); + maLBWindow->SetSettings(aSettingsLB); +} + +void ImplListBox::SetHighlightTextColor(const Color& rColor) +{ + AllSettings aSettings(GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightTextColor(rColor); + aSettings.SetStyleSettings(aStyle); + SetSettings(aSettings); + + AllSettings aSettingsLB(maLBWindow->GetSettings()); + StyleSettings aStyleLB(aSettingsLB.GetStyleSettings()); + aStyleLB.SetListBoxWindowHighlightTextColor(rColor); + aSettingsLB.SetStyleSettings(aStyleLB); + maLBWindow->SetSettings(aSettingsLB); +} + ImplWin::ImplWin( vcl::Window* pParent, WinBits nWinStyle ) : Control ( pParent, nWinStyle ) { diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 12d8744f5210..e463b2ff958c 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -1140,6 +1140,28 @@ bool ListBox::IsMultiSelectionEnabled() const return mpImplLB->IsMultiSelectionEnabled(); } +void ListBox::SetHighlightColor(const Color& rColor) +{ + AllSettings aSettings(GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightColor(rColor); + aSettings.SetStyleSettings(aStyle); + SetSettings(aSettings); + + mpImplLB->SetHighlightColor(rColor); +} + +void ListBox::SetHighlightTextColor(const Color& rColor) +{ + AllSettings aSettings(GetSettings()); + StyleSettings aStyle(aSettings.GetStyleSettings()); + aStyle.SetHighlightTextColor(rColor); + aSettings.SetStyleSettings(aStyle); + SetSettings(aSettings); + + mpImplLB->SetHighlightTextColor(rColor); +} + Size ListBox::CalcMinimumSize() const { Size aSz; |