在 Eclipse Oxygen 中更改项目资源管理器树视图字体大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47731327/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change Project Explorer tree view font size in Eclipse Oxygen
提问by ArifMustafa
I am using Eclipse Version: Oxygen.1a Release (4.7.1a) and I want to enlarge the Project Explorer tree view font size because I have some sight issues and thus I searched many places to enlarge the project tree view font size.
我正在使用 Eclipse 版本:Oxygen.1a Release (4.7.1a),我想放大 Project Explorer 树视图字体大小,因为我有一些视力问题,因此我搜索了很多地方来放大项目树视图字体大小。
I only founded the font change in project explorer tree view for older eclipse versions releases which are older or equal to eclipse luna version.
我只在项目资源管理器树视图中为较旧或等于 eclipse luna 版本的旧 eclipse 版本创建字体更改。
for the information I would like to say that this Oxygen version release is latest in Eclipse IDE, please somebody help me.
对于信息,我想说这个 Oxygen 版本是 Eclipse IDE 中的最新版本,请有人帮助我。
回答by ArifMustafa
I assume that it is important for others also, so I am posting this, for below requireds in eclipse ide,
我认为这对其他人也很重要,所以我发布了这个,以满足 eclipse ide 中的以下要求,
Increase java editor font size
增加java编辑器字体大小
Window Menu -> Preferences -> General > Appearance > Color and Fonts > Java > Java Editor Text Font > Edit & Apply
Increase console output font size
增加控制台输出字体大小
Window Menu -> Preferences -> General > Appearance > Color and Fonts > Debug > Console font > Edit & Apply
Increase xml bean file font size
增加xml bean文件字体大小
Window Menu -> Preferences -> General > Appearance > Color and Fonts > Basic > Text Font > Edit & Apply
Increase dialog view font size
增加对话框视图字体大小
Window Menu -> Preferences -> General > Appearance > Color and Fonts > Basic > Dialog Font > Edit & Apply
Increase project explorer tree view font size
增加项目资源管理器树视图字体大小
If using Windows 7 or higher architecture, then reach to the eclipse home directory,
go inside of eclipse\plugins\org.eclipse.ui.themes_X.X.X.vXXXXXXXX-XXXX\css
directory,
find two css files which are "e4_default_gtk.css"
and "e4_default_win.css"
,
open and add below said css script part in tail of above two files, save those and close accordingly,
如果使用 Windows 7 或更高版本的架构,则进入 eclipse 主目录,进入eclipse\plugins\org.eclipse.ui.themes_X.X.X.vXXXXXXXX-XXXX\css
目录,找到两个 css 文件,它们是"e4_default_gtk.css"
和"e4_default_win.css"
,打开并在上述两个文件的尾部添加下面所述的 css 脚本部分,保存它们并相应地关闭,
.MPart Tree {
font-family: Consolas;
font-size: 14;
}
if eclipse is opened, restart, it all worked for me on eclipse oxygen.1a release version,
如果 eclipse 被打开,重新启动,它在 eclipseoxy.1a 发布版本上对我来说都有效,
and hope on other OS type, you have to edit the same e4_default_gtk.css
and other e4_default_os-type.css
, thanks.
并希望在其他操作系统类型上,您必须编辑相同的e4_default_gtk.css
和其他的e4_default_os-type.css
,谢谢。
回答by Al Breight
I'm using eclipse-neon on Ubuntu on Windows-10. The graphical interface is not supported by Microsoft at this time, but I have been using Eclipse Neon and it works decently enough. I added the following to the end of one file: eclipse/plugins/org.eclipse.ui.themes_1.1.300.v20161107-1827/css/e4_default_gtk.css:
我在 Windows-10 上的 Ubuntu 上使用 eclipse-neon。Microsoft 目前不支持图形界面,但我一直在使用 Eclipse Neon,它运行良好。我在一个文件的末尾添加了以下内容:eclipse/plugins/org.eclipse.ui.themes_1.1.300.v20161107-1827/css/e4_default_gtk.css:
.MPart Tree {
font-family: Sans Regular;
font-size: 8;
}
My intent was to make the font smaller, and it worked successfully.
我的意图是使字体更小,并且它成功地工作。
回答by afulz29
I have been searching this for every version of Eclipse and finally I got something which helped me to increase the font size and font type of of the project explorer.
我一直在为 Eclipse 的每个版本搜索这个,最后我得到了一些帮助我增加项目浏览器的字体大小和字体类型的东西。
1.go to below path on your local environment
1.转到您本地环境中的以下路径
.p2 -> pool -> plugins -> org.eclipse.ui.themes_(version) -> css -> e4_basestyle
.p2 -> 池 -> 插件 -> org.eclipse.ui.themes_(version) -> css -> e4_basestyle
2.paste below lines at the end of the file.
2.在文件末尾粘贴以下几行。
Tree {
font-size: 14px; /* <-- Desired font size */
font: Consolas; /* <-- Font you want to have */
}
- Restart the eclipse
- You will get the new defined size and font in your project explorer of eclipse.
- 重启日食
- 您将在 eclipse 的项目资源管理器中获得新定义的大小和字体。
NOTE : I tried this on latest version of the eclipse on windows 10 and it worked for me. I did not tried on the previous version.
注意:我在 windows 10 上最新版本的 eclipse 上尝试了这个,它对我有用。我没有尝试过以前的版本。
回答by Cristiano
In my case using a MacBook 13", I had to edit the following file /Users/myuser/.p2/pool/plugins/org.eclipse.ui.themes_1.2.800.v20191030-0746/css/e4-dark_mac1013.css
在我使用 MacBook 13" 的情况下,我必须编辑以下文件 /Users/myuser/.p2/pool/plugins/org.eclipse.ui.themes_1.2.800.v20191030-0746/css/e4-dark_mac1013.css
Then I searched for this existing item and added the font-size
and font-size-adjust
. Doing that prevents the tree line to be cropped:
然后我搜索了这个现有的项目并添加了font-size
和font-size-adjust
。这样做可以防止树线被裁剪:
CTabFolder Tree, CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
font-size-adjust: none;
font-size: 14px;
}
回答by villaa19
Thanks for the help. In my case, I use the Dark [Mac OS X] theme in Eclipse Photon on Windows 7, so the file I had to alter was e4-dark_mac.css
in eclipse\plugins\org.eclipse.ui.themes_X.X.X.vXXXXXXXX-XXXX\css
. Also the .MPart Tree
was not in the file so I had to add it as opposed to editing it. I added right under another .Mpart
entry so my file looked like below.
谢谢您的帮助。就我而言,我在 Windows 7 上的 Eclipse Photon 中使用 Dark [Mac OS X] 主题,因此我必须更改的文件e4-dark_mac.css
位于 eclipse\plugins\org.eclipse.ui.themes_X.X.X.vXXXXXXXX-XXXX\css
. 也.MPart Tree
没有在文件中,所以我不得不添加它而不是编辑它。我在另一个.Mpart
条目下添加了,所以我的文件如下所示。
...
.MpartStack, .Mpart {
font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
}
.Mpart Tree {
font-size: 12;
}
...
回答by Andres
Answer from Al Breightworked perfectly on Oxygen.3a Release (4.7.3a), Ubuntu 18.04. @pkeller comment (Oct 16 at 14:05) confirmed and solved editing 'Git Uncommited Change Font' size option in Window->Preferences->General->Appearance->Colors and Fonts:
Al Breight 的回答在 Oxygen.3a 版本 (4.7.3a)、Ubuntu 18.04 上完美运行。@pkeller 评论(10 月 16 日 14:05)确认并解决了在Window->Preferences->General->Appearance->Colors and Fonts 中编辑“Git Uncommited Change Font”大小选项的问题:
回答by Daehyun Jo
I'm using Eclipse 2018-09 and could't found .css file similar gtk at Eclipe directory.
But I discover custom css menu on Jeeyul's theme(plugin for Eclipse Color UI).
Just typing css style above comments. And apply and close.
In the end, change UI style.
我正在使用 Eclipse 2018-09,但在 Eclipe 目录中找不到类似于 gtk 的 .css 文件。
但是我在 Jeeyul 的主题(Eclipse Color UI 插件)上发现了自定义 css 菜单。
只需在评论上方输入 css 样式即可。并申请并关闭。
最后,更改 UI 样式。
回答by Michael Robinson
Thanks so much! I can finally see the Eclipse Project Explorer clearly! I was able to change the project explorer tree font size by making the css file addition shown above in Windows 7 with Eclipse 2018-9 (4.9.0).
非常感谢!终于可以看清Eclipse Project Explorer了!通过在带有 Eclipse 2018-9 (4.9.0) 的 Windows 7 中添加上面显示的 css 文件,我能够更改项目资源管理器树的字体大小。
The specific folder location I found was at:
我找到的具体文件夹位置是:
C:\Users\myUserName\.p2\pool\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css
Apparently, from my investigation of solving this problem the specific folder location varies based on different factors like Eclipse Version and OS.
So I searched on the css file names to find the latest folder.
显然,根据我对解决此问题的调查,具体文件夹位置因 Eclipse 版本和操作系统等不同因素而异。
所以我搜索了 css 文件名以找到最新的文件夹。
I had 7 eclipse themes folders on my workstation, I used the most recent one, corresponding to the specific install/update of Eclipse being currently used.
我的工作站上有 7 个 eclipse 主题文件夹,我使用了最新的一个,对应于当前使用的 Eclipse 的特定安装/更新。
回答by murtiko
Ankit Fulzele's answerhelped me with minor adjustments.
Ankit Fulzele 的回答帮助我进行了细微的调整。
I use Dark Theme on Mac and the following worked for me for Eclipse 2019-06:
我在 Mac 上使用深色主题,以下内容适用于 Eclipse 2019-06:
Add the following lines to ~/.p2/pool/plugins/org.eclipse.ui.themes_{version}/css/dark/e4-dark_basestyle.css
将以下行添加到 ~/.p2/pool/plugins/org.eclipse.ui.themes_{version}/css/ dark/e4-dark_basestyle.css
Tree {
font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
}
Instead of setting a fixed font, this will pin it to whatever the "Preferences -> General -> Appearance -> Colors and Fonts -> View and Editor Folders -> Part title font" is configured to.
这不是设置固定字体,而是将其固定到“首选项 -> 常规 -> 外观 -> 颜色和字体 -> 查看和编辑器文件夹 -> 部件标题字体”配置为的任何内容。
Note: It would make more sense to pin this to another setting, e.g. to "Preferences -> General -> Appearance -> Colors and Fonts -> Basic -> Text Font", but couldn't find the CSS reference for it.
注意:将它固定到另一个设置会更有意义,例如“首选项 -> 常规 -> 外观 -> 颜色和字体 -> 基本 -> 文本字体”,但找不到它的 CSS 参考。
Note: This update will change not only the "Project Explorer" tab, but others as well.
注意:此更新不仅会更改“项目资源管理器”选项卡,还会更改其他选项卡。
回答by Thomas
ECLIPSE FONT CHANGE - Change below to 2 css files.
ECLIPSE 字体更改 - 将下面更改为 2 个 css 文件。
eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css/e4_basesetyle.css eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css/dark/e4-dark_globalstyle.css
eclipse/plugins/org.eclipse.ui.themes_x.xxvxxxxx/css/e4_basesetyle.css eclipse/plugins/org.eclipse.ui.themes_x.xxvxxxxx/css/dark/e4-dark_globalstyle.css
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
font: Consolas; /* <-- Font you want to have */
}
and change preference -> General > Appearance > Colors and Fonts > Basic > Text Font : Consolas 12px
并更改首选项 -> General > Appearance > Colors and Fonts > Basic > Text Font : Consolas 12px