IDE: keymapping: show ... when cutting long descriptions

git-svn-id: trunk@30977 -
This commit is contained in:
mattias 2011-05-30 13:36:15 +00:00
parent 8364c253c9
commit c9b128f64a

View File

@ -397,6 +397,8 @@ end;
function TEditorKeymappingOptionsFrame.KeyMappingRelationToString(
KeyRelation: TKeyCommandRelation): String;
const
MaxLength = 60;
function AddBrakets(S: String): String;
begin
@ -406,7 +408,9 @@ function TEditorKeymappingOptionsFrame.KeyMappingRelationToString(
begin
with KeyRelation do
begin
Result := UTF8Copy(LocalizedName, 1, 40);
Result := LocalizedName;
if UTF8Length(Result)>MaxLength then
Result := UTF8Copy(LocalizedName, 1, MaxLength)+'...';
if Result <> '' then
Result := Result + ' ';
if (ShortcutA.Key1 = VK_UNKNOWN) and (ShortcutB.Key1 = VK_UNKNOWN) then