diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-06 14:16:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-08 21:49:19 +0100 |
commit | afa52f6907f6baa408a51dccee650faebb5d2d6b (patch) | |
tree | 8e6c68ce463068b7da16a42e331c83768b61bc47 /sfx2/inc/sidebar | |
parent | 10e0a94416094e9c73b4152989481b89afd8b141 (diff) |
only colors are in use so reduce down to just those
Change-Id: I757a0f2e7baa981ecb3cad7e0f975e3ae9c509b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105414
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/inc/sidebar')
-rw-r--r-- | sfx2/inc/sidebar/DeckTitleBar.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sidebar/DrawHelper.hxx | 10 | ||||
-rw-r--r-- | sfx2/inc/sidebar/Paint.hxx | 73 | ||||
-rw-r--r-- | sfx2/inc/sidebar/PanelTitleBar.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sidebar/TitleBar.hxx | 8 |
5 files changed, 9 insertions, 86 deletions
diff --git a/sfx2/inc/sidebar/DeckTitleBar.hxx b/sfx2/inc/sidebar/DeckTitleBar.hxx index 86a71c76a36e..eee139556020 100644 --- a/sfx2/inc/sidebar/DeckTitleBar.hxx +++ b/sfx2/inc/sidebar/DeckTitleBar.hxx @@ -38,7 +38,7 @@ public: private: virtual tools::Rectangle GetTitleArea(const tools::Rectangle& rTitleBarBox) override; virtual void PaintDecoration(vcl::RenderContext& rRenderContext) override; - virtual sidebar::Paint GetBackgroundPaint() override; + virtual Color GetBackgroundPaintColor() override; virtual void HandleToolBoxItemClick(const sal_uInt16 nItemIndex) override; virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; diff --git a/sfx2/inc/sidebar/DrawHelper.hxx b/sfx2/inc/sidebar/DrawHelper.hxx index a657ac041aef..a066b157aee4 100644 --- a/sfx2/inc/sidebar/DrawHelper.hxx +++ b/sfx2/inc/sidebar/DrawHelper.hxx @@ -25,21 +25,19 @@ class SvBorder; namespace sfx2::sidebar { -class Paint; - /** Some convenience functions for painting backgrounds and borders. */ class DrawHelper { public: static void DrawBorder(vcl::RenderContext& rRenderContext, const tools::Rectangle& rBox, const SvBorder& rBorderSize, - const Paint& rHorizontalPaint, const Paint& rVerticalPaint); + const Color& rHorizontalColor, const Color& rVerticalColor); static void DrawHorizontalLine(vcl::RenderContext& rRenderContext, const sal_Int32 nLeft, const sal_Int32 nRight, - const sal_Int32 nY, const sal_Int32 nHeight, const Paint& rPaint); + const sal_Int32 nY, const sal_Int32 nHeight, const Color& rColor); static void DrawVerticalLine(vcl::RenderContext& rRenderContext, const sal_Int32 nTop, const sal_Int32 nBottom, - const sal_Int32 nX, const sal_Int32 nWidth, const Paint& rPaint); + const sal_Int32 nX, const sal_Int32 nWidth, const Color& rColor); static void DrawRoundedRectangle(vcl::RenderContext& rRenderContext, const tools::Rectangle& rBox, const sal_Int32 nCornerRadius, - const Color& rBorderColor, const Paint& rFillPaint); + const Color& rBorderColor, const Color& rFillColor); }; } // end of namespace sfx2::sidebar diff --git a/sfx2/inc/sidebar/Paint.hxx b/sfx2/inc/sidebar/Paint.hxx deleted file mode 100644 index ea2af1d5e0cf..000000000000 --- a/sfx2/inc/sidebar/Paint.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#pragma once - -#include <vcl/gradient.hxx> -#include <vcl/wall.hxx> - -#include <boost/variant.hpp> - -namespace sfx2::sidebar { - -/** Abstraction of different ways to fill outlines. - Can be - - none (empty: outline is not filled) - - singular color - - gradient -*/ -class Paint -{ -public: - enum Type - { - NoPaint, - ColorPaint, - GradientPaint - }; - - // Create a Paint object for an Any that may contain a color, a - // awt::Gradient, or nothing. - static Paint Create (const css::uno::Any& rValue); - - // Create paint with type NoPaint. - explicit Paint(); - - // Create a Paint object for the given color. - explicit Paint (const Color& rColor); - - // Create a Paint object for the given gradient. - explicit Paint (const Gradient& rGradient); - - Type GetType() const { return meType;} - const Color& GetColor() const; - const Gradient& GetGradient() const; - - Wallpaper GetWallpaper() const; - -private: - Type meType; - ::boost::variant< - Color, - Gradient - > maValue; -}; - -} // end of namespace sfx2::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sidebar/PanelTitleBar.hxx b/sfx2/inc/sidebar/PanelTitleBar.hxx index b060124b9e07..e84febf1e125 100644 --- a/sfx2/inc/sidebar/PanelTitleBar.hxx +++ b/sfx2/inc/sidebar/PanelTitleBar.hxx @@ -46,7 +46,7 @@ public: private: virtual tools::Rectangle GetTitleArea(const tools::Rectangle& rTitleBarBox) override; virtual void PaintDecoration(vcl::RenderContext& rRenderContext) override; - virtual sidebar::Paint GetBackgroundPaint() override; + virtual Color GetBackgroundPaintColor() override; virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex) override; virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; diff --git a/sfx2/inc/sidebar/TitleBar.hxx b/sfx2/inc/sidebar/TitleBar.hxx index e1029b54ee30..f86a39324d70 100644 --- a/sfx2/inc/sidebar/TitleBar.hxx +++ b/sfx2/inc/sidebar/TitleBar.hxx @@ -18,8 +18,6 @@ */ #pragma once -#include <sidebar/Paint.hxx> - #include <sidebar/SidebarToolBox.hxx> namespace sfx2::sidebar { @@ -29,7 +27,7 @@ class TitleBar : public vcl::Window public: TitleBar (const OUString& rsTitle, vcl::Window* pParentWindow, - const sidebar::Paint& rInitialBackgroundPaint); + const Color& rInitialBackgroundColor); virtual ~TitleBar() override; virtual void dispose() override; @@ -59,13 +57,13 @@ protected: virtual tools::Rectangle GetTitleArea (const tools::Rectangle& rTitleBarBox) = 0; virtual void PaintDecoration (vcl::RenderContext& rRenderContext) = 0; void PaintFocus(vcl::RenderContext& rRenderContext, const tools::Rectangle& rFocusBox); - virtual sidebar::Paint GetBackgroundPaint() = 0; + virtual Color GetBackgroundPaintColor() = 0; virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex); virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; private: Image maIcon; - sidebar::Paint maBackgroundPaint; + Color maBackgroundColor; void PaintTitle(vcl::RenderContext& rRenderContext, const tools::Rectangle& rTitleBox); DECL_LINK(SelectionHandler, ToolBox*, void); |