Git Product home page Git Product logo

wxmaterialdesignartprovider's Introduction

Material Design icons Art Provider for wxWidgets

This project contains a custom Art Provider for the wxWidgets containing all Material Design icons. The original icons were taken from the SVG Material Design icons, the SimpleIcons, the FontAwesome 6.4 and the FluentUI icons repositories. Generation of the wxWidgets core header files is fully automated, hopefully in the future it will be integrated with the CI for updates to the base repo.

All SVG icons are hardcoded into headers such that no external files are needed to build the art provider class beyond those in MaterialDesign/. So it should be relatively easy to add Material Design icon functionality to existing wxwidgets projects.

Building, Using

A simple CodeBlocks project is provided to build the example on Windows (MSYS2) and MacOS (clang + homebrew). To add the wxMaterialDesignArtProvider class to your project, just register it with the default art provider as:

    // Register art provider
    wxArtProvider::Push(new wxMaterialDesignArtProvider);

So that the new art IDs can be used. For each material design icon, an art ID is registered with the following pattern:

   wxART_ICONNAME

where iconname is the name of the icon. The same names are available under five different clients, each of them corresponds to a different dataset:

*** Material Design

  • wxART_CLIENT_MATERIAL_FILLED for filled icons;
  • wxART_CLIENT_MATERIAL_OUTLINE for outlined icons;
  • wxART_CLIENT_MATERIAL_ROUND for round icons;
  • wxART_CLIENT_MATERIAL_SHARP for sharp icons;
  • wxART_CLIENT_MATERIAL_TWOTONE for two-tone icons;

*** FontAwesome 6

  • wxART_CLIENT_AWESOME_BRANDS for brand logos;
  • wxART_CLIENT_AWESOME_SOLID for solid-style icons;
  • wxART_CLIENT_AWESOME_REGULAR for regular icons;

*** SimpleIcons

  • wxART_CLIENT_SIMPLE_ICONS;

*** FluentUI

  • wxART_CLIENT_FLUENTUI_REGULAR
  • wxART_CLUENT_FLUENTUI_FILLED.

Colors

wxMaterialDesignArtProvider supports additional methods to provide the icons with a custom color. Color-based inputs are not available in the core wxArtProvider API, so to use them, it is necessary to call them directly from the wxMaterialDesignArtProvider class. They're all static methods: no need to instantiate an art provider anywhere. The color is provided as a wxColour additional input to the standard APIs, and resolves to wxBLACK if none is provided. For example, a generic art provider call with a color input will look like:

    wxBitmap bmp;
    if (wxMaterialDesignArtProvider::HasClient(client)) {
        // Use Material Design API
        bmp = wxMaterialDesignArtProvider::GetBitmap(id, client, size, color);
    } else {
        // Use default art provider (includes overrides, if present)
        bmp = wxArtProvider::GetBitmap(id, client, size);
    }

The attached project contains a sample icon browser, modelled on wxWidget's standard one, and can be used to navigate all art names and styles:

Art browser example on Windows

Art browser example on MacOS

License

  • FontAwesome icons from the FontAwesome 6 SVG set are subject to the CC BY 4.0 License.
  • Material Design icons are subject to the Apache 2.0 license.
  • SimpleIcons are subject to the CC0 1.0 License.
  • FluentUI icons are subject to the MIT License.

This provider is released under the Apache 2.0 license, that all dataset licenses should get along with.

wxmaterialdesignartprovider's People

Contributors

perazz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wxmaterialdesignartprovider's Issues

Question about Windows build, where is your "wx-config.exe"?

Hi, I just see this:

		<Compiler>
			<Add option="-std=c++11" />
			<Add option="`wx-config --cflags`" />
		</Compiler>
		<Linker>
			<Add option="`wx-config --libs`" />
		</Linker>

Which looks like you need a "wx-config.exe" under Windows?

If that is correct, how does the "wx-config.exe" know about the wxWidgets library's location?

For me, under Windows + Code::Blocks, I use this kind of setting:

asmwarrior/cb_projects_for_wxWidgets: Code::Blocks projects for building wxWidgets sample code

With such kinds of setting, I can either build a wx project against the wx library from msys2 or my self built wx library.

error compiling on Visual Studio 2022

Hello

Is this supported on Visual Studio?
When I try to compile with VS2022, I get a number of C2026 errors on wxSimpleIconsArt.hpp, e.g.

1>C:\dev\wxMaterialDesignArtProvider\MaterialDesign\wxSimpleIconsArt.hpp(3615,1): error C2026: string too big, trailing characters truncated

indicating that string literals are too long.

Kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.