• R/O
  • HTTP
  • SSH
  • HTTPS

hengbandosx: Commit

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.


Commit MetaInfo

Revisionaedcfe2fa539be422189618d1df0963a977a23ed (tree)
Time2020-02-29 07:19:57
AuthorEric Branlund <ebranlund@fast...>
CommiterEric Branlund

Log Message

Per hengbandforosx ticket 40203, include the dimensions, as rows and columns, in the title bars for the terminal windows.

Change Summary

Incremental Difference

--- a/src/main-cocoa.m
+++ b/src/main-cocoa.m
@@ -1085,9 +1085,12 @@ struct PendingCellChange {
10851085 */
10861086 + (void)setDefaultFont:(NSFont*)font;
10871087
1088-/* Internal method */
1088+/* Internal methods */
10891089 - (AngbandView *)activeView;
10901090
1091+/* Set the title for the primary window. */
1092+- (void)setDefaultTitle:(int)termIdx;
1093+
10911094 @end
10921095
10931096 /**
@@ -1952,6 +1955,20 @@ static __strong NSFont* gDefaultFont = nil;
19521955 return result;
19531956 }
19541957
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+
19551972 - (void)angbandViewDidScale:(AngbandView *)view
19561973 {
19571974 /* If we're live-resizing with graphics, we're using the live resize
@@ -2112,9 +2129,11 @@ static __strong NSFont* gDefaultFont = nil;
21122129 self->_rows = newRows;
21132130 [self.changes resize:self.cols rows:self.rows];
21142131
2132+ int termIndex = [self terminalIndex];
2133+ [self setDefaultTitle:termIndex];
2134+
21152135 if( saveToDefaults )
21162136 {
2117- int termIndex = [self terminalIndex];
21182137 NSArray *terminals = [[NSUserDefaults standardUserDefaults] valueForKey: AngbandTerminalsDefaultsKey];
21192138
21202139 if( termIndex < (int)[terminals count] )
@@ -2492,15 +2511,7 @@ static void Term_init_cocoa(term *t)
24922511 NSWindow *window = [context makePrimaryWindow];
24932512
24942513 /* 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];
25042515 [context setMinimumWindowSize:termIdx];
25052516
25062517 /*
Show on old repository browser