Home Download Buy Blog Forum Support

Sidebar icons in themes

Re: Sidebar icons in themes

Postby facelessuser on Mon May 05, 2014 5:13 pm

Okay, this actually worked:

create a file Icon (Python).tmPreferences

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>scope</key>
    <string>source.python</string>
    <key>settings</key>
    <dict>
        <key>icon</key>
        <string>file_type_python</string>
    </dict>
</dict>
</plist>


So a theme doesn't have to override the defaults. You can probably just create a bunch of your own and use those instead.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm

Re: Sidebar icons in themes

Postby jbrooksuk on Mon May 05, 2014 5:26 pm

I wonder if a plugin dynamically change these based on if the file is dirty or not?
jbrooksuk
 
Posts: 763
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Sidebar icons in themes

Postby facelessuser on Mon May 05, 2014 5:30 pm

Maybe if you physically control the tmPreference file and overwrite the original. I have found that I can create new file types, but I can't override text, source, or markup. I can change the theme icon, but not alter the tmPreference files for the defaults.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm

Re: Sidebar icons in themes

Postby MKANET on Mon May 05, 2014 9:46 pm

Does anyone have dark-theme compatible filetype icons they can share by chance? Also, if someone has the respective settings file they use to use the new light-color file-type icons they could also share that would be great.
MKANET
 
Posts: 56
Joined: Fri Aug 30, 2013 5:06 pm

Re: Sidebar icons in themes

Postby facelessuser on Mon May 05, 2014 11:15 pm

I use this for now: https://github.com/facelessuser/Unnamed ... ster/icons. I just colored the insides. I plan on redoing them for my personal use, but this is good enough for now. Didn't style the spinners lighter, but I don't actually ever see them now that I have the proper icons in my theme.
facelessuser
 
Posts: 1565
Joined: Tue Apr 05, 2011 7:38 pm

Re: Sidebar icons in themes

Postby weslly on Tue May 06, 2014 12:23 am

It looks amazing after replacing the default icons:

Image
weslly
 
Posts: 202
Joined: Sun Aug 28, 2011 3:57 am
Location: Brazil

Re: Sidebar icons in themes

Postby jps on Tue May 06, 2014 4:11 am

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.
jps
Site Admin
 
Posts: 3066
Joined: Wed Mar 19, 2008 12:33 pm

Re: Sidebar icons in themes

Postby gregor.hoch on Tue May 06, 2014 6:29 am

jps, this looks great, thanks for the update! Is there any way to change the icons from the Python API? That would be really nice for example to color files and folders based on git status (e.g. Green icon for a new file).
gregor.hoch
 
Posts: 144
Joined: Sat Oct 01, 2011 7:54 pm

Re: Sidebar icons in themes

Postby jps on Tue May 06, 2014 7:31 am

Unfortunately there's no API to control sidebar icons etc as of 3062
jps
Site Admin
 
Posts: 3066
Joined: Wed Mar 19, 2008 12:33 pm

Re: Sidebar icons in themes

Postby gregor.hoch on Tue May 06, 2014 10:20 am

Still great... :)
Maybe someday. This coloring would work best with svg icons that can be dynamically styled but that might be a whole different thing.
gregor.hoch
 
Posts: 144
Joined: Sat Oct 01, 2011 7:54 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: Astrophizz, Google [Bot], lukasbob and 28 guests