Browse Source

Remove Dark mode.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
15ea154602
7 changed files with 5 additions and 45 deletions
  1. +1
    -1
      include/app/ModuleWidget.hpp
  2. +1
    -2
      include/app/SvgPanel.hpp
  3. +2
    -5
      include/helpers.hpp
  4. +0
    -4
      include/settings.hpp
  5. +0
    -11
      src/app/MenuBar.cpp
  6. +1
    -10
      src/app/SvgPanel.cpp
  7. +0
    -12
      src/settings.cpp

+ 1
- 1
include/app/ModuleWidget.hpp View File

@@ -51,7 +51,7 @@ struct ModuleWidget : widget::OpaqueWidget {
*/
void setPanel(widget::Widget* panel);
/** Use `setPanel(createPanel(svg))` instead. */
DEPRECATED void setPanel(std::shared_ptr<Svg> svg);
void setPanel(std::shared_ptr<Svg> svg);

/** Convenience functions for adding special widgets (calls addChild()) */
void addParam(ParamWidget* param);


+ 1
- 2
include/app/SvgPanel.hpp View File

@@ -20,11 +20,10 @@ struct SvgPanel : widget::Widget {
widget::SvgWidget* sw;
PanelBorder* panelBorder;
std::shared_ptr<Svg> svg;
std::shared_ptr<Svg> darkSvg;

SvgPanel();
void step() override;
void setBackground(std::shared_ptr<Svg> svg, std::shared_ptr<Svg> darkSvg = NULL);
void setBackground(std::shared_ptr<Svg> svg);
};




+ 2
- 5
include/helpers.hpp View File

@@ -56,13 +56,10 @@ TWidget* createWidgetCentered(math::Vec pos) {
return o;
}

inline app::SvgPanel* createPanel(std::string svgPath, std::string darkSvgPath = "") {
inline app::SvgPanel* createPanel(std::string svgPath) {
app::SvgPanel* panel = new app::SvgPanel;
std::shared_ptr<Svg> svg = APP->window->loadSvg(svgPath);
std::shared_ptr<Svg> darkSvg;
if (darkSvgPath != "")
darkSvg = APP->window->loadSvg(darkSvgPath);
panel->setBackground(svg, darkSvg);
panel->setBackground(svg);
return panel;
}



+ 0
- 4
include/settings.hpp View File

@@ -42,7 +42,6 @@ extern int threadCount;
extern bool paramTooltip;
extern bool cpuMeter;
extern bool lockModules;
extern bool darkMode;
extern int frameSwapInterval;
extern float autosavePeriod;
extern bool skipLoadOnLaunch;
@@ -57,9 +56,6 @@ void fromJson(json_t* rootJ);
void save(const std::string& path);
void load(const std::string& path);

// Getters, for ensuring API/ABI compatibility for plugins
bool isDarkMode();


} // namespace settings
} // namespace rack

+ 0
- 11
src/app/MenuBar.cpp View File

@@ -384,12 +384,6 @@ struct LockModulesItem : ui::MenuItem {
}
};

struct DarkModeItem : ui::MenuItem {
void onAction(const event::Action& e) override {
settings::darkMode ^= true;
}
};

struct FrameRateValueItem : ui::MenuItem {
int frameSwapInterval;
void onAction(const event::Action& e) override {
@@ -458,11 +452,6 @@ struct ViewButton : MenuButton {
cableTensionSlider->box.size.x = 200.0;
menu->addChild(cableTensionSlider);

DarkModeItem* darkModeItem = new DarkModeItem;
darkModeItem->text = "Dark mode";
darkModeItem->rightText = CHECKMARK(settings::darkMode);
menu->addChild(darkModeItem);

FrameRateItem* frameRateItem = new FrameRateItem;
frameRateItem->text = "Frame rate";
frameRateItem->rightText = RIGHT_ARROW;


+ 1
- 10
src/app/SvgPanel.cpp View File

@@ -34,20 +34,11 @@ void SvgPanel::step() {
fb->oversample = 2.0;
}

std::shared_ptr<Svg> svg = this->svg;
if (settings::isDarkMode() && this->darkSvg)
svg = this->darkSvg;
if (sw->svg != svg) {
sw->setSvg(svg);
fb->dirty = true;
}

Widget::step();
}

void SvgPanel::setBackground(std::shared_ptr<Svg> svg, std::shared_ptr<Svg> darkSvg) {
void SvgPanel::setBackground(std::shared_ptr<Svg> svg) {
this->svg = svg;
this->darkSvg = darkSvg;

sw->setSvg(svg);
fb->box.size = sw->box.size.div(RACK_GRID_SIZE).round().mult(RACK_GRID_SIZE);


+ 0
- 12
src/settings.cpp View File

@@ -30,7 +30,6 @@ int threadCount = 1;
bool paramTooltip = true;
bool cpuMeter = false;
bool lockModules = false;
bool darkMode = false;
#if defined ARCH_MAC
// Most Mac GPUs can't handle rendering the screen every frame, so use ~30 Hz by default.
int frameSwapInterval = 2;
@@ -87,8 +86,6 @@ json_t* toJson() {

json_object_set_new(rootJ, "lockModules", json_boolean(lockModules));

json_object_set_new(rootJ, "darkMode", json_boolean(darkMode));

json_object_set_new(rootJ, "frameSwapInterval", json_integer(frameSwapInterval));

json_object_set_new(rootJ, "autosavePeriod", json_real(autosavePeriod));
@@ -191,10 +188,6 @@ void fromJson(json_t* rootJ) {
if (lockModulesJ)
lockModules = json_boolean_value(lockModulesJ);

json_t* darkModeJ = json_object_get(rootJ, "darkMode");
if (darkModeJ)
darkMode = json_boolean_value(darkModeJ);

json_t* frameSwapIntervalJ = json_object_get(rootJ, "frameSwapInterval");
if (frameSwapIntervalJ)
frameSwapInterval = json_integer_value(frameSwapIntervalJ);
@@ -286,10 +279,5 @@ void load(const std::string& path) {
}


bool isDarkMode() {
return darkMode;
}


} // namespace settings
} // namespace rack

Loading…
Cancel
Save