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 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 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 #include "precompiled_sfx2.hxx" 23 24 #include "SidebarToolBox.hxx" 25 26 #include <vcl/gradient.hxx> 27 28 using namespace ::com::sun::star; 29 using namespace ::com::sun::star::uno; 30 31 32 namespace sfx2 { namespace sidebar { 33 34 35 SidebarToolBox::SidebarToolBox ( 36 Window* pParentWindow, 37 const ResId& rResId) 38 : ToolBox(pParentWindow, rResId) 39 { 40 SetBackground(Wallpaper()); 41 SetPaintTransparent(true); 42 } 43 44 45 46 47 SidebarToolBox::~SidebarToolBox (void) 48 { 49 } 50 51 52 53 54 void SidebarToolBox::Paint (const Rectangle& rRect) 55 { 56 /* 57 OutputDevice* pDevice (GetParent()); 58 59 if (pDevice != NULL) 60 { 61 Rectangle aRect (GetPosPixel(), GetSizePixel()); 62 aRect.Left() -= 2; 63 aRect.Top() -= 1; 64 aRect.Right() += 2; 65 aRect.Bottom() += 1; 66 const Color aSavedLineColor = pDevice->GetLineColor(); 67 const Color aSavedFillColor = pDevice->GetFillColor(); 68 Color aLineColor(200,209,225); 69 // Color aLineColor = GetSettings().GetStyleSettings().GetPropertySectionTBxBorderColor(); 70 if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 71 pDevice->SetLineColor(aLineColor); 72 else 73 pDevice->SetLineColor(GetSettings().GetStyleSettings().GetShadowColor()); 74 pDevice->SetFillColor(COL_TRANSPARENT); 75 pDevice->DrawRect(aRect); 76 77 aRect.Left() += 1 ; 78 aRect.Top() += 1; 79 aRect.Right() -= 1; 80 aRect.Bottom() -= 1; 81 Color aStartColor(220,228,238); 82 Color aEndColor(245,245,247); 83 Gradient aBKGrad(GRADIENT_LINEAR, aStartColor, aEndColor); 84 if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 85 // DrawGradient(aRect, GetSettings().GetStyleSettings().GetPropertySectionTBxBKGGradient()); 86 pDevice->DrawGradient(aRect, aBKGrad); 87 //else 88 //{ 89 // SetFillColor(GetSettings().GetStyleSettings().GetMenuColor()); 90 // DrawRect(aRect); 91 //} 92 93 pDevice->SetLineColor(aSavedLineColor); 94 pDevice->SetFillColor(aSavedFillColor); 95 } 96 */ 97 98 ToolBox::Paint(rRect); 99 } 100 101 } } // end of namespace sfx2::sidebar 102