You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2022/01/28 19:03:37 UTC

[openoffice] 04/04: Get rid of gradients in sidebar

This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 35c52e30ce8de3423922dd263830daf871f51036
Author: mseidel <ms...@apache.org>
AuthorDate: Fri Jan 28 19:54:56 2022 +0100

    Get rid of gradients in sidebar
---
 main/sfx2/source/sidebar/Theme.cxx | 87 ++++----------------------------------
 1 file changed, 9 insertions(+), 78 deletions(-)

diff --git a/main/sfx2/source/sidebar/Theme.cxx b/main/sfx2/source/sidebar/Theme.cxx
index 6d7ff84..728a697 100644
--- a/main/sfx2/source/sidebar/Theme.cxx
+++ b/main/sfx2/source/sidebar/Theme.cxx
@@ -41,8 +41,6 @@ namespace sfx2 { namespace sidebar {
 ::rtl::Reference<Theme> Theme::mpInstance;
 
 
-
-
 Theme& Theme::GetCurrentTheme (void)
 {
 	if ( ! mpInstance.is())
@@ -54,8 +52,6 @@ Theme& Theme::GetCurrentTheme (void)
 }
 
 
-
-
 Theme::Theme (void)
 	: ThemeInterfaceBase(m_aMutex),
 	  maImages(),
@@ -76,15 +72,11 @@ Theme::Theme (void)
 }
 
 
-
-
 Theme::~Theme (void)
 {
 }
 
 
-
-
 Image Theme::GetImage (const ThemeItem eItem)
 {
 	const PropertyType eType (GetPropertyType(eItem));
@@ -95,8 +87,6 @@ Image Theme::GetImage (const ThemeItem eItem)
 }
 
 
-
-
 Color Theme::GetColor (const ThemeItem eItem)
 {
 	const PropertyType eType (GetPropertyType(eItem));
@@ -112,8 +102,6 @@ Color Theme::GetColor (const ThemeItem eItem)
 }
 
 
-
-
 const Paint& Theme::GetPaint (const ThemeItem eItem)
 {
 	const PropertyType eType (GetPropertyType(eItem));
@@ -124,16 +112,12 @@ const Paint& Theme::GetPaint (const ThemeItem eItem)
 }
 
 
-
-
 const Wallpaper Theme::GetWallpaper (const ThemeItem eItem)
 {
 	return GetPaint(eItem).GetWallpaper();
 }
 
 
-
-
 sal_Int32 Theme::GetInteger (const ThemeItem eItem)
 {
 	const PropertyType eType (GetPropertyType(eItem));
@@ -144,8 +128,6 @@ sal_Int32 Theme::GetInteger (const ThemeItem eItem)
 }
 
 
-
-
 bool Theme::GetBoolean (const ThemeItem eItem)
 {
 	const PropertyType eType (GetPropertyType(eItem));
@@ -156,8 +138,6 @@ bool Theme::GetBoolean (const ThemeItem eItem)
 }
 
 
-
-
 Rectangle Theme::GetRectangle (const ThemeItem eItem)
 {
 	const PropertyType eType (GetPropertyType(eItem));
@@ -168,8 +148,6 @@ Rectangle Theme::GetRectangle (const ThemeItem eItem)
 }
 
 
-
-
 bool Theme::IsHighContrastMode (void)
 {
 	const Theme& rTheme (GetCurrentTheme());
@@ -177,8 +155,6 @@ bool Theme::IsHighContrastMode (void)
 }
 
 
-
-
 void Theme::HandleDataChange (void)
 {
 	Theme& rTheme (GetCurrentTheme());
@@ -194,8 +170,6 @@ void Theme::HandleDataChange (void)
 }
 
 
-
-
 void Theme::InitializeTheme (void)
 {
 	setPropertyValue(
@@ -207,8 +181,6 @@ void Theme::InitializeTheme (void)
 }
 
 
-
-
 void Theme::UpdateTheme (void)
 {
 	SidebarResource aLocalResource;
@@ -224,9 +196,9 @@ void Theme::UpdateTheme (void)
 		// UX says this should be a little brighter, but that looks off when compared to the other windows.
 		//aBaseBackgroundColor.IncreaseLuminance(7);
 		Color aBorderColor (aBaseBackgroundColor);
-		aBorderColor.DecreaseLuminance(15);
+		aBorderColor.DecreaseLuminance(80);
 		Color aSecondColor (aBaseBackgroundColor);
-		aSecondColor.DecreaseLuminance(15);
+		aSecondColor.DecreaseLuminance(0);
 
 		setPropertyValue(
 			maPropertyIdToNameMap[Paint_DeckBackground],
@@ -385,7 +357,10 @@ void Theme::UpdateTheme (void)
 					: A2S("private:graphicrepository/sfx2/res/symphony/morebutton.png")));
 		setPropertyValue(
 			maPropertyIdToNameMap[Image_Closer],
-			Any(A2S("private:graphicrepository/sfx2/res/closedoc.png")));
+			Any(
+				mbIsHighContrastMode
+					? A2S("private:graphicrepository/sfx2/res/closedochc.png")
+					: A2S("private:graphicrepository/sfx2/res/closedoc.png")));
 		setPropertyValue(
 			maPropertyIdToNameMap[Image_CloseIndicator],
 			Any(
@@ -427,9 +402,9 @@ void Theme::UpdateTheme (void)
 
 		// Gradient style
 		Color aGradientStop2 (aBaseBackgroundColor);
-		aGradientStop2.IncreaseLuminance(17);
+		aGradientStop2.IncreaseLuminance(0);
 		Color aToolBoxBorderColor (aBaseBackgroundColor);
-		aToolBoxBorderColor.DecreaseLuminance(12);
+		aToolBoxBorderColor.DecreaseLuminance(40);
 		setPropertyValue(
 			maPropertyIdToNameMap[Paint_ToolBoxBackground],
 			Any(Tools::VclToAwtGradient(Gradient(
@@ -473,8 +448,6 @@ void Theme::UpdateTheme (void)
 }
 
 
-
-
 void SAL_CALL Theme::disposing (void)
 {
 	ChangeListeners aListeners;
@@ -506,16 +479,12 @@ void SAL_CALL Theme::disposing (void)
 }
 
 
-
-
 Reference<beans::XPropertySet> Theme::GetPropertySet (void)
 {
 	return Reference<beans::XPropertySet>(static_cast<XWeak*>(&GetCurrentTheme()), UNO_QUERY);
 }
 
 
-
-
 Reference<beans::XPropertySetInfo> SAL_CALL Theme::getPropertySetInfo (void)
 	throw(cssu::RuntimeException)
 {
@@ -523,8 +492,6 @@ Reference<beans::XPropertySetInfo> SAL_CALL Theme::getPropertySetInfo (void)
 }
 
 
-
-
 void SAL_CALL Theme::setPropertyValue (
 	const ::rtl::OUString& rsPropertyName,
 	const cssu::Any& rValue)
@@ -570,8 +537,6 @@ void SAL_CALL Theme::setPropertyValue (
 }
 
 
-
-
 Any SAL_CALL Theme::getPropertyValue (
 	const ::rtl::OUString& rsPropertyName)
 	throw(css::beans::UnknownPropertyException,
@@ -592,8 +557,6 @@ Any SAL_CALL Theme::getPropertyValue (
 }
 
 
-
-
 void SAL_CALL Theme::addPropertyChangeListener(
 	const ::rtl::OUString& rsPropertyName,
 	const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener)
@@ -620,8 +583,6 @@ void SAL_CALL Theme::addPropertyChangeListener(
 }
 
 
-
-
 void SAL_CALL Theme::removePropertyChangeListener(
 	const ::rtl::OUString& rsPropertyName,
 	const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener)
@@ -658,8 +619,6 @@ void SAL_CALL Theme::removePropertyChangeListener(
 }
 
 
-
-
 void SAL_CALL Theme::addVetoableChangeListener(
 	const ::rtl::OUString& rsPropertyName,
 	const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener)
@@ -686,8 +645,6 @@ void SAL_CALL Theme::addVetoableChangeListener(
 }
 
 
-
-
 void SAL_CALL Theme::removeVetoableChangeListener(
 	const ::rtl::OUString& rsPropertyName,
 	const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener)
@@ -723,8 +680,6 @@ void SAL_CALL Theme::removeVetoableChangeListener(
 }
 
 
-
-
 cssu::Sequence<css::beans::Property> SAL_CALL Theme::getProperties (void)
 	throw(cssu::RuntimeException)
 {
@@ -751,8 +706,6 @@ cssu::Sequence<css::beans::Property> SAL_CALL Theme::getProperties (void)
 }
 
 
-
-
 beans::Property SAL_CALL Theme::getPropertyByName (const ::rtl::OUString& rsPropertyName)
 	throw(css::beans::UnknownPropertyException,
 		cssu::RuntimeException)
@@ -775,8 +728,6 @@ beans::Property SAL_CALL Theme::getPropertyByName (const ::rtl::OUString& rsProp
 }
 
 
-
-
 sal_Bool SAL_CALL Theme::hasPropertyByName (const ::rtl::OUString& rsPropertyName)
 	throw(cssu::RuntimeException)
 {
@@ -792,8 +743,6 @@ sal_Bool SAL_CALL Theme::hasPropertyByName (const ::rtl::OUString& rsPropertyNam
 }
 
 
-
-
 void Theme::SetupPropertyMaps (void)
 {
 	maPropertyIdToNameMap.resize(__Post_Rect);
@@ -870,8 +819,6 @@ void Theme::SetupPropertyMaps (void)
 }
 
 
-
-
 Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem)
 {
 	switch(eItem)
@@ -946,8 +893,6 @@ Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem)
 }
 
 
-
-
 cssu::Type Theme::GetCppuType (const PropertyType eType)
 {
 	switch(eType)
@@ -977,8 +922,6 @@ cssu::Type Theme::GetCppuType (const PropertyType eType)
 }
 
 
-
-
 sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType)
 {
 	switch(eType)
@@ -1003,8 +946,6 @@ sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType)
 }
 
 
-
-
 Theme::VetoableListenerContainer* Theme::GetVetoableListeners (
 	const ThemeItem eItem,
 	const bool bCreate)
@@ -1022,8 +963,6 @@ Theme::VetoableListenerContainer* Theme::GetVetoableListeners (
 }
 
 
-
-
 Theme::ChangeListenerContainer* Theme::GetChangeListeners (
 	const ThemeItem eItem,
 	const bool bCreate)
@@ -1041,8 +980,6 @@ Theme::ChangeListenerContainer* Theme::GetChangeListeners (
 }
 
 
-
-
 bool Theme::DoVetoableListenersVeto (
 	const VetoableListenerContainer* pListeners,
 	const beans::PropertyChangeEvent& rEvent) const
@@ -1074,8 +1011,6 @@ bool Theme::DoVetoableListenersVeto (
 }
 
 
-
-
 void Theme::BroadcastPropertyChange (
 	const ChangeListenerContainer* pListeners,
 	const beans::PropertyChangeEvent& rEvent) const
@@ -1102,8 +1037,6 @@ void Theme::BroadcastPropertyChange (
 }
 
 
-
-
 void Theme::ProcessNewValue (
 	const Any& rValue,
 	const ThemeItem eItem,
@@ -1182,7 +1115,5 @@ void Theme::ProcessNewValue (
 	}
 }
 
-
-
-
 } } // end of namespace sfx2::sidebar
+