Developer: NSButton drawing issue

A post for developers, though also related to Time Out 2.

One of the features of Time Out 2 is a sidebar listing the breaks and options, as you could see (blurred somewhat) in my previous post . The sidebar includes a couple of buttons that appear when you hover the pointer over a row, enabling you to manually start or pause that break.

A vexing issue I had, though, was that the button didn't draw correctly. If you look closely at this screenshot, you may notice that the background of the text and the remainder of the button content don't match — there's a visible outline around the text:

That is rather ugly. I'm not sure exactly what causes it, but presumably it's related to being in a sidebar list, and perhaps an issue with title-less windows (I've seen some other issues, too).

Regardless, I wanted to fix it. After a bit of experimentation, I found a simple solution: a subclass of NSButtonCell to override the -drawTitle:withFrameinView: method, which as you might imagine is responsible for drawing the title text. The override simply invokes the superclass, and returns the full button rect instead of the rect of the text itself:

@interface DejalButtonCell : NSButtonCell


@implementation DejalButtonCell

- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView;
    [super drawTitle:title withFrame:frame inView:controlView];
    return frame;


That seems to do the trick:

Filed Radar #22491410.

Time Out 2 teaser

As you may know, I'm working on a major upgrade of my popular break reminder tool, Time Out. Version 2 has been in the works for quite some time, in between working on contract work and updates of Simon, Pack, and other apps.

I've recently made some significant progress, and although there remains much to do, I think it's time to start teasing a little about the new version.

So without further ado, I present your first glimpse of the app (other than the icon, which I showed previously). A heavily blurred screenshot, admittedly... but you may be able to glean something about it.

Want to see more? How about actually try the current version? No need to wait: licensed users can apply to become alpha testers, and actually use the latest builds now (version 2.0a13 was released a few days ago). If you've made a donation, and are using Yosemite or later, you can contact me to request to join the alpha team, or to get more information.

Otherwise, stay tuned for more screenshots and information about the upgrade over the coming months. (Yes, I fully expect it'll be a few months before it's finished, though who knows; it'll be done when it's done.)

Time Out 2 icon

Yes, the rumors are true... Time Out 2 is coming! This major upgrade has been much delayed, redesigned, partial implementations discarded and restarted, and delayed again... but it is well underway now, and is in fact in private alpha testing at present.

What does it include? The major enhancements are not coincidentally the most requested changes: the ability to run Time Out without it being in the Dock, a countdown status menu, and customizable break themes. There are many other improvements, too.

Don't get too excited just yet, though, as it'll probably be another few months before it is available as a public beta. Although version 2 is fully functional now, I've still got lots I want to add and polish, including support for more than two breaks, more kinds of notifications, and an overhaul of the UI.

One other big change is the app icon. The icon for version 1 is nice enough, and many people like it, but others are put off by the meditating figure. So I've taken the opportunity of version 2 to have a fresh new icon professionally designed... and here it is:

I hope you like it, and agree that it's a huge improvement. The theme is relaxation — take a break. A hammock under palm trees seems pretty relaxing to me. And from a certain perspective, it looks a little like a smiley face. Hopefully taking rest breaks will make you smile, too.

This great icon was designed by Aaron Mahnke of Wet Frog Studios. It was a pleasure working with such a professional and skilled designer. He was easy to work with, clearly understanding my ideas and quickly created a draft design that was very close to what we ended up with. He was also responsive to my suggestions for tweaks, so it only took a few iterations before we had the final design.

So, when will version 2 be available publicly? I don't know. It'll be done when it's done. But I will post more about it over the coming weeks, so you can get a feel for the enhancements.

Can't wait? Want to try the current alpha releases? I always welcome fresh perspectives, so you could be eligible to join the elite alpha group. It is only open to licensed users, so if you've made a donation, and you're using Mavericks, you can contact me to request to join the alpha team, or to get more information.

Syndicate content