@@ -1 +1 @@ | |||||
Subproject commit 8e747ec0d573d66396a4f81dbc7a167964494e07 | |||||
Subproject commit d49366db694fb9097210ba9665449f6a67025285 |
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * Permission to use, copy, modify, and/or distribute this software for any purpose with | ||||
* or without fee is hereby granted, provided that the above copyright notice and this | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * Permission to use, copy, modify, and/or distribute this software for any purpose with | ||||
* or without fee is hereby granted, provided that the above copyright notice and this | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -319,6 +319,8 @@ class DemoWindow : public Window, | |||||
public LeftSideWidget::Callback | public LeftSideWidget::Callback | ||||
{ | { | ||||
public: | public: | ||||
static const int kSidebarWidth = 81; | |||||
DemoWindow(Application& app) | DemoWindow(Application& app) | ||||
: Window(app), | : Window(app), | ||||
wColor(*this), | wColor(*this), | ||||
@@ -338,11 +340,11 @@ public: | |||||
wText.hide(); | wText.hide(); | ||||
//wPerf.hide(); | //wPerf.hide(); | ||||
wColor.setAbsoluteX(81); | |||||
wImages.setAbsoluteX(81); | |||||
wRects.setAbsoluteX(81); | |||||
wShapes.setAbsoluteX(81); | |||||
wText.setAbsoluteX(81); | |||||
wColor.setAbsoluteX(kSidebarWidth); | |||||
wImages.setAbsoluteX(kSidebarWidth); | |||||
wRects.setAbsoluteX(kSidebarWidth); | |||||
wShapes.setAbsoluteX(kSidebarWidth); | |||||
wText.setAbsoluteX(kSidebarWidth); | |||||
wLeft.setAbsolutePos(2, 2); | wLeft.setAbsolutePos(2, 2); | ||||
wPerf.setAbsoluteY(5); | wPerf.setAbsoluteY(5); | ||||
@@ -354,14 +356,17 @@ public: | |||||
void onReshape(uint width, uint height) override | void onReshape(uint width, uint height) override | ||||
{ | { | ||||
Size<uint> size(width-81, height); | |||||
if (width < kSidebarWidth) | |||||
return; | |||||
Size<uint> size(width-kSidebarWidth, height); | |||||
wColor.setSize(size); | wColor.setSize(size); | ||||
wImages.setSize(size); | wImages.setSize(size); | ||||
wRects.setSize(size); | wRects.setSize(size); | ||||
wShapes.setSize(size); | wShapes.setSize(size); | ||||
wText.setSize(size); | wText.setSize(size); | ||||
wLeft.setSize(81-4, height-4); | |||||
wLeft.setSize(kSidebarWidth-4, height-4); | |||||
//wRezHandle.setAbsoluteX(width-wRezHandle.getWidth()); | //wRezHandle.setAbsoluteX(width-wRezHandle.getWidth()); | ||||
//wRezHandle.setAbsoluteY(height-wRezHandle.getHeight()); | //wRezHandle.setAbsoluteY(height-wRezHandle.getHeight()); | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * Permission to use, copy, modify, and/or distribute this software for any purpose with | ||||
* or without fee is hereby granted, provided that the above copyright notice and this | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -145,7 +145,7 @@ public: | |||||
} | } | ||||
protected: | protected: | ||||
void onReshape(int width, int height) | |||||
void onReshape(uint width, uint height) override | |||||
{ | { | ||||
fDemo.setSize(width, height); | fDemo.setSize(width, height); | ||||
//fDemo.setAbsolutePos(10, height-fDemo.getHeight()-50); | //fDemo.setAbsolutePos(10, height-fDemo.getHeight()-50); | ||||
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
* DISTRHO Plugin Framework (DPF) | * DISTRHO Plugin Framework (DPF) | ||||
* Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com> | |||||
* | * | ||||
* Permission to use, copy, modify, and/or distribute this software for any purpose with | * Permission to use, copy, modify, and/or distribute this software for any purpose with | ||||
* or without fee is hereby granted, provided that the above copyright notice and this | * or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -202,7 +202,7 @@ public: | |||||
} | } | ||||
protected: | protected: | ||||
void onReshape(int width, int height) | |||||
void onReshape(uint width, uint height) override | |||||
{ | { | ||||
fDemo.setSize(width, height); | fDemo.setSize(width, height); | ||||
@@ -807,7 +807,7 @@ int loadDemoData(NVGcontext* vg, DemoData* data) | |||||
for (i = 0; i < 12; i++) { | for (i = 0; i < 12; i++) { | ||||
char file[128]; | char file[128]; | ||||
snprintf(file, 128, "../example/images/image%d.jpg", i+1); | |||||
snprintf(file, 128, "./nanovg_res/images/image%d.jpg", i+1); | |||||
data->images[i] = nvgCreateImage(vg, file, 0); | data->images[i] = nvgCreateImage(vg, file, 0); | ||||
if (data->images[i] == 0) { | if (data->images[i] == 0) { | ||||
printf("Could not load %s.\n", file); | printf("Could not load %s.\n", file); | ||||
@@ -815,17 +815,17 @@ int loadDemoData(NVGcontext* vg, DemoData* data) | |||||
} | } | ||||
} | } | ||||
data->fontIcons = nvgCreateFont(vg, "icons", "../example/entypo.ttf"); | |||||
data->fontIcons = nvgCreateFont(vg, "icons", "./nanovg_res/entypo.ttf"); | |||||
if (data->fontIcons == -1) { | if (data->fontIcons == -1) { | ||||
printf("Could not add font icons.\n"); | printf("Could not add font icons.\n"); | ||||
return -1; | return -1; | ||||
} | } | ||||
data->fontNormal = nvgCreateFont(vg, "sans", "../example/Roboto-Regular.ttf"); | |||||
data->fontNormal = nvgCreateFont(vg, "sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
if (data->fontNormal == -1) { | if (data->fontNormal == -1) { | ||||
printf("Could not add font italic.\n"); | printf("Could not add font italic.\n"); | ||||
return -1; | return -1; | ||||
} | } | ||||
data->fontBold = nvgCreateFont(vg, "sans-bold", "../example/Roboto-Bold.ttf"); | |||||
data->fontBold = nvgCreateFont(vg, "sans-bold", "./nanovg_res/Roboto-Bold.ttf"); | |||||
if (data->fontBold == -1) { | if (data->fontBold == -1) { | ||||
printf("Could not add font bold.\n"); | printf("Could not add font bold.\n"); | ||||
return -1; | return -1; | ||||