mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Improve zoomed caracter field size
This commit is contained in:
parent
d5a9e5112c
commit
f172850565
@ -10,6 +10,7 @@ develop
|
||||
- Improve character inspector:
|
||||
- Display also Unicode block if selected letter consists of one character.
|
||||
- Display unicode names of each character if selected letter consist of multiple characters.
|
||||
- Fix drawing area of zoomed character view.
|
||||
- Improve text selection by clicking line numbers view.
|
||||
- Tweak style of popup menus in toolbar.
|
||||
- Update Python syntax style:
|
||||
|
@ -3,7 +3,6 @@
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="CECharacterPopoverController">
|
||||
@ -15,14 +14,11 @@
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView horizontalHuggingPriority="249" verticalCompressionResistancePriority="250" id="c22-O7-iKe">
|
||||
<rect key="frame" x="0.0" y="0.0" width="266" height="73"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="264" height="74"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="500" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" preferredMaxLayoutWidth="500" translatesAutoresizingMaskIntoConstraints="NO" id="Lnp-OL-NAu">
|
||||
<rect key="frame" x="8" y="9" width="58" height="54"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" secondItem="Lnp-OL-NAu" secondAttribute="height" multiplier="1:1" id="DOs-QH-6yH"/>
|
||||
</constraints>
|
||||
<textField horizontalHuggingPriority="500" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" preferredMaxLayoutWidth="500" translatesAutoresizingMaskIntoConstraints="NO" id="Lnp-OL-NAu" customClass="CECharacterField">
|
||||
<rect key="frame" x="8" y="10" width="56" height="54"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="center" title="蛙" id="E2I-1W-zW6">
|
||||
<font key="font" size="48" name="TimesNewRomanPSMT"/>
|
||||
@ -34,7 +30,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" preferredMaxLayoutWidth="400" translatesAutoresizingMaskIntoConstraints="NO" id="5tD-mh-lm6">
|
||||
<rect key="frame" x="70" y="12" width="188" height="14"/>
|
||||
<rect key="frame" x="68" y="13" width="188" height="14"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="U+86D9" id="Atm-wm-Ocl">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@ -46,7 +42,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" preferredMaxLayoutWidth="400" translatesAutoresizingMaskIntoConstraints="NO" id="cvP-MD-1SF">
|
||||
<rect key="frame" x="70" y="47" width="188" height="16"/>
|
||||
<rect key="frame" x="68" y="48" width="188" height="16"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="CJK UNIFIED IDEOGRAPH-86D9" id="H6i-fn-bnL">
|
||||
<font key="font" metaFont="cellTitle"/>
|
||||
@ -58,7 +54,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" preferredMaxLayoutWidth="400" translatesAutoresizingMaskIntoConstraints="NO" id="V7B-LW-D7y">
|
||||
<rect key="frame" x="70" y="30" width="188" height="14"/>
|
||||
<rect key="frame" x="68" y="31" width="188" height="14"/>
|
||||
<animations/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" alignment="left" title="CJK Unified Ideographs" id="h7A-Kh-GoY">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@ -78,6 +74,7 @@
|
||||
<constraint firstItem="V7B-LW-D7y" firstAttribute="leading" secondItem="Lnp-OL-NAu" secondAttribute="trailing" constant="8" symbolic="YES" id="JzA-kM-gRT"/>
|
||||
<constraint firstItem="5tD-mh-lm6" firstAttribute="leading" secondItem="Lnp-OL-NAu" secondAttribute="trailing" constant="8" symbolic="YES" id="TEN-2w-O09"/>
|
||||
<constraint firstItem="Lnp-OL-NAu" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="10" id="Vj2-pk-Yi8"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Lnp-OL-NAu" secondAttribute="bottom" constant="10" id="Vnu-NL-Tu3"/>
|
||||
<constraint firstItem="V7B-LW-D7y" firstAttribute="top" secondItem="cvP-MD-1SF" secondAttribute="bottom" constant="3" id="cW3-TS-n9I"/>
|
||||
<constraint firstAttribute="trailing" secondItem="5tD-mh-lm6" secondAttribute="trailing" constant="10" id="e7L-Ya-1fM"/>
|
||||
<constraint firstItem="cvP-MD-1SF" firstAttribute="leading" secondItem="Lnp-OL-NAu" secondAttribute="trailing" constant="8" symbolic="YES" id="e8Y-ow-6K9"/>
|
||||
@ -86,7 +83,7 @@
|
||||
<constraint firstItem="Lnp-OL-NAu" firstAttribute="top" secondItem="cvP-MD-1SF" secondAttribute="top" id="zIk-gW-Q8x"/>
|
||||
</constraints>
|
||||
<animations/>
|
||||
<point key="canvasLocation" x="509" y="628.5"/>
|
||||
<point key="canvasLocation" x="509" y="628"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
@ -293,6 +293,8 @@
|
||||
2AA2E01A1BFF9AEE0087BDD6 /* CEUnicodeCharacter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AA2E0191BFF9AEE0087BDD6 /* CEUnicodeCharacter.m */; };
|
||||
2AA2E01B1BFF9AEE0087BDD6 /* CEUnicodeCharacter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AA2E0191BFF9AEE0087BDD6 /* CEUnicodeCharacter.m */; };
|
||||
2AA2E01C1BFFA22B0087BDD6 /* CEUnicodeCharacter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AA2E0191BFF9AEE0087BDD6 /* CEUnicodeCharacter.m */; };
|
||||
2AA2E01F1C007C690087BDD6 /* CECharacterField.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AA2E01E1C007C690087BDD6 /* CECharacterField.m */; };
|
||||
2AA2E0201C007C690087BDD6 /* CECharacterField.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AA2E01E1C007C690087BDD6 /* CECharacterField.m */; };
|
||||
2AAC90011A4E12D10074E076 /* CEWrappingTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AAC90001A4E12D10074E076 /* CEWrappingTextField.m */; };
|
||||
2AACC9591942A82900E3FF63 /* CEIndicatorSheetController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AACC9581942A82900E3FF63 /* CEIndicatorSheetController.m */; };
|
||||
2AB4326E1912ADAC00835004 /* CharacterPopover.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2AB4326C1912ADAC00835004 /* CharacterPopover.xib */; };
|
||||
@ -659,6 +661,8 @@
|
||||
2AA2E0161BFE14320087BDD6 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Unicode.strings; sourceTree = "<group>"; };
|
||||
2AA2E0181BFF9AEE0087BDD6 /* CEUnicodeCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEUnicodeCharacter.h; sourceTree = "<group>"; };
|
||||
2AA2E0191BFF9AEE0087BDD6 /* CEUnicodeCharacter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEUnicodeCharacter.m; sourceTree = "<group>"; };
|
||||
2AA2E01D1C007C690087BDD6 /* CECharacterField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CECharacterField.h; sourceTree = "<group>"; };
|
||||
2AA2E01E1C007C690087BDD6 /* CECharacterField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CECharacterField.m; sourceTree = "<group>"; };
|
||||
2AAC8FFF1A4E12D10074E076 /* CEWrappingTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEWrappingTextField.h; sourceTree = "<group>"; };
|
||||
2AAC90001A4E12D10074E076 /* CEWrappingTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEWrappingTextField.m; sourceTree = "<group>"; };
|
||||
2AACC9571942A82900E3FF63 /* CEIndicatorSheetController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CEIndicatorSheetController.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
@ -1369,6 +1373,8 @@
|
||||
2AA2E0191BFF9AEE0087BDD6 /* CEUnicodeCharacter.m */,
|
||||
2AB4326F1912AF7200835004 /* CECharacterPopoverController.h */,
|
||||
2AB432701912AF7200835004 /* CECharacterPopoverController.m */,
|
||||
2AA2E01D1C007C690087BDD6 /* CECharacterField.h */,
|
||||
2AA2E01E1C007C690087BDD6 /* CECharacterField.m */,
|
||||
);
|
||||
name = Character;
|
||||
sourceTree = "<group>";
|
||||
@ -1899,6 +1905,7 @@
|
||||
2A6F0DC91B5500E100C2D03C /* CEConsolePanelController.m in Sources */,
|
||||
2A6F0DCA1B5500E100C2D03C /* CELineHightPanelController.m in Sources */,
|
||||
2A6F0DCB1B5500E100C2D03C /* CEKeyBindingsViewController.m in Sources */,
|
||||
2AA2E0201C007C690087BDD6 /* CECharacterField.m in Sources */,
|
||||
2A6F0DCC1B5500E100C2D03C /* CEFindResultViewController.m in Sources */,
|
||||
2A6F0DCD1B5500E100C2D03C /* CEPrintPanelAccessoryController.m in Sources */,
|
||||
2A6F0DCE1B5500E100C2D03C /* CEMigrationWindowController.m in Sources */,
|
||||
@ -2012,6 +2019,7 @@
|
||||
2A49861F1A67CC7100172797 /* CEEditorScrollView.m in Sources */,
|
||||
2A84C7C21A48F3150013EE83 /* CEPreferencesWindow.m in Sources */,
|
||||
2A94A45E18D0B562009FA90D /* CEOpacityPanelController.m in Sources */,
|
||||
2AA2E01F1C007C690087BDD6 /* CECharacterField.m in Sources */,
|
||||
2AFF21821BA9F69A008A41CD /* CESwitcherSegmentedCell.m in Sources */,
|
||||
2A88A7901B8B87C90055B9AE /* NSString+Normalization.m in Sources */,
|
||||
2A15833518E3B83F00601026 /* CEConsolePanelController.m in Sources */,
|
||||
|
33
CotEditor/Sources/CECharacterField.h
Normal file
33
CotEditor/Sources/CECharacterField.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
|
||||
CECharacterField.h
|
||||
|
||||
CotEditor
|
||||
http://coteditor.com
|
||||
|
||||
Created by 1024jp on 2015-11-21.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
© 2015 1024jp
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
|
||||
@interface CECharacterField : NSTextField
|
||||
|
||||
@end
|
50
CotEditor/Sources/CECharacterField.m
Normal file
50
CotEditor/Sources/CECharacterField.m
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
|
||||
CECharacterField.m
|
||||
|
||||
CotEditor
|
||||
http://coteditor.com
|
||||
|
||||
Created by 1024jp on 2015-11-21.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
© 2015 1024jp
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
#import "CECharacterField.h"
|
||||
|
||||
|
||||
@implementation CECharacterField
|
||||
|
||||
#pragma mark Superclass Methods
|
||||
|
||||
// ------------------------------------------------------
|
||||
/// determine size
|
||||
- (NSSize)intrinsicContentSize
|
||||
// ------------------------------------------------------
|
||||
{
|
||||
NSSize size = [super intrinsicContentSize];
|
||||
NSRect bounds = [[self attributedStringValue] boundingRectWithSize:size
|
||||
options:NSStringDrawingUsesFontLeading];
|
||||
|
||||
size.width = MAX(size.width, [[self font] pointSize]); // avoid zero width
|
||||
size.height = ceil(NSHeight(bounds));
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in New Issue
Block a user