Giter VIP home page Giter VIP logo

Comments (6)

braitsch avatar braitsch commented on June 30, 2024

Apply the theme after adding all the components to the folder. Individual components (folders, buttons, etc) do not store a reference to any applied themes like a gui does. This may change in the future but for now you'll have to apply the theme after constructing the folder.

from ofxdatgui.

rvega avatar rvega commented on June 30, 2024

Thanks for the reply :)

It still does not work after doing that. Here's my code and a screenshot of the rendered GUI.

  ofxDatGui* gui = new ofxDatGui(ofxDatGuiAnchor::TOP_LEFT);

  ofColor yellow = ofColor::fromHex(0xFFD00B);
  ofxDatGuiFolder* f1 = gui->addFolder("DSP PARAMETERS", yellow);
  f1->addSlider("  Slider", 0, 1);
  f1->addButton("  Button");
  f1->addBreak();
  f1->expand();

  ofColor green = ofColor::fromHex(0x1ED36F);
  ofxDatGuiFolder* f2 = gui->addFolder("TEXT OUTPUT", green);
  f2->addButton("  Copy");
  f2->addButton("  Clear");
  f2->expand();

  gui->setTheme(new AppGuiTheme());

  f1->onButtonEvent(this, &GUI::clickedButton);
  f1->onSliderEvent(this, &GUI::changedSlider);
  f2->onButtonEvent(this, &GUI::clickedButton);
  f2->onSliderEvent(this, &GUI::changedSlider);

All of that is within the setup() method

screenshot-2016-01-17-21 47 47

from ofxdatgui.

braitsch avatar braitsch commented on June 30, 2024

Hi, I just copied and pasted your code into a new project, applied one of the stock themes and this is what I'm seeing.

ofxDatGui* gui = new ofxDatGui(ofxDatGuiAnchor::TOP_LEFT);

ofColor yellow = ofColor::fromHex(0xFFD00B);
ofxDatGuiFolder* f1 = gui->addFolder("DSP PARAMETERS", yellow);
f1->addSlider("  Slider", 0, 1);
f1->addButton("  Button");
f1->addBreak();
f1->expand();

ofColor green = ofColor::fromHex(0x1ED36F);
ofxDatGuiFolder* f2 = gui->addFolder("TEXT OUTPUT", green);
f2->addButton("  Copy");
f2->addButton("  Clear");
f2->expand();

gui->setTheme(new ofxDatGuiThemeCharcoal());

f1->onButtonEvent(this, &ofApp::clickedButton);
f1->onSliderEvent(this, &ofApp::changedSlider);
f2->onButtonEvent(this, &ofApp::clickedButton);
f2->onSliderEvent(this, &ofApp::changedSlider);

screen shot 2016-01-22 at 2 56 27 pm

Are you using the latest on master?

from ofxdatgui.

braitsch avatar braitsch commented on June 30, 2024

Closing as I'm not able to reproduce the issue. Feel free to reopen if you can provide more information.

from ofxdatgui.

rvega avatar rvega commented on June 30, 2024

May I ask which theme you applied? I saw that all of them, except the default one hide the stripe, so the issue would not be visible. Also, note that I'm applying a custom theme.

Maybe this is a feature, not a bug. Let's see: When you are using the default theme, are the elements within a folder supposed to "inherit" the stripe color from the folder? If so, then this is a bug. If not, it's expected behavior.

To reproduce, create and apply a custom theme by inheriting and overriding some properties from the default theme (not the stripe color). The posted example is exactly what I'm describing.

from ofxdatgui.

braitsch avatar braitsch commented on June 30, 2024

Hi, sorry this is a bug. I didn't at first realize what you were describing but I see now what you mean. I just pushed up a patch that should resolve this. 64d7f79 Let me know if this resolves the issue.

from ofxdatgui.

Related Issues (20)

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.