Home Download Buy Blog Forum Support

Sidebar icons in themes

Re: Sidebar icons in themes

Postby jbrooksuk on Tue May 06, 2014 12:23 pm

weslly wrote:It looks amazing after replacing the default icons:

Image

Would you mind sharing your icons and the relevant tmPreferences? :)
jbrooksuk
 
Posts: 778
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Sidebar icons in themes

Postby weslly on Tue May 06, 2014 9:23 pm

jbrooksuk wrote:
weslly wrote:It looks amazing after replacing the default icons

Would you mind sharing your icons and the relevant tmPreferences? :)


I didn't even use a .tmPreferences file :D

Create a "Theme - Default" folder in your Packages folder (if you don't have one) and put a folder called "icons" inside it with the new icons:

http://cl.ly/311m1R3o120n

I used the Fugue icons set. I didn't add the retina size icons, but you can find 32x32 versions for some icons on the set.
weslly
 
Posts: 203
Joined: Sun Aug 28, 2011 3:57 am
Location: Brazil

Re: Sidebar icons in themes

Postby jbrooksuk on Wed May 07, 2014 7:47 am

weslly wrote:I used the Fugue icons set. I didn't add the retina size icons, but you can find 32x32 versions for some icons on the set.

I figured it was Fugue and went ahead and made my own version, non-retina too.

Thanks for clarifying!
jbrooksuk
 
Posts: 778
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Sidebar icons in themes

Postby buymeasoda on Wed May 07, 2014 7:56 am

jps wrote:Customising the icons:

1. If you're making a custom theme, place files with the appropriate names (file_type_default.png, file_type_source.png, file_type_text.png, file_type_markup.png, file_type_image.png, file_type_binary.png) either next to the .sublime-theme file, or within an icons/ subdirectory.

2. If you want a custom icon for a particular programming language, then as facelessuser mentioned, you need to create a tmPreferences file that first associates the scope with an icon name (the above example is spot on for Python). You then need to create an actual icon for that name, such as file_type_python.png. The search location for icons is:

<theme directory>/file_type_python.png
<theme directory>/icons/file_type_python.png
<any other directory>file_type_python.png

This means that if you're making a package for a specific programming language, then you can provide a sidebar icon for those files, while still allowing custom themes to override it.

Hi Jon, great work on the icon changes.

I'm a bit stuck with leveraging the new file icon functionality for Soda Theme. Is it possible to allow themes to define the folder where icons are loaded from within the theme context?

With Soda Theme, the light and dark versions of the theme are together, and normally this is fine for assets because their paths are specified in the theme files and kept in separate sub-directories.

With the current implementation for the sidebar icons, the icon files can only exist at the top level theme directory in a single icons folder, or alongside the root level theme files. This means there doesn't appear to be a way to specify folders for different light and dark icons.

Do you have any ideas on how to go about this? As a suggestion, could the theme rule for icon_file_type allow setting the leading path?

For example:

Code: Select all
// Sidebar file icons
{
    "class": "icon_file_type",
    // layer0.texture is filled in by code with the relevant icon name
    "layer0.texture": "Theme - Soda/Soda Light/icons",
    "layer0.opacity": 1.0,
    "content_margin": [8, 8]
},
buymeasoda
 
Posts: 65
Joined: Mon Jul 18, 2011 11:40 pm
Location: Brisbane, Australia

Re: Sidebar icons in themes

Postby valerij_ on Wed May 07, 2014 3:11 pm

Code: Select all
{
    "class": "icon_file_type",
    "attributes": ["plugin-induced-foo"],
    layer0.tint": [49, 52, 55]
}

would make my week (eg with `hg-modified`)
valerij_
 
Posts: 41
Joined: Fri Feb 14, 2014 5:59 pm

Re: Sidebar icons in themes

Postby MKANET on Wed May 07, 2014 3:42 pm

Could someone please post their .sublime-theme file they use in their 'Packages/Theme - Default' folder? Maybe, someone could just package up their entire 'Packages/Theme - Default' folder (including their respective .sublime-theme file), that would be great.
MKANET
 
Posts: 56
Joined: Fri Aug 30, 2013 5:06 pm

Re: Sidebar icons in themes

Postby facelessuser on Wed May 07, 2014 3:57 pm

Jon, another suggestion would be to allow sidebar icons to be specified by extension as well as scope. Scope is fine, but there are a number of file extensions that aren't included by default in tmLanguage files. For this reason, plugins like ApplySyntax have popped up to analyze file extension and set the correct syntax for such files. It is a pain to have to update different tmLanguages to automatically get the correct syntax to open, so defining rules in one place with ApplySyntax, this becomes much less painful. But these file, (files whose syntax is set by an external plugin) don't get the correct icon due to the post processing and setting of the file via an external plugin. Being able to just specify extensions would make this much easier.

For instance. I see you included a binary icon, but currently when a binary view loads, it loads hex data, but the syntax is plain text. Basically, it is impossible to detect binary files with the current system, which I am sure is why no files icons show up as binary. I am pretty sure you plan on using the binary list in the settings file to eventually target binary files, but it would be nice to have a similar functionality for all file type icons.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Sidebar icons in themes

Postby pryley on Wed May 07, 2014 4:55 pm

I like the specified by extension idea!

I've modified the Soda Light theme to support sidebar icons, and also created some custom icons based on Fugue and the Espresso icons.

Normal size:

Image

Retina size:

Image
pryley
 
Posts: 4
Joined: Tue May 06, 2014 7:40 pm

Re: Sidebar icons in themes

Postby aristidesfl on Wed May 07, 2014 5:37 pm

Thank you for the Sublime Theme mod! However my folders are still ugly and I get the spinner until they get expanded:
Image

Ideas?

Does this forum still doesn't support email notifications?
aristidesfl
 
Posts: 54
Joined: Sat Jul 30, 2011 2:41 pm

Re: Sidebar icons in themes

Postby buymeasoda on Wed May 07, 2014 6:07 pm

pryley wrote:I've modified the Soda Light theme to support sidebar icons, and also created some custom icons based on Fugue and the Espresso icons.

Sublime Text has a nice built in way to override theme features, which allows you to easily customise a theme locally but keep the benefit of upstream theme changes. This helps avoid the need to create and maintain a separate theme for tweaks.

For example, to use your own icons instead of the default:

  • Add a folder called "Theme - Default" (or "Theme - Soda" for customising Soda) to your Sublime Text "Packages/User" folder (eg. {sublime text app folder}/Packages/User/Theme - Soda)
  • Add an empty theme file, which is just a plain text file (eg. "Default.sublime-theme" / "Soda Light 3.sublime-theme") to that folder
  • Drop your icons folder in there

When a theme loads, it overrides the base configuration with any additional assets and settings in this folder, so the cascading technique can be used for all aspects of a theme.

More info here: https://github.com/buymeasoda/soda-them ... tomisation

Hope that helps.
buymeasoda
 
Posts: 65
Joined: Mon Jul 18, 2011 11:40 pm
Location: Brisbane, Australia

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: douglascorrea, mcchabby and 29 guests