Giter Site home page Giter Site logo

Comments (7)

weisJ avatar weisJ commented on September 28, 2024 1

With the next version you'll be able so set the properties through LafManager.setProperty("borderThickness", "1") and it will be applied to all themes (you have to set it before LafManager.install()). Properties can be also be cleared and removed.

from darklaf.

weisJ avatar weisJ commented on September 28, 2024

At the moment the easiest option is to overwrite the value in Theme#loadDefaults. I‘ll think about how to go about setting the values without a custom theme.

The name %borderThickness may also be a bit misleading as borders in fact are always painted with a line width of 1 and this value actually controls the thickness of the focus border.

from darklaf.

FoxyBOA avatar FoxyBOA commented on September 28, 2024

At the moment the easiest option is to overwrite the value in Theme#loadDefaults

Not sure that I've got your idea. You propose to subclass a theme, but that code doesn't call Theme#loadDefaults. What I'm missing?

        LafManager.install();
        LafManager.setTheme(new MyTheme());
...
public class MyTheme extends IntelliJTheme{

    @Override
    public void loadDefaults(Properties pProperties, UIDefaults pCurrentDefaults) {
        super.loadDefaults(pProperties, pCurrentDefaults);
        
        System.out.println("%borderThickness="+pProperties.get("%borderThickness"));
    }

}

The name %borderThickness may also be a bit misleading as borders in fact are always painted with a line width of 1 and this value actually controls the thickness of the focus border.

I would like to adjust insets around controls (e.g. I've +2px from each size around JTextField and that leads to additional scrolls etc.).

from darklaf.

weisJ avatar weisJ commented on September 28, 2024

Setting the theme just changes it for all subsequent installs. You need to pass the theme directly to LafManager#install or set it before.

The % is only present in the .properties files to indicate that this value can be referenced in other files. The actual key is just named borderThickness

from darklaf.

FoxyBOA avatar FoxyBOA commented on September 28, 2024

The code

LafManager.install(new MyTheme());
...
public class MyTheme extends IntelliJTheme{}

Edited:
The same as code

LafManager.setTheme(new MyTheme());
UIManager.setLookAndFeel(DarkLaf.class.getCanonicalName());

Leads to the following exception

�[34m[2020-03-06 10:33:18]�[33m [SEVERE]�[31m Could not load intellij/intellij_defaults.properties.properties. null�[37m�[01m [at com.github.weisj.darklaf.theme.Theme]�[2m
                     �[33m[Details] �[31mjava.util.Properties$LineReader.readLine(Properties.java:434),
                               java.util.Properties.load0(Properties.java:353),
                               java.util.Properties.load(Properties.java:341),
                               com.github.weisj.darklaf.theme.Theme.load(Theme.java:189),
                               com.github.weisj.darklaf.theme.Theme.loadDefaults(Theme.java:80),
                               com.package.MyTheme.loadDefaults(MyTheme.java:13),
                               com.github.weisj.darklaf.DarkLaf.loadThemeDefaults(DarkLaf.java:208),
                               com.github.weisj.darklaf.DarkLaf.getDefaults(DarkLaf.java:112),
                               javax.swing.UIManager.setLookAndFeel(UIManager.java:539),
                               javax.swing.UIManager.setLookAndFeel(UIManager.java:583),
                               com.github.weisj.darklaf.LafManager.install(LafManager.java:169),
                               com.github.weisj.darklaf.LafManager.installTheme(LafManager.java:138),
                               com.github.weisj.darklaf.LafManager.install(LafManager.java:159),
                               com.package.Foo.main(Foo.java:268)�[0m


from darklaf.

weisJ avatar weisJ commented on September 28, 2024

please overwrite Theme#getLoaderClass to return IntelliJTheme.class, this should fix it for now.

from darklaf.

FoxyBOA avatar FoxyBOA commented on September 28, 2024

Works. Thank you

from darklaf.

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.