1ff12d537SAndre Fischer /************************************************************** 2ff12d537SAndre Fischer * 3ff12d537SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 4ff12d537SAndre Fischer * or more contributor license agreements. See the NOTICE file 5ff12d537SAndre Fischer * distributed with this work for additional information 6ff12d537SAndre Fischer * regarding copyright ownership. The ASF licenses this file 7ff12d537SAndre Fischer * to you under the Apache License, Version 2.0 (the 8ff12d537SAndre Fischer * "License"); you may not use this file except in compliance 9ff12d537SAndre Fischer * with the License. You may obtain a copy of the License at 10ff12d537SAndre Fischer * 11ff12d537SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 12ff12d537SAndre Fischer * 13ff12d537SAndre Fischer * Unless required by applicable law or agreed to in writing, 14ff12d537SAndre Fischer * software distributed under the License is distributed on an 15ff12d537SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ff12d537SAndre Fischer * KIND, either express or implied. See the License for the 17ff12d537SAndre Fischer * specific language governing permissions and limitations 18ff12d537SAndre Fischer * under the License. 19ff12d537SAndre Fischer * 20ff12d537SAndre Fischer *************************************************************/ 21ff12d537SAndre Fischer 22ff12d537SAndre Fischer #include "precompiled_sfx2.hxx" 23ff12d537SAndre Fischer 24ff12d537SAndre Fischer #include "DeckTitleBar.hxx" 25*b9e67834SAndre Fischer #include "sfx2/sidebar/Theme.hxx" 26ff12d537SAndre Fischer 27ff12d537SAndre Fischer namespace sfx2 { namespace sidebar { 28ff12d537SAndre Fischer 29ff12d537SAndre Fischer static const sal_Int32 gaLeftGripPadding (3); 30ff12d537SAndre Fischer static const sal_Int32 gaRightGripPadding (3); 31ff12d537SAndre Fischer 32ff12d537SAndre Fischer 33ff12d537SAndre Fischer DeckTitleBar::DeckTitleBar ( 34ff12d537SAndre Fischer const ::rtl::OUString& rsTitle, 35ff12d537SAndre Fischer Window* pParentWindow) 36ff12d537SAndre Fischer : TitleBar(rsTitle, pParentWindow) 37ff12d537SAndre Fischer { 38ff12d537SAndre Fischer } 39ff12d537SAndre Fischer 40ff12d537SAndre Fischer 41ff12d537SAndre Fischer 42ff12d537SAndre Fischer 43ff12d537SAndre Fischer DeckTitleBar::~DeckTitleBar (void) 44ff12d537SAndre Fischer { 45ff12d537SAndre Fischer } 46ff12d537SAndre Fischer 47ff12d537SAndre Fischer 48ff12d537SAndre Fischer 49ff12d537SAndre Fischer 50ff12d537SAndre Fischer Rectangle DeckTitleBar::GetTitleArea (const Rectangle& rTitleBarBox) 51ff12d537SAndre Fischer { 52*b9e67834SAndre Fischer Image aGripImage (Theme::GetImage(Theme::Image_Grip)); 53ff12d537SAndre Fischer return Rectangle( 54ff12d537SAndre Fischer aGripImage.GetSizePixel().Width() + gaLeftGripPadding + gaRightGripPadding, 55ff12d537SAndre Fischer rTitleBarBox.Top(), 56ff12d537SAndre Fischer rTitleBarBox.Right(), 57ff12d537SAndre Fischer rTitleBarBox.Bottom()); 58ff12d537SAndre Fischer } 59ff12d537SAndre Fischer 60ff12d537SAndre Fischer 61ff12d537SAndre Fischer 62ff12d537SAndre Fischer 63ff12d537SAndre Fischer void DeckTitleBar::PaintDecoration (const Rectangle& rTitleBarBox) 64ff12d537SAndre Fischer { 65*b9e67834SAndre Fischer (void)rTitleBarBox; 66*b9e67834SAndre Fischer 67*b9e67834SAndre Fischer Image aGripImage (Theme::GetImage(Theme::Image_Grip)); 68ff12d537SAndre Fischer 69ff12d537SAndre Fischer const Point aTopLeft ( 70ff12d537SAndre Fischer gaLeftGripPadding, 71ff12d537SAndre Fischer (GetSizePixel().Height()-aGripImage.GetSizePixel().Height())/2); 72ff12d537SAndre Fischer DrawImage(aTopLeft, aGripImage); 73ff12d537SAndre Fischer } 74ff12d537SAndre Fischer 75ff12d537SAndre Fischer 76ff12d537SAndre Fischer 77ff12d537SAndre Fischer 78ff12d537SAndre Fischer sidebar::Paint DeckTitleBar::GetBackgroundPaint (void) 79ff12d537SAndre Fischer { 80*b9e67834SAndre Fischer return Theme::GetPaint(Theme::Paint_DeckTitleBarBackground); 81ff12d537SAndre Fischer } 82ff12d537SAndre Fischer 83ff12d537SAndre Fischer 84ff12d537SAndre Fischer 85ff12d537SAndre Fischer 86ff12d537SAndre Fischer Color DeckTitleBar::GetTextColor (void) 87ff12d537SAndre Fischer { 88*b9e67834SAndre Fischer return Theme::GetColor(Theme::Color_DeckTitleFont); 89ff12d537SAndre Fischer } 90ff12d537SAndre Fischer 91ff12d537SAndre Fischer 92ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar 93