Theme.cxx (2b6825c7) Theme.cxx (73fd191a)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 5 unchanged lines hidden (view full) ---

14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 5 unchanged lines hidden (view full) ---

14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
22#include "precompiled_sfx2.hxx"
23
24#include "sfx2/sidebar/Theme.hxx"
25#include "Paint.hxx"
26#include "SidebarResource.hxx"
27#include "sfx2/sidebar/Tools.hxx"
28
29#include <tools/svborder.hxx>

--- 190 unchanged lines hidden (view full) ---

220
221 Color aBaseBackgroundColor (rStyle.GetDialogColor());
222 // UX says this should be a little brighter, but that looks off when compared to the other windows.
223 //aBaseBackgroundColor.IncreaseLuminance(7);
224 Color aBorderColor (aBaseBackgroundColor);
225 aBorderColor.DecreaseLuminance(15);
226 Color aSecondColor (aBaseBackgroundColor);
227 aSecondColor.DecreaseLuminance(15);
24#include "precompiled_sfx2.hxx"
25
26#include "sfx2/sidebar/Theme.hxx"
27#include "Paint.hxx"
28#include "SidebarResource.hxx"
29#include "sfx2/sidebar/Tools.hxx"
30
31#include <tools/svborder.hxx>

--- 190 unchanged lines hidden (view full) ---

222
223 Color aBaseBackgroundColor (rStyle.GetDialogColor());
224 // UX says this should be a little brighter, but that looks off when compared to the other windows.
225 //aBaseBackgroundColor.IncreaseLuminance(7);
226 Color aBorderColor (aBaseBackgroundColor);
227 aBorderColor.DecreaseLuminance(15);
228 Color aSecondColor (aBaseBackgroundColor);
229 aSecondColor.DecreaseLuminance(15);
228
230
229 setPropertyValue(
230 maPropertyIdToNameMap[Paint_DeckBackground],
231 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor())));
232
233 setPropertyValue(
234 maPropertyIdToNameMap[Paint_DeckTitleBarBackground],
235 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor())));
236 setPropertyValue(

--- 24 unchanged lines hidden (view full) ---

261 maPropertyIdToNameMap[Int_DeckTitleBarHeight],
262 Any(sal_Int32(Alternatives(
263 26,
264 26,
265 rStyle.GetFloatTitleHeight()))));
266 setPropertyValue(
267 maPropertyIdToNameMap[Paint_PanelBackground],
268 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor())));
231 setPropertyValue(
232 maPropertyIdToNameMap[Paint_DeckBackground],
233 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor())));
234
235 setPropertyValue(
236 maPropertyIdToNameMap[Paint_DeckTitleBarBackground],
237 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor())));
238 setPropertyValue(

--- 24 unchanged lines hidden (view full) ---

263 maPropertyIdToNameMap[Int_DeckTitleBarHeight],
264 Any(sal_Int32(Alternatives(
265 26,
266 26,
267 rStyle.GetFloatTitleHeight()))));
268 setPropertyValue(
269 maPropertyIdToNameMap[Paint_PanelBackground],
270 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor())));
269
271
270 setPropertyValue(
271 maPropertyIdToNameMap[Paint_PanelTitleBarBackground],
272 Any(Tools::VclToAwtGradient(Gradient(
273 GRADIENT_LINEAR,
274 aSecondColor.GetRGBColor(),
275 aBaseBackgroundColor.GetRGBColor()
276 ))));
277 setPropertyValue(

--- 25 unchanged lines hidden (view full) ---

303 maPropertyIdToNameMap[Int_TabMenuPadding],
304 Any(sal_Int32(6)));
305 setPropertyValue(
306 maPropertyIdToNameMap[Color_TabMenuSeparator],
307 Any(sal_Int32(aBorderColor.GetRGBColor())));
308 setPropertyValue(
309 maPropertyIdToNameMap[Int_TabMenuSeparatorPadding],
310 Any(sal_Int32(7)));
272 setPropertyValue(
273 maPropertyIdToNameMap[Paint_PanelTitleBarBackground],
274 Any(Tools::VclToAwtGradient(Gradient(
275 GRADIENT_LINEAR,
276 aSecondColor.GetRGBColor(),
277 aBaseBackgroundColor.GetRGBColor()
278 ))));
279 setPropertyValue(

--- 25 unchanged lines hidden (view full) ---

305 maPropertyIdToNameMap[Int_TabMenuPadding],
306 Any(sal_Int32(6)));
307 setPropertyValue(
308 maPropertyIdToNameMap[Color_TabMenuSeparator],
309 Any(sal_Int32(aBorderColor.GetRGBColor())));
310 setPropertyValue(
311 maPropertyIdToNameMap[Int_TabMenuSeparatorPadding],
312 Any(sal_Int32(7)));
311
313
312 setPropertyValue(
313 maPropertyIdToNameMap[Int_TabItemWidth],
314 Any(sal_Int32(32)));
315 setPropertyValue(
316 maPropertyIdToNameMap[Int_TabItemHeight],
317 Any(sal_Int32(32)));
318 setPropertyValue(
319 maPropertyIdToNameMap[Color_TabItemBorder],

--- 20 unchanged lines hidden (view full) ---

340 setPropertyValue(
341 maPropertyIdToNameMap[Paint_TabItemBackgroundHighlight],
342 Any(sal_Int32(rStyle.GetActiveTabColor().GetRGBColor())));
343 // mbIsHighContrastMode ? 0x000000 : 0x00ffffff)));
344
345 setPropertyValue(
346 maPropertyIdToNameMap[Paint_HorizontalBorder],
347 Any(sal_Int32(aBorderColor.GetRGBColor())));
314 setPropertyValue(
315 maPropertyIdToNameMap[Int_TabItemWidth],
316 Any(sal_Int32(32)));
317 setPropertyValue(
318 maPropertyIdToNameMap[Int_TabItemHeight],
319 Any(sal_Int32(32)));
320 setPropertyValue(
321 maPropertyIdToNameMap[Color_TabItemBorder],

--- 20 unchanged lines hidden (view full) ---

342 setPropertyValue(
343 maPropertyIdToNameMap[Paint_TabItemBackgroundHighlight],
344 Any(sal_Int32(rStyle.GetActiveTabColor().GetRGBColor())));
345 // mbIsHighContrastMode ? 0x000000 : 0x00ffffff)));
346
347 setPropertyValue(
348 maPropertyIdToNameMap[Paint_HorizontalBorder],
349 Any(sal_Int32(aBorderColor.GetRGBColor())));
348 // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4)));
350 // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4)));
349 setPropertyValue(
350 maPropertyIdToNameMap[Paint_VerticalBorder],
351 Any(sal_Int32(aBorderColor.GetRGBColor())));
352 // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4)));
353
354 setPropertyValue(
355 maPropertyIdToNameMap[Image_Grip],
356 Any(

--- 11 unchanged lines hidden (view full) ---

368 Any(
369 mbIsHighContrastMode
370 ? A2S("private:graphicrepository/res/minus_sch.png")
371 : A2S("private:graphicrepository/res/minus.png")));
372 setPropertyValue(
373 maPropertyIdToNameMap[Image_TabBarMenu],
374 Any(
375 mbIsHighContrastMode
351 setPropertyValue(
352 maPropertyIdToNameMap[Paint_VerticalBorder],
353 Any(sal_Int32(aBorderColor.GetRGBColor())));
354 // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4)));
355
356 setPropertyValue(
357 maPropertyIdToNameMap[Image_Grip],
358 Any(

--- 11 unchanged lines hidden (view full) ---

370 Any(
371 mbIsHighContrastMode
372 ? A2S("private:graphicrepository/res/minus_sch.png")
373 : A2S("private:graphicrepository/res/minus.png")));
374 setPropertyValue(
375 maPropertyIdToNameMap[Image_TabBarMenu],
376 Any(
377 mbIsHighContrastMode
376 ? A2S("private:graphicrepository/sfx2/res/menu_hc.png")
378 ? A2S("private:graphicrepository/sfx2/res/symphony/open_more_hc.png")
377 : A2S("private:graphicrepository/sfx2/res/symphony/open_more.png")));
378 setPropertyValue(
379 maPropertyIdToNameMap[Image_PanelMenu],
380 Any(
381 mbIsHighContrastMode
382 ? A2S("private:graphicrepository/sfx2/res/symphony/morebutton.png")
383 : A2S("private:graphicrepository/sfx2/res/symphony/morebutton_h.png")));
384 setPropertyValue(

--- 89 unchanged lines hidden (view full) ---

474
475
476void SAL_CALL Theme::disposing (void)
477{
478 ChangeListeners aListeners;
479 maChangeListeners.swap(aListeners);
480
481 const lang::EventObject aEvent (static_cast<XWeak*>(this));
379 : A2S("private:graphicrepository/sfx2/res/symphony/open_more.png")));
380 setPropertyValue(
381 maPropertyIdToNameMap[Image_PanelMenu],
382 Any(
383 mbIsHighContrastMode
384 ? A2S("private:graphicrepository/sfx2/res/symphony/morebutton.png")
385 : A2S("private:graphicrepository/sfx2/res/symphony/morebutton_h.png")));
386 setPropertyValue(

--- 89 unchanged lines hidden (view full) ---

476
477
478void SAL_CALL Theme::disposing (void)
479{
480 ChangeListeners aListeners;
481 maChangeListeners.swap(aListeners);
482
483 const lang::EventObject aEvent (static_cast<XWeak*>(this));
482
484
483 for (ChangeListeners::const_iterator
484 iContainer(maChangeListeners.begin()),
485 iContainerEnd(maChangeListeners.end());
486 iContainerEnd!=iContainerEnd;
487 ++iContainerEnd)
488 {
489 for (ChangeListenerContainer::const_iterator
490 iListener(iContainer->second.begin()),

--- 41 unchanged lines hidden (view full) ---

532 if (iId == maPropertyNameToIdMap.end())
533 throw beans::UnknownPropertyException(rsPropertyName, NULL);
534
535 const PropertyType eType (GetPropertyType(iId->second));
536 if (eType == PT_Invalid)
537 throw beans::UnknownPropertyException(rsPropertyName, NULL);
538
539 const ThemeItem eItem (iId->second);
485 for (ChangeListeners::const_iterator
486 iContainer(maChangeListeners.begin()),
487 iContainerEnd(maChangeListeners.end());
488 iContainerEnd!=iContainerEnd;
489 ++iContainerEnd)
490 {
491 for (ChangeListenerContainer::const_iterator
492 iListener(iContainer->second.begin()),

--- 41 unchanged lines hidden (view full) ---

534 if (iId == maPropertyNameToIdMap.end())
535 throw beans::UnknownPropertyException(rsPropertyName, NULL);
536
537 const PropertyType eType (GetPropertyType(iId->second));
538 if (eType == PT_Invalid)
539 throw beans::UnknownPropertyException(rsPropertyName, NULL);
540
541 const ThemeItem eItem (iId->second);
540
542
541 if (rValue == maRawValues[eItem])
542 {
543 // Value is not different from the one in the property
544 // set => nothing to do.
545 return;
546 }
547
548 const Any aOldValue (maRawValues[eItem]);
549
550 const beans::PropertyChangeEvent aEvent(
551 static_cast<XWeak*>(this),
552 rsPropertyName,
553 sal_False,
554 eItem,
555 aOldValue,
556 rValue);
543 if (rValue == maRawValues[eItem])
544 {
545 // Value is not different from the one in the property
546 // set => nothing to do.
547 return;
548 }
549
550 const Any aOldValue (maRawValues[eItem]);
551
552 const beans::PropertyChangeEvent aEvent(
553 static_cast<XWeak*>(this),
554 rsPropertyName,
555 sal_False,
556 eItem,
557 aOldValue,
558 rValue);
557
559
558 if (DoVetoableListenersVeto(GetVetoableListeners(__AnyItem, false), aEvent))
559 return;
560 if (DoVetoableListenersVeto(GetVetoableListeners(eItem, false), aEvent))
561 return;
560 if (DoVetoableListenersVeto(GetVetoableListeners(__AnyItem, false), aEvent))
561 return;
562 if (DoVetoableListenersVeto(GetVetoableListeners(eItem, false), aEvent))
563 return;
562
564
563 maRawValues[eItem] = rValue;
564 ProcessNewValue(rValue, eItem, eType);
565
566 BroadcastPropertyChange(GetChangeListeners(__AnyItem, false), aEvent);
567 BroadcastPropertyChange(GetChangeListeners(eItem, false), aEvent);
568}
569
570

--- 166 unchanged lines hidden (view full) ---

737
738 const beans::Property aProperty(
739 maPropertyIdToNameMap[eItem],
740 eItem,
741 GetCppuType(eType),
742 0);
743 aProperties.push_back(aProperty);
744 }
565 maRawValues[eItem] = rValue;
566 ProcessNewValue(rValue, eItem, eType);
567
568 BroadcastPropertyChange(GetChangeListeners(__AnyItem, false), aEvent);
569 BroadcastPropertyChange(GetChangeListeners(eItem, false), aEvent);
570}
571
572

--- 166 unchanged lines hidden (view full) ---

739
740 const beans::Property aProperty(
741 maPropertyIdToNameMap[eItem],
742 eItem,
743 GetCppuType(eType),
744 0);
745 aProperties.push_back(aProperty);
746 }
745
747
746 return cssu::Sequence<css::beans::Property>(
747 &aProperties.front(),
748 aProperties.size());
749}
750
751
752
753

--- 42 unchanged lines hidden (view full) ---

796{
797 maPropertyIdToNameMap.resize(__Post_Rect);
798 maImages.resize(__Image_Color - __Pre_Image - 1);
799 maColors.resize(__Color_Paint - __Image_Color - 1);
800 maPaints.resize(__Paint_Int - __Color_Paint - 1);
801 maIntegers.resize(__Int_Bool - __Paint_Int - 1);
802 maBooleans.resize(__Bool_Rect - __Int_Bool - 1);
803 maRectangles.resize(__Post_Rect - __Bool_Rect - 1);
748 return cssu::Sequence<css::beans::Property>(
749 &aProperties.front(),
750 aProperties.size());
751}
752
753
754
755

--- 42 unchanged lines hidden (view full) ---

798{
799 maPropertyIdToNameMap.resize(__Post_Rect);
800 maImages.resize(__Image_Color - __Pre_Image - 1);
801 maColors.resize(__Color_Paint - __Image_Color - 1);
802 maPaints.resize(__Paint_Int - __Color_Paint - 1);
803 maIntegers.resize(__Int_Bool - __Paint_Int - 1);
804 maBooleans.resize(__Bool_Rect - __Int_Bool - 1);
805 maRectangles.resize(__Post_Rect - __Bool_Rect - 1);
804
806
805 #define AddEntry(e) maPropertyNameToIdMap[A2S(#e)]=e; maPropertyIdToNameMap[e]=A2S(#e)
807 #define AddEntry(e) maPropertyNameToIdMap[A2S(#e)]=e; maPropertyIdToNameMap[e]=A2S(#e)
806
808
807 AddEntry(Image_Grip);
808 AddEntry(Image_Expand);
809 AddEntry(Image_Collapse);
810 AddEntry(Image_TabBarMenu);
811 AddEntry(Image_PanelMenu);
812 AddEntry(Image_ToolBoxItemSeparator);
813 AddEntry(Image_Closer);
814 AddEntry(Image_CloseIndicator);

--- 41 unchanged lines hidden (view full) ---

856
857 AddEntry(Bool_UseSymphonyIcons);
858 AddEntry(Bool_UseSystemColors);
859 AddEntry(Bool_UseToolBoxItemSeparator);
860 AddEntry(Bool_IsHighContrastModeActive);
861
862 AddEntry(Rect_ToolBoxPadding);
863 AddEntry(Rect_ToolBoxBorder);
809 AddEntry(Image_Grip);
810 AddEntry(Image_Expand);
811 AddEntry(Image_Collapse);
812 AddEntry(Image_TabBarMenu);
813 AddEntry(Image_PanelMenu);
814 AddEntry(Image_ToolBoxItemSeparator);
815 AddEntry(Image_Closer);
816 AddEntry(Image_CloseIndicator);

--- 41 unchanged lines hidden (view full) ---

858
859 AddEntry(Bool_UseSymphonyIcons);
860 AddEntry(Bool_UseSystemColors);
861 AddEntry(Bool_UseToolBoxItemSeparator);
862 AddEntry(Bool_IsHighContrastModeActive);
863
864 AddEntry(Rect_ToolBoxPadding);
865 AddEntry(Rect_ToolBoxBorder);
864
866
865 #undef AddEntry
866
867 maRawValues.resize(maPropertyIdToNameMap.size());
868}
869
870
871
872

--- 59 unchanged lines hidden (view full) ---

932 case Bool_UseSystemColors:
933 case Bool_UseToolBoxItemSeparator:
934 case Bool_IsHighContrastModeActive:
935 return PT_Boolean;
936
937 case Rect_ToolBoxBorder:
938 case Rect_ToolBoxPadding:
939 return PT_Rectangle;
867 #undef AddEntry
868
869 maRawValues.resize(maPropertyIdToNameMap.size());
870}
871
872
873
874

--- 59 unchanged lines hidden (view full) ---

934 case Bool_UseSystemColors:
935 case Bool_UseToolBoxItemSeparator:
936 case Bool_IsHighContrastModeActive:
937 return PT_Boolean;
938
939 case Rect_ToolBoxBorder:
940 case Rect_ToolBoxPadding:
941 return PT_Rectangle;
940
942
941 default:
942 return PT_Invalid;
943 }
944}
945
946
947
948

--- 238 unchanged lines hidden ---
943 default:
944 return PT_Invalid;
945 }
946}
947
948
949
950

--- 238 unchanged lines hidden ---