1
0
Преглед на файлове

'helios.code.font' setting

Herby Vojčík преди 5 години
родител
ревизия
0c92ba8d6c
променени са 2 файла, в които са добавени 25 реда и са изтрити 6 реда
  1. 23 6
      src/Helios-Workspace.js
  2. 2 0
      src/Helios-Workspace.st

+ 23 - 6
src/Helios-Workspace.js

@@ -412,7 +412,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2,$3;
+var $1,$2,$3,$6,$5,$4,$7,$receiver;
 $1=$self._editor();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["editor"]=1;
@@ -431,19 +431,36 @@ return $self._onChange();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
+$3="helios.code.font"._settingValue();
+if(($receiver = $3) == null || $receiver.a$nil){
+$3;
+} else {
+var font;
+font=$receiver;
+$6=$self._wrapper();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["wrapper"]=1;
+//>>excludeEnd("ctx");
+$5=$recv($6)._asJQuery();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["asJQuery"]=1;
+//>>excludeEnd("ctx");
+$4=$recv($5)._find_(".CodeMirror");
+$recv($4)._css_put_("font",font);
+}
 $recv($recv($self._wrapper())._asJQuery())._on_in_do_("mousedown",".CodeMirror pre",(function(event){
 var position,node;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$3=$recv(event)._at_("ctrlKey");
-if($core.assert($3)){
+$7=$recv(event)._at_("ctrlKey");
+if($core.assert($7)){
 position=$recv($self._editor())._coordsChar_($globals.HashedCollection._newFromPairs_(["left",$recv(event)._clientX(),"top",$recv(event)._clientY()]));
 $self._onCtrlClickAt_($recv($recv($recv(position)._line()).__at($recv(position)._ch())).__plus((1)));
 return $recv(event)._preventDefault();
 }
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({event:event,position:position,node:node},$ctx1,2)});
+}, function($ctx2) {$ctx2.fillBlock({event:event,position:position,node:node},$ctx1,3)});
 //>>excludeEnd("ctx");
 }));
 return self;
@@ -453,11 +470,11 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ].\x0a\x0a\x09self wrapper asJQuery on: 'mousedown' in: '.CodeMirror pre' do: [ :event | | position node |\x0a\x09\x09(event at: 'ctrlKey') ifTrue: [\x0a\x09\x09\x09position := self editor coordsChar: #{ \x0a\x09\x09\x09\x09'left' -> event clientX.\x0a\x09\x09\x09\x09'top' -> event clientY\x0a\x09\x09\x09}.\x0a\x09\x09\x09self onCtrlClickAt: (position line @ position ch) + 1.\x0a\x09\x09\x09event preventDefault ] ]",
+source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ].\x0a\x0a\x09'helios.code.font' settingValue ifNotNil: [ :font |\x0a\x09\x09(self wrapper asJQuery find: '.CodeMirror') css: 'font' put: font ].\x0a\x09self wrapper asJQuery on: 'mousedown' in: '.CodeMirror pre' do: [ :event | | position node |\x0a\x09\x09(event at: 'ctrlKey') ifTrue: [\x0a\x09\x09\x09position := self editor coordsChar: #{ \x0a\x09\x09\x09\x09'left' -> event clientX.\x0a\x09\x09\x09\x09'top' -> event clientY\x0a\x09\x09\x09}.\x0a\x09\x09\x09self onCtrlClickAt: (position line @ position ch) + 1.\x0a\x09\x09\x09event preventDefault ] ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
 pragmas: [],
-messageSends: ["at:put:", "editor", "on:do:", "onChange", "on:in:do:", "asJQuery", "wrapper", "ifTrue:", "at:", "coordsChar:", "clientX", "clientY", "onCtrlClickAt:", "+", "@", "line", "ch", "preventDefault"]
+messageSends: ["at:put:", "editor", "on:do:", "onChange", "ifNotNil:", "settingValue", "css:put:", "find:", "asJQuery", "wrapper", "on:in:do:", "ifTrue:", "at:", "coordsChar:", "clientX", "clientY", "onCtrlClickAt:", "+", "@", "line", "ch", "preventDefault"]
 }),
 $globals.HLCodeWidget);
 

+ 2 - 0
src/Helios-Workspace.st

@@ -159,6 +159,8 @@ configureEditor
 	self editor at: 'amberCodeWidget' put: self.
 	self editor on: 'change' do: [ self onChange ].
 
+	'helios.code.font' settingValue ifNotNil: [ :font |
+		(self wrapper asJQuery find: '.CodeMirror') css: 'font' put: font ].
 	self wrapper asJQuery on: 'mousedown' in: '.CodeMirror pre' do: [ :event | | position node |
 		(event at: 'ctrlKey') ifTrue: [
 			position := self editor coordsChar: #{