Skip to content

Commit

Permalink
Full glyph set from figma imported and loading (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Aug 1, 2024
1 parent b201af7 commit ab4f151
Show file tree
Hide file tree
Showing 59 changed files with 342 additions and 278 deletions.
46 changes: 40 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,50 @@ endif ()
include(cmake/CmakeRC.cmake)

cmrc_add_resource_library(sst-jucegui-resources NAMESPACE sst::jucegui::resources
res/glyphs/step_count.svg
res/glyphs/add-mod.svg
res/glyphs/close.svg
res/glyphs/curve.svg
res/glyphs/down.svg
res/glyphs/edit.svg
res/glyphs/ellipsis-h.svg
res/glyphs/ellipsis-v.svg
res/glyphs/favorite.svg
res/glyphs/forward-backward.svg
res/glyphs/freeze.svg
res/glyphs/left-right.svg
res/glyphs/left.svg
res/glyphs/link.svg
res/glyphs/lock.svg
res/glyphs/memory.svg
res/glyphs/metronome.svg
res/glyphs/mute.svg
res/glyphs/midi.svg
res/glyphs/mul-mod.svg
res/glyphs/note-priority.svg
res/glyphs/pan.svg
res/glyphs/pin.svg
res/glyphs/plus-minus.svg
res/glyphs/plus.svg
res/glyphs/polyphony.svg
res/glyphs/portamento.svg
res/glyphs/power.svg
res/glyphs/reverse.svg
res/glyphs/right.svg
res/glyphs/routing-post-fader.svg
res/glyphs/routing-pre-fader.svg
res/glyphs/routing-pre-fx.svg
res/glyphs/heart.svg
res/glyphs/chip.svg
res/glyphs/save-as.svg
)
res/glyphs/save.svg
res/glyphs/search.svg
res/glyphs/settings.svg
res/glyphs/shortcircuit-logo.svg
res/glyphs/speaker.svg
res/glyphs/step-count.svg
res/glyphs/surge-logo.svg
res/glyphs/tuning.svg
res/glyphs/unpin.svg
res/glyphs/up-down.svg
res/glyphs/up.svg
res/glyphs/volume.svg
)

add_library(${PROJECT_NAME} STATIC
src/sst/jucegui/components/ComponentBase.cpp
Expand Down
4 changes: 2 additions & 2 deletions examples/component-demo/GlyphDemo.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ struct GlyphDemo : public sst::jucegui::components::WindowPanel
for (const auto &col :
{juce::Colours::white, juce::Colours::orange, juce::Colours::red})
{
for (int i = sst::jucegui::components::GlyphPainter::PAN;
i <= sst::jucegui::components::GlyphPainter::STEREO; ++i)
for (int i = (sst::jucegui::components::GlyphPainter::GlyphType)0;
i <= sst::jucegui::components::GlyphPainter::SHORTCIRCUIT_LOGO; ++i)
{
sst::jucegui::components::GlyphPainter::paintGlyph(
g, r, (sst::jucegui::components::GlyphPainter::GlyphType)i, col);
Expand Down
66 changes: 48 additions & 18 deletions include/sst/jucegui/components/GlyphPainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,43 +53,73 @@ struct GlyphPainter : public juce::Component,
*/
enum GlyphType
{
PAN,
VOLUME,
TUNING,
CROSS,
ARROW_L_TO_R,
ARROW_L_TO_R_WITH_MUL,
METRONOME,

JOG_UP,
JOG_DOWN,
JOG_LEFT,
JOG_RIGHT,

BIG_PLUS,
ELLIPSIS_H,
ELLIPSIS_V,

HAMBURGER,
UP_DOWN,
LEFT_RIGHT,

PLUS,
PLUS_MINUS,

REVERSE,
FORWARD_BACKWARD,

PAN,
VOLUME,
TUNING,
METRONOME,
KEYBOARD,

MODULATION_ADDITIVE,
MODULATION_MULTIPLICATIVE,

STEP_COUNT,
POWER_LIGHT,
POWER_LIGHT_OFF, // a special case of an off power light which isn't the
SMALL_POWER_LIGHT,
SMALL_POWER_LIGHT_OFF, // a special case of an off power light which isn't the
// grayed out filled power light

// Channel Strip routing icons
ROUTING_PRE_FX,
ROUTING_PRE_FADER,
ROUTING_POST_FADER,

MUTE,
HEART,
CHIP,
SAVE_AS,
FAVORITE,
SAVE,
SEARCH,
SETTINGS,
CLOSE,
EDIT,

LINK,
LOCK,
PIN,
UNPIN,
POWER,

MEMORY, // a chip-like glyph
MIDI,

SPEAKER,
PORTAMENTO,
CURVE,
POLYPHONY,

FREEZE,
NOTE_PRIORITY,

MONO,
STEREO // the order doesn't matter but we iterate in the demo so
// lets leave stereo last
STEREO,

SURGE_LOGO,
SHORTCIRCUIT_LOGO
// the order doesn't matter but we iterate in the demo so
// lets leave shortcircuit logo last
} glyph;

// The glyph acts like a label so uses hte label color
Expand Down
3 changes: 2 additions & 1 deletion include/sst/jucegui/components/ToggleButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ struct ToggleButton : DiscreteParamEditor,
}
void setLabel(const std::string &l) { label = l; }

GlyphPainter::GlyphType type{GlyphPainter::CROSS}, offType{GlyphPainter::BIG_PLUS};
GlyphPainter::GlyphType type{GlyphPainter::SMALL_POWER_LIGHT},
offType{GlyphPainter::SMALL_POWER_LIGHT_OFF};
void setGlyph(GlyphPainter::GlyphType gt)
{
if (drawMode != DrawMode::GLYPH && drawMode != DrawMode::DUAL_GLYPH)
Expand Down
4 changes: 4 additions & 0 deletions res/glyphs/add-mod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions res/glyphs/chip.svg

This file was deleted.

3 changes: 3 additions & 0 deletions res/glyphs/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/curve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions res/glyphs/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions res/glyphs/ellipsis-h.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions res/glyphs/ellipsis-v.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/favorite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions res/glyphs/forward-backward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/freeze.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions res/glyphs/heart.svg

This file was deleted.

4 changes: 4 additions & 0 deletions res/glyphs/left-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/memory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/midi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions res/glyphs/mul-mod.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions res/glyphs/mute.svg

This file was deleted.

5 changes: 5 additions & 0 deletions res/glyphs/note-priority.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/pan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/plus-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/glyphs/plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions res/glyphs/polyphony.svg
Loading

0 comments on commit ab4f151

Please sign in to comment.