Merge pull request #38 from trunkmaster/master

Miniwindow image and title fixes.
This commit is contained in:
Fred Kiefer 2019-12-13 10:49:18 +01:00 committed by GitHub
commit ec26b4e01b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 10 deletions

View file

@ -1,3 +1,20 @@
2019-12-12 Sergii Stoian <stoyan255@gmail.com>
* Source/NSFont.m (smallSystemFontSize): return 10 as default value.
Update documention comment regarding default values for NSMiniFontSize
ans NSSmallFontSize.
2019-12-11 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m
(initialize): use MiniWindowTile image for miniwindow tile.
(drawRect:): adjusted position of title cell to fit tile image.
(setTitle:): disable drawing of title cell background;
use NSMiniControlSize font size for miniwindow title cell.
* Source/NSFont.m (systemFontSizeForControlSize:): increased default font
size for NSMiniControlSize.
2019-12-11 Sergii Stoian <stoyan255@gmail.com>
* Source/GSHorizontalTypesetter.m: removed extra imports left from

View file

@ -166,10 +166,10 @@ keyForFont(NSString *name, const CGFloat *matrix,
<item>NSFontSize 12 (System Font Size)</item>
<item>NSLabelFontSize (none)</item>
<item>NSMenuFontSize (none)</item>
<item>NSMiniFontSize 6</item>
<item>NSMiniFontSize 8</item>
<item>NSMessageFontSize (none)</item>
<item>NSPaletteFontSize (none)</item>
<item>NSSmallFontSize 9</item>
<item>NSSmallFontSize 10</item>
<item>NSTitleBarFontSize (none)</item>
<item>NSToolTipsFontSize (none)</item>
<item>NSUserFixedPitchFontSize (none)</item>
@ -656,7 +656,7 @@ static void setNSFont(NSString *key, NSFont *font)
if (fontSize == 0)
{
fontSize = 9;
fontSize = 10;
}
return fontSize;
@ -684,7 +684,7 @@ static void setNSFont(NSString *key, NSFont *font)
if (fontSize == 0)
{
fontSize = 6;
fontSize = 8;
}
return fontSize;

View file

@ -481,7 +481,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
iconSize = GSGetIconSize();
tileImage = [[GSCurrentServer() iconTileImage] copy];
tileImage = [[NSImage imageNamed:@"common_MiniWindowTile"] copy];
[tileImage setScalesWhenResized: YES];
[tileImage setSize: iconSize];
@ -514,8 +514,8 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
iconSize.width - ((iconSize.width / 8) * 2),
iconSize.height - ((iconSize.height / 8) * 2))
inView: self];
[titleCell drawWithFrame: NSMakeRect(1, iconSize.height - 12,
iconSize.width - 2, 11)
[titleCell drawWithFrame: NSMakeRect(3, iconSize.height - 13,
iconSize.width - 6, 10)
inView: self];
}
@ -600,15 +600,17 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
{
if (titleCell == nil)
{
CGFloat fontSize;
titleCell = [[NSTextFieldCell alloc] initTextCell: aString];
[titleCell setSelectable: NO];
[titleCell setEditable: NO];
[titleCell setBordered: NO];
[titleCell setAlignment: NSCenterTextAlignment];
[titleCell setDrawsBackground: YES];
[titleCell setBackgroundColor: [NSColor blackColor]];
[titleCell setDrawsBackground: NO];
[titleCell setTextColor: [NSColor whiteColor]];
[titleCell setFont: [NSFont systemFontOfSize: 8]];
fontSize = [NSFont systemFontSizeForControlSize: NSMiniControlSize];
[titleCell setFont: [NSFont systemFontOfSize: fontSize]];
}
else
{