The master and develop branches track hengband.
OS X development happens on the macos-1-6-2, macos-2-2-1, and macos-develop branches.
Revision | aedcfe2fa539be422189618d1df0963a977a23ed (tree) |
---|---|
Time | 2020-02-29 07:19:57 |
Author | Eric Branlund <ebranlund@fast...> |
Commiter | Eric Branlund |
Per hengbandforosx ticket 40203, include the dimensions, as rows and columns, in the title bars for the terminal windows.
@@ -1085,9 +1085,12 @@ struct PendingCellChange { | ||
1085 | 1085 | */ |
1086 | 1086 | + (void)setDefaultFont:(NSFont*)font; |
1087 | 1087 | |
1088 | -/* Internal method */ | |
1088 | +/* Internal methods */ | |
1089 | 1089 | - (AngbandView *)activeView; |
1090 | 1090 | |
1091 | +/* Set the title for the primary window. */ | |
1092 | +- (void)setDefaultTitle:(int)termIdx; | |
1093 | + | |
1091 | 1094 | @end |
1092 | 1095 | |
1093 | 1096 | /** |
@@ -1952,6 +1955,20 @@ static __strong NSFont* gDefaultFont = nil; | ||
1952 | 1955 | return result; |
1953 | 1956 | } |
1954 | 1957 | |
1958 | +- (void)setDefaultTitle:(int)termIdx | |
1959 | +{ | |
1960 | + NSMutableString *title = | |
1961 | + [NSMutableString stringWithCString:angband_term_name[termIdx] | |
1962 | +#ifdef JP | |
1963 | + encoding:NSJapaneseEUCStringEncoding | |
1964 | +#else | |
1965 | + encoding:NSMacOSRomanStringEncoding | |
1966 | +#endif | |
1967 | + ]; | |
1968 | + [title appendFormat:@" %dx%d", self.cols, self.rows]; | |
1969 | + [[self makePrimaryWindow] setTitle:title]; | |
1970 | +} | |
1971 | + | |
1955 | 1972 | - (void)angbandViewDidScale:(AngbandView *)view |
1956 | 1973 | { |
1957 | 1974 | /* If we're live-resizing with graphics, we're using the live resize |
@@ -2112,9 +2129,11 @@ static __strong NSFont* gDefaultFont = nil; | ||
2112 | 2129 | self->_rows = newRows; |
2113 | 2130 | [self.changes resize:self.cols rows:self.rows]; |
2114 | 2131 | |
2132 | + int termIndex = [self terminalIndex]; | |
2133 | + [self setDefaultTitle:termIndex]; | |
2134 | + | |
2115 | 2135 | if( saveToDefaults ) |
2116 | 2136 | { |
2117 | - int termIndex = [self terminalIndex]; | |
2118 | 2137 | NSArray *terminals = [[NSUserDefaults standardUserDefaults] valueForKey: AngbandTerminalsDefaultsKey]; |
2119 | 2138 | |
2120 | 2139 | if( termIndex < (int)[terminals count] ) |
@@ -2492,15 +2511,7 @@ static void Term_init_cocoa(term *t) | ||
2492 | 2511 | NSWindow *window = [context makePrimaryWindow]; |
2493 | 2512 | |
2494 | 2513 | /* Set its title and, for auxiliary terms, tentative size */ |
2495 | - NSString *title = | |
2496 | - [NSString stringWithCString:angband_term_name[termIdx] | |
2497 | -#ifdef JP | |
2498 | - encoding:NSJapaneseEUCStringEncoding | |
2499 | -#else | |
2500 | - encoding:NSMacOSRomanStringEncoding | |
2501 | -#endif | |
2502 | - ]; | |
2503 | - [window setTitle:title]; | |
2514 | + [context setDefaultTitle:termIdx]; | |
2504 | 2515 | [context setMinimumWindowSize:termIdx]; |
2505 | 2516 | |
2506 | 2517 | /* |