Comments (7)
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.
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.
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.
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.
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.
please overwrite Theme#getLoaderClass
to return IntelliJTheme.class
, this should fix it for now.
from darklaf.
Works. Thank you
from darklaf.
Related Issues (20)
- Wiki Demo links not working. HOT 1
- temp files not deleted on Windows HOT 2
- Stackoverflow when setting the border of a spinner editor to an UIResource border
- Advice on how to contribute, Darklaf theme broken in JMeter 5.3, 5.4, 5.5 HOT 4
- JTree has some renderer bug HOT 3
- Event registered on EditorComponent for JComboBox will be cleared when new theme applied. HOT 3
- On a windows 10 computer,cannot open filechooser HOT 2
- JTabFrame custom PanelPopup buttons disappear after changing LaF settings HOT 1
- [Feature Request] JTabFrame disallow changing Alignment of the tabs.
- Buttons are "raised" in latest.integration (compared to 3.0.2)
- Can't build project on mac m1, 13.12.1 HOT 1
- Replace UIDefaultsWithResourceBundleCache with delegation
- [Feature Request] Allow confirm dialog on closing for ClosableTabbedPane without overwriting removeTabAt method
- [Bug] Exception when running on Windows Java 17 HOT 7
- [Bug] Opacity slider of JColorChooser has no effect
- [Feature Request] Apply color pipette with left-mouse click HOT 1
- [Bug] Wrong IconButton positioning in v3.0.3 HOT 2
- Dynamic colors in SVG icons don't work in native macOS menus
- [Feature Request] Frosted / Blurry background window support (Windows Acrylic / macOs: Vibrant) HOT 4
- Strange colors appearing in JColorChooser dialog
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from darklaf.