Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4758 from toggl-open-source/fix/total-today-tooltip
Browse files Browse the repository at this point in the history
Fix activity menu tooltip about total time (mac)
  • Loading branch information
skel35 authored Dec 16, 2020
2 parents 735db97 + 6193197 commit bc2387a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/ui/osx/TogglDesktop/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ @implementation AppDelegate

void *ctx;

static NSString *statusItemDefaultTooltip = @"Total today: 0h 0min";

- (void)applicationWillFinishLaunching:(NSNotification *)not
{
Expand Down Expand Up @@ -819,8 +820,10 @@ - (void)updateStatusItem
free(str);
}

// Update tooltip
[self.statusItem setToolTip:[NSString stringWithFormat:@"Total today: %@", self.lastKnownRunningTimeEntry.dateDuration]];
// Update tooltip if was not set before
if ([self.statusItem.toolTip isEqualToString:statusItemDefaultTooltip]) {
[self.statusItem setToolTip:[NSString stringWithFormat:@"Total today: %@", self.lastKnownRunningTimeEntry.dateDuration]];
}
}

NSString *key = nil;
Expand Down Expand Up @@ -1554,7 +1557,7 @@ void on_time_entry_list(const bool_t open,
TogglTimeEntryView *first,
const bool_t show_load_more)
{
NSString *todayTotal = @"Total today: 0h 0min";
NSString *todayTotal = statusItemDefaultTooltip;
NSMutableArray *viewitems = [[NSMutableArray alloc] init];
TogglTimeEntryView *it = first;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
69FC180217E6534400B96425 /* TogglDesktop-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TogglDesktop-Prefix.pch"; sourceTree = "<group>"; };
69FC180417E6534400B96425 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
69FC180617E6534400B96425 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
69FC180717E6534400B96425 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
69FC180717E6534400B96425 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; usesTabs = 1; };
69FC181217E6534500B96425 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
74033C8D17EC1CFD00CA53D3 /* libstdc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.dylib"; path = "usr/lib/libstdc++.dylib"; sourceTree = SDKROOT; };
74033C9617EC1DE100CA53D3 /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; };
Expand Down

0 comments on commit bc2387a

Please sign in to comment.