Also resolves tdf#92248 This extends icon name resolving so that is in addition tries to find an icon with the "svg" extension and load that instead of stated (mostly "png") extension. If the filename extension is "svg" we load the icon with the SVG filter instead. This also adds icon scaling and conversion for HiDPI or when a dark theme is wanted. If the SVG icon is available, we render it at a higher resolution instead of scaling As loading of SVG icons can be computatunally expensive, a icon disk cache was added. This saves the rendered SVG as a PNG image into the "cache" folder. The same caching is also used for HiDPI and dark theme converted icons so we don't always scale or convert the icons. In addition some style changes and DRY fixes were made to the ImplImageTree source code. Change-Id: I9e421395a342ffe8da9facea7ea06e5db2778b26 Reviewed-on: https://gerrit.libreoffice.org/30339 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
31 lines
721 B
C++
31 lines
721 B
C++
/* -*- 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/.
|
|
*/
|
|
|
|
#ifndef INCLUDED_VCL_BITMAP_TOOLS_HXX
|
|
#define INCLUDED_VCL_BITMAP_TOOLS_HXX
|
|
|
|
#include <vcl/bitmapex.hxx>
|
|
#include <tools/stream.hxx>
|
|
|
|
namespace vcl
|
|
{
|
|
|
|
namespace bitmap
|
|
{
|
|
|
|
void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, double fScaleFactor = 1.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // INCLUDED_VCL_BITMAP_TOOLS_HXX
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|