-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated look & feel #19
Conversation
Images are loaded only once at startup and cached.
Images are loaded only once at startup and cached.
…ining Conflicts: Battery Time Remaining/AppDelegate.m
Sorry for the confusion about the commits after the pull request. I had forgotten to change the limit value for drawing a red capacity bar back to 15% from my debugging value. |
There is some points I would like to say.
aside from that it was good improvements you made |
First of all, thanks a lot for the quick review and kind comments!
That was the way Apple's pre-ML battery gauge did it. I also felt that the parentheses helped me
Good point. In Apple's pre-ML gauge it would display the "not charging" for the couple of seconds
Hm. With the (...) Images you mark as template images should consist of only black and clear colors. You can But maybe it's a consequence of how I compose the image. I'll look for a way of having a red
Thanks for the pointer! I'll check this out. |
I agree that parenthesis in pre-ML might be to distinguish battery time and clock time, but I don't think it is needed in our case, because you can distinguish by:
I want to try keep the app as simple as possible for users. What is FSM? oh, I didn't notice setTemplate would make the red color grey. Thanks for pointing it out! this is a bug in 1.5.1 then. |
Added setting for switching parentheses around time remaining on and off. Moved all settings (incl. "advanced") to a submenu. Added German and French localizations for new menu items. TODO: Swedish and Dutch localizations missing.
Ok, I believe to have implemented all of your comments (for which thanks), except the
Agreed. I made it a configurable option, and the default is "off".
Finite state machine. See here. This is used to model the behaviour of the system. E.g. when you connect the charger, it goes from "charging" to "not charging" (the electronics takes a few seconds to switch power and start charging the battery), and then to "charging".
Hm, not sure whether it's a bug for your repo. I changed the way the capacity bar is drawn, which may well affect the colour rendering. I will need to dig more to understand why this happens with |
It looks good now :) Just one thing. I get this in my log when I compile
|
Glad you like it. ;-))
I get the same message when I run it. But not always. I have googled for the error message both on the Interwebs, and the Apple developer forums. There are some others who have seen the same message in various contexts. It seems that on most occasions, the issue is linked to legacy code using It seems that when I start/stop our app very often in a short time, the message is more likely to occur. After the message has shown up, if you inspect the graphics, you will find that there are rendering errors (e.g. a red segment used at the end of the capacity bar instead of a black one). Also if I wait a few minutes, the hit "Run" again, without touching anything else, it just works without the message. So I suspect that it is rather an issue with the environment where our status bar item is hosted. And that we can do very little about it. I guess for As for |
I c, ye I also only get that msg sometimes which makes it harder to debug. I notice that the native battery icon don't have drop shadow when it shows the red color. What do this line do? Is it necessary?
I tested to remove that line and everything seem to still work. |
I found out why we got "_NSWarnForDrawingImageWithNoCurrentContext" in the log. It has to do with this code
When capBarLength is shorter than batteryLevelLeft+batteryLevelRight together it will leave no room to render batteryLevelMiddle, thats why we got the output in log. So it wasn't random when the output came, It only came when we had low battery percent left :P Ill fix this tomorrow. |
I refactor your code :P 9102c77 |
|
Updated look & feel
Visible changes:
Under the hood: