changed formatting
This commit is contained in:
@@ -21,11 +21,9 @@ static void quit_cb(struct tray_menu *item) {
|
||||
|
||||
static struct tray tray = {
|
||||
.icon = "indicator-messages-new",
|
||||
.menu = (struct tray_menu[]){
|
||||
{NULL, "Hello", 0, hello_cb, NULL},
|
||||
.menu = (struct tray_menu[]){{NULL, "Hello", 0, hello_cb, NULL},
|
||||
{NULL, "Quit", 0, quit_cb, NULL},
|
||||
{NULL, NULL, 0, NULL, NULL}
|
||||
},
|
||||
{NULL, NULL, 0, NULL, NULL}},
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
15
tray.h
15
tray.h
@@ -67,9 +67,7 @@ static void tray_update(struct tray *tray) {
|
||||
app_indicator_set_menu(indicator, GTK_MENU(gtk_menu));
|
||||
}
|
||||
|
||||
static void tray_exit() {
|
||||
loop_result = -1;
|
||||
}
|
||||
static void tray_exit() { loop_result = -1; }
|
||||
|
||||
#elif defined(TRAY_APPKIT)
|
||||
|
||||
@@ -85,8 +83,8 @@ static id statusBarButton;
|
||||
@end
|
||||
@implementation Tray
|
||||
- (void)menuCallback:(id)sender {
|
||||
struct tray_menu *m = (struct tray_menu *)
|
||||
[[sender representedObject] pointerValue];
|
||||
struct tray_menu *m =
|
||||
(struct tray_menu *)[[sender representedObject] pointerValue];
|
||||
m->cb(m);
|
||||
}
|
||||
@end
|
||||
@@ -131,8 +129,7 @@ static void tray_update(struct tray *tray) {
|
||||
for (struct tray_menu *m = tray->menu; m != NULL && m->text != NULL; m++) {
|
||||
NSMenuItem *menuItem = [NSMenuItem alloc];
|
||||
[menuItem autorelease];
|
||||
[menuItem
|
||||
initWithTitle: [NSString stringWithUTF8String: m->text]
|
||||
[menuItem initWithTitle:[NSString stringWithUTF8String:m->text]
|
||||
action:@selector(menuCallback:)
|
||||
keyEquivalent:@""];
|
||||
[menuItem setEnabled:YES];
|
||||
@@ -146,9 +143,7 @@ static void tray_update(struct tray *tray) {
|
||||
[statusItem setMenu:menu];
|
||||
}
|
||||
|
||||
static void tray_exit() {
|
||||
[NSApp terminate:NSApp];
|
||||
}
|
||||
static void tray_exit() { [NSApp terminate:NSApp]; }
|
||||
|
||||
#elif defined(TRAY_WINAPI)
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user