Skip to content

Commit 1f4c3d1

Browse files
committed
Merge branch 'v09' into master2
Conflicts: Material Theme.zip src/main/resources/META-INF/plugin.xml
2 parents 690ea40 + 7f3968f commit 1f4c3d1

File tree

345 files changed

+1122
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+1122
-414
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

3+
## 0.9.4
4+
- Improvements of Lighter Theme. Now Lighter Theme extends IntelliJ Look And Feel instead of Darcula.
5+
- Fix issues with No Material Theme that triggered some NPEs
6+
- Changed Tree foreground color for Lighter Theme
7+
- Added more UI Icons
8+
9+
## 0.9.3
10+
- Fix issue with projects open (https://github.com/mallowigi/material-theme-jetbrains-eap/issues/145)
11+
- Possibly fix issue with 100% CPU (https://github.com/mallowigi/material-theme-jetbrains-eap/issues/143)
12+
- Fix import icon size (https://github.com/mallowigi/material-theme-jetbrains-eap/issues/147)
13+
- Change deprecated color (https://github.com/mallowigi/material-theme-jetbrains-eap/issues/151)
14+
- Improve Disabled Material Theme
15+
16+
## 0.9.2
17+
- Fix issue with File colors for Psi Icons
18+
- Fix issue with CPU 100% usage
19+
- Fix issue with breakpoint icon size
20+
21+
## 0.9.1.2
22+
- Fix issue with tool window icons in retina
23+
- Add more ui icons
24+
25+
## 0.9.1
26+
- Remove uppercase bold tabs as a default and fix issue with project settings persistence
27+
- Revert fix of debugger tab height as it breaks other tabs
28+
29+
## 0.9.0
30+
- Add custom accent color configuration
31+
- Add Uppercase bold tabs to look more like MDTabs
32+
- Add Compact Sidebar height configuration
33+
- Reduce minimal length of tabs to 18
34+
- Add a border to the editor when tabs placement is left or right
35+
- More UI Icons
36+
37+
## 0.8.1
38+
- Fix issue with Contrast action button not working
39+
- Fix issues with not themed popups
40+
- Add accent color to non-themed search bars
41+
- Add background color to search result
42+
343
## 0.8.0.2
444
- Fix issue with custom file statuses not being colorable
545
- Themed Material Combobox Action button

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,17 @@ You can customize some plugin features in a Settings Panel under **Settings** ->
185185

186186
Active Tab Settings:
187187
- *Active Tab Highlight*: Customize active tab indicator color and thickness (works also for the Project View selected row)
188-
- *Bold directories*: Set bold font weight for directories in the Project View
189188
- *Tabs Height*: Set a custom height for tabs (between 25 and 60 pixels)
189+
- *Uppercase Bold Tabs*: Set the Editor Tabs in Bold Upper Case
190190

191191
Panel Settings:
192192
- *Contrast Mode*: Add contrast to some of the IDE's components (currently only the Tabs and Tree)
193193
- *Hide Icons*: Hide file icons (you must have Material Icons options on)
194-
- *Compact Sidebar*: Reduce line height between list items in sidebars
194+
- *Custom Sidebar Height*: Set custom line height in Project View (min: 18, max: 30)
195195
- *Custom Tree Indent*: Increase or reduce indentation in the sidebar (min: 2, max: 8)
196+
- *Bold directories*: Set bold font weight for directories in the Project View
196197
- *Compact Status Bar*: Reduce the height of the status bar (this is the default height)
197-
198-
Custom Accents:
199-
- *X Accent*: Change the accent color. See section above for details about accents.
198+
- *Custom Accent Color*: Set a custom color for accent color
200199

201200
Component Settings:
202201
- *Custom Wallpaper*: Set a custom wallpaper for the "no files opened" page
@@ -264,6 +263,17 @@ Twitter: [@crmag](https://twitter.com/crmag)
264263

265264
**Thanks to [@equinusocio](https://github.com/equinusocio/material-theme) for the inspiration.**
266265

266+
# YourKit
267+
268+
Performance issues are troubleshooted using:
269+
270+
[![YourKit](https://www.yourkit.com/images/yklogo.png)](https://www.yourkit.com/java/profiler/)
271+
272+
YourKit supports open source projects with its full-featured Java Profiler.
273+
YourKit, LLC is the creator of <a href="https://www.yourkit.com/java/profiler/">YourKit Java Profiler</a>
274+
and <a href="https://www.yourkit.com/.net/profiler/">YourKit .NET Profiler</a>,
275+
innovative and intelligent tools for profiling Java and .NET applications.
276+
267277
## Icon Reference
268278

269279
- All file icons have been built using the tools provided by [A File Icon](https://github.com/ihodev/a-file-icon). Great thanks to them!

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ intellij {
8383
pluginName 'Material Theme'
8484
version ideaVersion
8585
type 'IU'
86-
downloadSources Boolean.valueOf(sources)
87-
sameSinceUntilBuild Boolean.valueOf(isEAP)
86+
downloadSources false
87+
sameSinceUntilBuild true
8888
alternativeIdePath idePath
8989
updateSinceUntilBuild = false
9090
plugins = ['com.jetbrains.php:172.3317.83', 'yaml','properties', 'CSS', 'JavaScriptLanguage', 'com.jetbrains.twig:172' +

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Thu Jul 20 19:13:56 IDT 2017
1+
#Wed Aug 30 18:35:42 IDT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME

src/main/java/com/chrisrm/idea/MTConfig.java

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@
5252
public class MTConfig implements PersistentStateComponent<MTConfig> {
5353
public static final String DEFAULT_BG = "https://raw.githubusercontent" +
5454
".com/mallowigi/material-theme-jetbrains-eap/master/src/main/resources/themes/wall.jpg,60";
55+
public static final String ACCENT_COLOR = "80CBC4";
5556
// They are public so they can be serialized
5657
public MTTheme selectedTheme = MTTheme.DEFAULT;
57-
public String highlightColor;
58+
public String highlightColor = ACCENT_COLOR;
5859
public boolean highlightColorEnabled = false;
5960
public Integer highlightThickness;
6061
public boolean isContrastMode = false;
@@ -63,7 +64,7 @@ public class MTConfig implements PersistentStateComponent<MTConfig> {
6364
public boolean isCustomTreeIndentEnabled = false;
6465
public Integer customTreeIndent = 6;
6566

66-
public String accentColor = "80CBC4";
67+
public String accentColor = ACCENT_COLOR;
6768
public String wallpaper = DEFAULT_BG;
6869

6970
public boolean wallpaperSet = true;
@@ -76,9 +77,11 @@ public class MTConfig implements PersistentStateComponent<MTConfig> {
7677
public Integer tabsHeight = 42;
7778
public boolean isMaterialTheme = true;
7879
public boolean themedScrollbars = true;
79-
public boolean isCompactStatusBar;
80+
public boolean isCompactStatusBar = false;
8081

8182
public String defaultBackground;
83+
public boolean upperCaseTabs = false;
84+
public int customSidebarHeight = 18;
8285

8386
public MTConfig() {
8487
final MTTheme theme = this.selectedTheme;
@@ -318,6 +321,10 @@ public String getAccentColor() {
318321
public void setAccentColor(final String accentColor) {
319322
this.accentColor = accentColor;
320323
}
324+
325+
public boolean isAccentColorChanged(final Color customAccentColor) {
326+
return !Objects.equals(this.accentColor, customAccentColor);
327+
}
321328
//endregion
322329

323330
//region Wallpapers
@@ -401,6 +408,18 @@ public void setCompactSidebar(final boolean compactSidebar) {
401408
public boolean isCompactSidebarChanged(final boolean compactSidebar) {
402409
return this.compactSidebar != compactSidebar;
403410
}
411+
412+
public int getCustomSidebarHeight() {
413+
return customSidebarHeight;
414+
}
415+
416+
public boolean customSidebarHeightChanged(final Integer customSidebarHeight) {
417+
return this.customSidebarHeight != customSidebarHeight;
418+
}
419+
420+
public void setCustomSidebarHeight(final Integer customSidebarHeight) {
421+
this.customSidebarHeight = customSidebarHeight;
422+
}
404423
//endregion
405424

406425
//region Statusbar indicator
@@ -471,7 +490,6 @@ public boolean isCustomTreeIndentChanged(final boolean customTreeIndentEnabled)
471490
}
472491
//endregion
473492

474-
475493
//region Themed Scrollbars
476494
public boolean isThemedScrollbars() {
477495
return themedScrollbars;
@@ -504,7 +522,24 @@ public String getDefaultBackground() {
504522
return defaultBackground;
505523
}
506524

507-
public void setDefaultBackground(String defaultBackground) {
525+
public void setDefaultBackground(final String defaultBackground) {
508526
this.defaultBackground = defaultBackground;
509527
}
528+
529+
//region Uppercase tabs
530+
public boolean isUpperCaseTabs() {
531+
return upperCaseTabs;
532+
}
533+
534+
public void setIsUpperCaseTabs(final boolean isUpperCaseTabs) {
535+
this.upperCaseTabs = isUpperCaseTabs;
536+
}
537+
538+
public boolean isUpperCaseTabsChanged(final boolean upperCaseTabs) {
539+
return this.upperCaseTabs != upperCaseTabs;
540+
}
541+
542+
//endregion
543+
544+
510545
}

src/main/java/com/chrisrm/idea/themes/MTLafComponent.java renamed to src/main/java/com/chrisrm/idea/MTLafComponent.java

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
*
2525
*/
2626

27-
package com.chrisrm.idea.themes;
27+
package com.chrisrm.idea;
2828

29-
import com.chrisrm.idea.MTConfig;
3029
import com.chrisrm.idea.config.BeforeConfigNotifier;
3130
import com.chrisrm.idea.config.ConfigNotifier;
3231
import com.chrisrm.idea.config.ui.MTForm;
@@ -45,9 +44,7 @@
4544
import com.intellij.ui.CaptionPanel;
4645
import com.intellij.ui.components.JBPanel;
4746
import com.intellij.util.messages.MessageBusConnection;
48-
import com.intellij.util.ui.ScrollUtil;
4947
import javassist.*;
50-
import javassist.expr.ConstructorCall;
5148
import javassist.expr.ExprEditor;
5249
import javassist.expr.MethodCall;
5350
import org.jetbrains.annotations.NotNull;
@@ -63,7 +60,6 @@ public final class MTLafComponent extends JBPanel implements ApplicationComponen
6360
private boolean willRestartIde = false;
6461

6562
static {
66-
// patchUIUtil();
6763
hackTitleLabel();
6864
hackIdeaActionButton();
6965
}
@@ -87,31 +83,6 @@ public void initComponent() {
8783
connect.subscribe(BeforeConfigNotifier.BEFORE_CONFIG_TOPIC, (this::onBeforeSettingsChanged));
8884
}
8985

90-
public static void patchUIUtil() {
91-
// Hack method
92-
try {
93-
final ClassPool cp = new ClassPool(true);
94-
cp.insertClassPath(new ClassClassPath(ScrollUtil.class));
95-
final CtClass ctClass = cp.get("com.intellij.util.ui.UIUtil");
96-
final CtMethod ctMethod = ctClass.getDeclaredMethod("drawHeader");
97-
ctMethod.instrument(new ExprEditor() {
98-
@Override
99-
public void edit(final ConstructorCall c) throws CannotCompileException {
100-
try {
101-
if (c.getConstructor().getLongName().equals("java.awt.Color")) {
102-
c.replace("{ $_ = javax.swing.UIManager.getColor(\"activeCaption\"); }");
103-
}
104-
} catch (final NotFoundException e) {
105-
e.printStackTrace();
106-
}
107-
}
108-
});
109-
ctClass.writeFile();
110-
} catch (final Exception e) {
111-
e.printStackTrace();
112-
}
113-
}
114-
11586
/**
11687
* For better dialog titles (since I have no idea how to know when dialogs appear, I can't attach events so I'm directly hacking
11788
* the source code). I hate doing this.
@@ -196,6 +167,23 @@ public void edit(final MethodCall m) throws CannotCompileException {
196167
});
197168

198169
ctClass.toClass();
170+
171+
final CtClass comboBoxActionButtonClass = cp.get("com.intellij.openapi.actionSystem.ex.ComboBoxAction$ComboBoxButton");
172+
final CtMethod paint = comboBoxActionButtonClass.getDeclaredMethod("paint");
173+
paint.instrument(new ExprEditor() {
174+
@Override
175+
public void edit(final MethodCall m) throws CannotCompileException {
176+
if (m.getMethodName().equals("drawRoundRect")) {
177+
m.replace("{ $2 = $4; $5 = 0; $6 = 0; $_ = $proceed($$); }");
178+
} else if (m.getMethodName().equals("setPaint") && m.getLineNumber() > 454 && m.getLineNumber() < 460) {
179+
final String color = "javax.swing.UIManager.getColor(\"TextField.selectedSeparatorColor\")";
180+
m.replace("{ $1 = myMouseInside ? " + color + " : com.intellij.ui.Gray._95; $_ = $proceed($$); }");
181+
}
182+
}
183+
});
184+
185+
comboBoxActionButtonClass.toClass();
186+
199187
} catch (final Exception e) {
200188
e.printStackTrace();
201189
}
@@ -257,20 +245,6 @@ private void restartIdeIfNecessary(final MTConfig mtConfig, final MTForm form) {
257245
}
258246
}
259247

260-
/**
261-
* Hack SearchTextField to override SDK's createUI
262-
*/
263-
private static void hackSearchTextField() throws NotFoundException, CannotCompileException {
264-
final ClassPool cp = ClassPool.getDefault();
265-
cp.insertClassPath(new ClassClassPath(MTTextFieldUI.class));
266-
267-
final CtClass darculaClass = cp.get("com.intellij.ide.ui.laf.darcula.ui.DarculaTextFieldUI");
268-
final CtClass componentClass = cp.get("javax.swing.JComponent");
269-
final CtMethod createUI = darculaClass.getDeclaredMethod("createUI", new CtClass[]{componentClass});
270-
createUI.setBody("{ return com.chrisrm.idea.ui.MTTextFieldFactory.newInstance($1); }");
271-
darculaClass.toClass();
272-
}
273-
274248
/**
275249
* Replace Table headers
276250
*/
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2017 Chris Magnussen and Elior Boukhobza
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*
24+
*
25+
*/
26+
27+
package com.chrisrm.idea;
28+
29+
import com.chrisrm.idea.utils.PropertiesParser;
30+
import com.intellij.ide.ui.laf.IntelliJLaf;
31+
import org.jetbrains.annotations.NotNull;
32+
33+
public class MTLightLaf extends IntelliJLaf {
34+
35+
private final MTTheme theme;
36+
37+
public MTLightLaf(@NotNull final MTTheme theme) {
38+
super();
39+
this.theme = theme;
40+
}
41+
42+
/**
43+
* Get Theme Prefix
44+
*/
45+
@Override
46+
protected String getPrefix() {
47+
return theme.getId();
48+
}
49+
50+
/**
51+
* Parse properties value
52+
*
53+
* @param key
54+
* @param value
55+
*/
56+
@Override
57+
protected Object parseValue(final String key, @NotNull final String value) {
58+
return PropertiesParser.parseValue(key, value);
59+
}
60+
}

0 commit comments

Comments
 (0)