Home Download Buy Blog Forum Support

Set color of status bar from plugin

Set color of status bar from plugin

Postby tomhe on Tue Mar 20, 2012 6:23 am

I want to set the color (background and foreground) of the status bar from a plugin, but I can't find a way to do that. Is it possible?
tomhe
 
Posts: 7
Joined: Sun Mar 18, 2012 6:10 pm

Re: Set color of status bar from plugin

Postby tito on Tue Mar 20, 2012 11:38 am

I believe you can theme the complete application. Not just portions of.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Set color of status bar from plugin

Postby tito on Tue Mar 20, 2012 11:40 am

You may copy your current theme and then change the status bar portion.
Current chrome theme is the value of the preference 'theme', such "theme": "Soda Dark.sublime-theme",
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Set color of status bar from plugin

Postby tomhe on Tue Mar 20, 2012 1:18 pm

I want to control the color from a plugin, so that I can set the status bar to either red or green color depending on the outcome of my executed unit tests.
tomhe
 
Posts: 7
Joined: Sun Mar 18, 2012 6:10 pm

Re: Set color of status bar from plugin

Postby tito on Tue Mar 20, 2012 1:34 pm

You can parse the json of the theme with python, and then set the rgb color of the relevant part, and save it.
I'm not sure if sublime will monitor the file and pick the changes.
Soda theme contains comments about the status bar. Check the source.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Set color of status bar from plugin

Postby facelessuser on Tue Mar 20, 2012 1:49 pm

tito wrote:You can parse the json of the theme with python, and then set the rgb color of the relevant part, and save it.
I'm not sure if sublime will monitor the file and pick the changes.
Soda theme contains comments about the status bar. Check the source.


Yep, this should be doable. You could strip the comments and use the json module which is the easiest, but you will obliterate the comments. Or you could just parse the file with good old regex to find the option as well.

If you are changing the status background and it is a png you can probably just redirect it to a different red or green png.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Set color of status bar from plugin

Postby tomhe on Tue Mar 20, 2012 7:10 pm

Thanks, this looks like it could work.
tomhe
 
Posts: 7
Joined: Sun Mar 18, 2012 6:10 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests