1*b9e67834SAndre Fischer /************************************************************** 2*b9e67834SAndre Fischer * 3*b9e67834SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 4*b9e67834SAndre Fischer * or more contributor license agreements. See the NOTICE file 5*b9e67834SAndre Fischer * distributed with this work for additional information 6*b9e67834SAndre Fischer * regarding copyright ownership. The ASF licenses this file 7*b9e67834SAndre Fischer * to you under the Apache License, Version 2.0 (the 8*b9e67834SAndre Fischer * "License"); you may not use this file except in compliance 9*b9e67834SAndre Fischer * with the License. You may obtain a copy of the License at 10*b9e67834SAndre Fischer * 11*b9e67834SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 12*b9e67834SAndre Fischer * 13*b9e67834SAndre Fischer * Unless required by applicable law or agreed to in writing, 14*b9e67834SAndre Fischer * software distributed under the License is distributed on an 15*b9e67834SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b9e67834SAndre Fischer * KIND, either express or implied. See the License for the 17*b9e67834SAndre Fischer * specific language governing permissions and limitations 18*b9e67834SAndre Fischer * under the License. 19*b9e67834SAndre Fischer * 20*b9e67834SAndre Fischer *************************************************************/ 21*b9e67834SAndre Fischer 22*b9e67834SAndre Fischer #include "precompiled_sfx2.hxx" 23*b9e67834SAndre Fischer 24*b9e67834SAndre Fischer #include "SidebarToolBox.hxx" 25*b9e67834SAndre Fischer 26*b9e67834SAndre Fischer #include <vcl/gradient.hxx> 27*b9e67834SAndre Fischer 28*b9e67834SAndre Fischer using namespace ::com::sun::star; 29*b9e67834SAndre Fischer using namespace ::com::sun::star::uno; 30*b9e67834SAndre Fischer 31*b9e67834SAndre Fischer 32*b9e67834SAndre Fischer namespace sfx2 { namespace sidebar { 33*b9e67834SAndre Fischer 34*b9e67834SAndre Fischer 35*b9e67834SAndre Fischer SidebarToolBox::SidebarToolBox ( 36*b9e67834SAndre Fischer Window* pParentWindow, 37*b9e67834SAndre Fischer const ResId& rResId) 38*b9e67834SAndre Fischer : ToolBox(pParentWindow, rResId) 39*b9e67834SAndre Fischer { 40*b9e67834SAndre Fischer SetBackground(Wallpaper()); 41*b9e67834SAndre Fischer SetPaintTransparent(true); 42*b9e67834SAndre Fischer } 43*b9e67834SAndre Fischer 44*b9e67834SAndre Fischer 45*b9e67834SAndre Fischer 46*b9e67834SAndre Fischer 47*b9e67834SAndre Fischer SidebarToolBox::~SidebarToolBox (void) 48*b9e67834SAndre Fischer { 49*b9e67834SAndre Fischer } 50*b9e67834SAndre Fischer 51*b9e67834SAndre Fischer 52*b9e67834SAndre Fischer 53*b9e67834SAndre Fischer 54*b9e67834SAndre Fischer void SidebarToolBox::Paint (const Rectangle& rRect) 55*b9e67834SAndre Fischer { 56*b9e67834SAndre Fischer /* 57*b9e67834SAndre Fischer OutputDevice* pDevice (GetParent()); 58*b9e67834SAndre Fischer 59*b9e67834SAndre Fischer if (pDevice != NULL) 60*b9e67834SAndre Fischer { 61*b9e67834SAndre Fischer Rectangle aRect (GetPosPixel(), GetSizePixel()); 62*b9e67834SAndre Fischer aRect.Left() -= 2; 63*b9e67834SAndre Fischer aRect.Top() -= 1; 64*b9e67834SAndre Fischer aRect.Right() += 2; 65*b9e67834SAndre Fischer aRect.Bottom() += 1; 66*b9e67834SAndre Fischer const Color aSavedLineColor = pDevice->GetLineColor(); 67*b9e67834SAndre Fischer const Color aSavedFillColor = pDevice->GetFillColor(); 68*b9e67834SAndre Fischer Color aLineColor(200,209,225); 69*b9e67834SAndre Fischer // Color aLineColor = GetSettings().GetStyleSettings().GetPropertySectionTBxBorderColor(); 70*b9e67834SAndre Fischer if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 71*b9e67834SAndre Fischer pDevice->SetLineColor(aLineColor); 72*b9e67834SAndre Fischer else 73*b9e67834SAndre Fischer pDevice->SetLineColor(GetSettings().GetStyleSettings().GetShadowColor()); 74*b9e67834SAndre Fischer pDevice->SetFillColor(COL_TRANSPARENT); 75*b9e67834SAndre Fischer pDevice->DrawRect(aRect); 76*b9e67834SAndre Fischer 77*b9e67834SAndre Fischer aRect.Left() += 1 ; 78*b9e67834SAndre Fischer aRect.Top() += 1; 79*b9e67834SAndre Fischer aRect.Right() -= 1; 80*b9e67834SAndre Fischer aRect.Bottom() -= 1; 81*b9e67834SAndre Fischer Color aStartColor(220,228,238); 82*b9e67834SAndre Fischer Color aEndColor(245,245,247); 83*b9e67834SAndre Fischer Gradient aBKGrad(GRADIENT_LINEAR, aStartColor, aEndColor); 84*b9e67834SAndre Fischer if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 85*b9e67834SAndre Fischer // DrawGradient(aRect, GetSettings().GetStyleSettings().GetPropertySectionTBxBKGGradient()); 86*b9e67834SAndre Fischer pDevice->DrawGradient(aRect, aBKGrad); 87*b9e67834SAndre Fischer //else 88*b9e67834SAndre Fischer //{ 89*b9e67834SAndre Fischer // SetFillColor(GetSettings().GetStyleSettings().GetMenuColor()); 90*b9e67834SAndre Fischer // DrawRect(aRect); 91*b9e67834SAndre Fischer //} 92*b9e67834SAndre Fischer 93*b9e67834SAndre Fischer pDevice->SetLineColor(aSavedLineColor); 94*b9e67834SAndre Fischer pDevice->SetFillColor(aSavedFillColor); 95*b9e67834SAndre Fischer } 96*b9e67834SAndre Fischer */ 97*b9e67834SAndre Fischer 98*b9e67834SAndre Fischer ToolBox::Paint(rRect); 99*b9e67834SAndre Fischer } 100*b9e67834SAndre Fischer 101*b9e67834SAndre Fischer } } // end of namespace sfx2::sidebar 102