About Monkey 2 › Forums › Monkey 2 Projects › Ted2Go IDE
This topic contains 596 replies, has 46 voices, and was last updated by 
 nerobot 3 months ago.
- 
		AuthorPosts
 - 
		
			
				
April 8, 2017 at 8:36 am #7782
Ok, good to know it will be fixed down the road
@difference And thank you for paypal.
np, you are doing a greeat job
April 8, 2017 at 2:51 pm #7785I’ve added a way to override the fonts used by the theme from inside the IDE.
You do it via File > Preferences… > Font
First enter the name of the font file, for example “MyFont.ttf”, then the size of the font.
You can also leave the fields empty to revert back to the standard font used by the theme.Here the Roboto font at 16px is used.

prefs.monkey2
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102Namespace ted2goClass Prefs' AutoCompletionGlobal AcEnabled:=TrueGlobal AcKeywordsOnly:=FalseGlobal AcShowAfter:=2Global AcUseTab:=TrueGlobal AcUseEnter:=FalseGlobal AcUseSpace:=TrueGlobal AcNewLineByEnter:=True'Global MainToolBarVisible:=TrueGlobal EditorToolBarVisible:=TrueGlobal EditorGutterVisible:=TrueGlobal EditorShowWhiteSpaces:=FalseGlobal EditorFontName:StringGlobal EditorFontSize:String'Global SourceSortByType:=TrueGlobal SourceShowInherited:=FalseFunction LoadState( json:JsonObject )If json.Contains( "completion" )Local j2:=json["completion"].ToObject()AcEnabled=j2["enabled"].ToBool()AcKeywordsOnly=j2["keywordsOnly"].ToBool()AcShowAfter=j2["showAfter"].ToNumber()AcUseTab=j2["useTab"].ToBool()AcUseEnter=j2["useEnter"].ToBool()AcUseSpace=GetJsonBool( j2,"useSpace",AcUseSpace )AcNewLineByEnter=j2["newLineByEnter"].ToBool()EndifIf json.Contains( "mainToolBarVisible" )MainToolBarVisible=json["mainToolBarVisible"].ToBool()EndifIf json.Contains( "editor" )Local j2:=json["editor"].ToObject()EditorToolBarVisible=j2["toolBarVisible"].ToBool()EditorGutterVisible=j2["gutterVisible"].ToBool()EditorShowWhiteSpaces=GetJsonBool( j2,"showWhiteSpaces",EditorShowWhiteSpaces )If j2.Contains("fontName") Then EditorFontName=j2["fontName"].ToString()If j2.Contains("fontSize") Then EditorFontSize=j2["fontSize"].ToString()EndifIf json.Contains( "source" )Local j2:=json["source"].ToObject()SourceSortByType=j2["sortByType"].ToBool()SourceShowInherited=j2["showInherited"].ToBool()EndifEndFunction SaveState( json:JsonObject )Local j:=New JsonObjectj["enabled"]=New JsonBool( AcEnabled )j["keywordsOnly"]=New JsonBool( AcKeywordsOnly )j["showAfter"]=New JsonNumber( AcShowAfter )j["useTab"]=New JsonBool( AcUseTab )j["useEnter"]=New JsonBool( AcUseEnter )j["useSpace"]=New JsonBool( AcUseSpace )j["newLineByEnter"]=New JsonBool( AcNewLineByEnter )json["completion"]=jjson["mainToolBarVisible"]=New JsonBool( MainToolBarVisible )j=New JsonObjectj["toolBarVisible"]=New JsonBool( EditorToolBarVisible )j["gutterVisible"]=New JsonBool( EditorGutterVisible )j["showWhiteSpaces"]=New JsonBool( EditorShowWhiteSpaces )j["fontName"]=New JsonString( EditorFontName )j["fontSize"]=New JsonString( EditorFontSize )json["editor"]=jj=New JsonObjectj["sortByType"]=New JsonBool( SourceSortByType )j["showInherited"]=New JsonBool( SourceShowInherited )json["source"]=jEndEndFunction GetJsonBool:Bool( json:Map<String,JsonValue>,key:String,def:Bool )Return json[key] ? json[key].ToBool() Else defEndprefsdialog.monkey2
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134Namespace ted2goClass PrefsDialog Extends DialogExtField Apply:Void()Method New()Title="Prefs"_acShowAfter=New TextField( ""+Prefs.AcShowAfter )_acEnabled=New CheckButton( "Enabled" )_acEnabled.Checked=Prefs.AcEnabled_acKeywordsOnly=New CheckButton( "Keywords only" )_acKeywordsOnly.Checked=Prefs.AcKeywordsOnly_acUseTab=New CheckButton( "Choose by Tab" )_acUseTab.Checked=Prefs.AcUseTab_acUseEnter=New CheckButton( "Choose by Enter" )_acUseEnter.Checked=Prefs.AcUseEnter_acUseSpace=New CheckButton( "Choose by Space" )_acUseSpace.Checked=Prefs.AcUseSpace_acNewLineByEnter=New CheckButton( "Add new line (by Enter)" )_acNewLineByEnter.Checked=Prefs.AcNewLineByEnter_editorToolBarVisible=New CheckButton( "ToolBar visible" )_editorToolBarVisible.Checked=Prefs.EditorToolBarVisible_editorGutterVisible=New CheckButton( "Gutter visible" )_editorGutterVisible.Checked=Prefs.EditorGutterVisible_mainToolBarVisible=New CheckButton( "ToolBar visible" )_mainToolBarVisible.Checked=Prefs.MainToolBarVisible_editorShowWhiteSpaces=New CheckButton( "Whitespaces visible" )_editorShowWhiteSpaces.Checked=Prefs.EditorShowWhiteSpaces_editorFontName=New TextField( Prefs.EditorFontName )_editorFontSize=New TextField( Prefs.EditorFontSize )Local font:=New DockingViewfont.AddView( New Label( "Font" ),"left" )font.AddView( _editorFontName,"left" )font.AddView( _editorFontSize,"left","45" )Local after:=New DockingViewafter.AddView( New Label( "Show after" ),"left" )after.AddView( _acShowAfter,"left" )Local docker:=New DockingViewdocker.AddView( New Label( "[Main]" ),"top" )docker.AddView( _mainToolBarVisible,"top" )docker.AddView( New Label( " " ),"top" )docker.AddView( New Label( "[Code Editor]" ),"top" )docker.AddView( _editorToolBarVisible,"top" )docker.AddView( _editorGutterVisible,"top" )docker.AddView( _editorShowWhiteSpaces,"top" )docker.AddView( font,"top" )docker.AddView( New Label( " " ),"top" )docker.AddView( New Label( "[Completion]" ),"top" )docker.AddView( _acEnabled,"top" )docker.AddView( after,"top" )docker.AddView( _acUseTab,"top" )docker.AddView( _acUseEnter,"top" )docker.AddView( _acNewLineByEnter,"top" )docker.AddView( _acUseSpace,"top" )docker.AddView( _acKeywordsOnly,"top" )docker.AddView( New Label( " " ),"top" )docker.AddView( New Label( "(Restart IDE to see all changes)" ),"top" )docker.AddView( New Label( " " ),"top" )ContentView=dockerLocal apply:=AddAction( "Apply" )apply.Triggered=OnApply_acShowAfter.Activated+=_acShowAfter.MakeKeyViewDeactivated+=MainWindow.UpdateKeyViewEndPrivateField _acEnabled:CheckButtonField _acUseTab:CheckButtonField _acUseEnter:CheckButtonField _acUseSpace:CheckButtonField _acNewLineByEnter:CheckButtonField _acKeywordsOnly:CheckButtonField _acShowAfter:TextFieldField _editorToolBarVisible:CheckButtonField _editorGutterVisible:CheckButtonField _editorShowWhiteSpaces:CheckButtonField _editorFontName:TextFieldField _editorFontSize:TextFieldField _mainToolBarVisible:CheckButtonMethod OnApply()Prefs.AcEnabled=_acEnabled.CheckedPrefs.AcUseTab=_acUseTab.CheckedPrefs.AcUseEnter=_acUseEnter.CheckedPrefs.AcUseSpace=_acUseSpace.CheckedPrefs.AcNewLineByEnter=_acNewLineByEnter.CheckedPrefs.AcKeywordsOnly=_acKeywordsOnly.CheckedLocal count:=Max( 1,Int( _acShowAfter.Text ) )Prefs.AcShowAfter=countPrefs.EditorToolBarVisible=_editorToolBarVisible.CheckedPrefs.EditorGutterVisible=_editorGutterVisible.CheckedPrefs.EditorShowWhiteSpaces=_editorShowWhiteSpaces.CheckedPrefs.EditorFontName=_editorFontName.TextPrefs.EditorFontSize=Int(_editorFontSize.Text)Prefs.MainToolBarVisible=_mainToolBarVisible.CheckedApp.ThemeChanged()Hide()Apply()EndEndcodedocument.monkey2, specifically the UpdateThemeColors() part
Monkey123456789Method UpdateThemeColors()_lineColor=App.Theme.GetColor( "textview-cursor-line" )If Prefs.EditorFontName.Length>1 And Int(Prefs.EditorFontSize)>1 ThenLocal tmpFont:=Font.Load("asset::fonts\"+Prefs.EditorFontName,Int(Prefs.EditorFontSize))If tmpFont Then RenderStyle.Font=tmpFont Else RenderStyle.Font=App.Theme.GetStyle("Editor").FontEndifEndApril 8, 2017 at 3:40 pm #7788Nice!
April 8, 2017 at 4:06 pm #7789I’m real new to GitHub (Used BitBucket previously) but I think I’ve pushed my commit to you nerobot.
My apologies if I messed something up heh.
April 8, 2017 at 4:28 pm #7790Yes, I merged. I changed fontsize to Int type.
I’ll try to extract current font name and size from theme’s json, a bit later.
April 8, 2017 at 9:39 pm #7799There’s some sort of weird bug with having fontSize as a Int in this case.
I had it as an Int at first, but it makes you unable to actually select the TextField in Preferences…
If you compile your version and try to edit size in Preferences you’ll notice that you won’t be able to write anything, but with my version it does work.
I’m not sure what causes it, I just know having it as a String makes it work.I pushed another change to your repo.
You can now set which side the project view is on.
I also changed fontSize back to string so you can actually use the new feature heh.April 9, 2017 at 4:01 am #7805Yesterday I didn’t test it. But now it worked well.
There’s some sort of weird bug with having fontSize as a Int in this case.
I had it as an Int at first, but it makes you unable to actually select the TextField in Preferences…If you compile your version and try to edit size in Preferences you’ll notice that you won’t be able to write anything, but with my version it does work.
I set default font size to 16 and pass {“”+fontSize} into label, so we can normally edit size value.
@hezkore To avoid problems with my version you shoult to remove {fontSize} item from ted2.state.json (or convert it into number format).Also, I added font file requester – easy to select any font now.
Attachments:
April 9, 2017 at 7:44 am #7808So, @hezkore give me an impulse to add new features right now.
- Improved Preferences dialog – not need to restart app to apply the changes;
 - New setting “Project tabs on the right side” – (so long name, huh) that allow us to move Project tabs (Project / Source / Debug and Help) to the left side (right by default);
 - New setting “Choose by Dot” – enable/disable choosing selected item in completion list by dot (period);
 - Fix issue: Fonts don’t copy from assets to product folder. Hope that fix also font problems in themes.
 
Newest version is v2.2.6.
April 9, 2017 at 3:20 pm #7811deleted.
April 9, 2017 at 3:21 pm #7812deleted.
April 9, 2017 at 3:21 pm #7813deleted.
April 9, 2017 at 3:22 pm #7814I started v2.3 in dev branch. If anyone want to test new features – you’re welcome!
Done:
- Open files from Project browser by double-click.
 - FileBrowser – add item “Open as project” and “Close Project” for folders.
 - Recent Projects stuff.
 - Save untitled – add .monkey2 filetype in dialog.
 - Change progressbar image for all theme.
 - GutterView – draw each 10 line number to make more clear view.
 - Restore console visibility after stop app.
 - Whitespaces – draw them after ‘tab’ if there is no char or it’s a next tab.
 - If starting outside of monkey2 folder – show dialog to specify root folder.
 - Change AppTitle format: FileName – Ted2goName – FilePath.
 
(version is in progress)
April 10, 2017 at 1:01 pm #7838Really great work Nerobot, well done!
April 10, 2017 at 1:30 pm #7839Whenever I start Ted2Go the font drawing seems messed up.

If I apply a new theme or override the theme font however, things seems to be fixed (until I restart Ted2Go again)
April 10, 2017 at 3:05 pm #7842Really great work Nerobot, well done!
Tx!
Whenever I start Ted2Go the font drawing seems messed up.
Fixed.
—————–
Some new dev stuff:
- Project browser:
- New actions for folders: “Clean (delete .buildv)” and “Open on Desktop”.
 - New actions – Update / Rebuild module. Wow! 
Now we can easily update custom module just after changed it!
 
 - Added elapsed build time. But that time is for latest process. For exampe, if we start updating modules, elapsed time will show us ‘release’ config only because release/debug are different processes.
 - Fixed incorrect fonts for opened documents.
 
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.
		
		
	