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
 - 
		
			
				
November 16, 2016 at 1:38 am #5087

Another annoying this is that if I try to move the Tab Close button using Margin or Padding, you can still click on the original position of the close button.
November 16, 2016 at 4:12 am #5089No you can still apply it (as you can clearly see in my GIF!) via selecting the same theme again.
You are right, sorry.
So, that is what I found:
- style of TextView has no effect, and there is used “content” color for background.
 - if I setup “content”:”#282C34″ then I got correct color, not #223333
 - style of TextView work correctly in my monkey2 fork! and when I answered you first time I tried with it and it works. Now I tried with release1.1.01 and it does not work.
 - Needed more deep comparison code to understand.
 
This is my theme for test:
Monkey123456789{"extends":"ted2-default","styles":{"TextView":{"backgroundColor":"#282C34"}}}and result on the screenshot.
So try to use version from monkey2 repository.
Attachments:
November 16, 2016 at 8:40 am #5094these are colors for code highlighting:
<clip>
LOLso… why doesn’t the code reference the actual use and not color0, etc.
For the end user, editing a non-sensical document full of color0, etc makes no sense.
you could go further with the color definitions themselves:
E.G.
“#ff0000” and why not “Red”. why in “” and why if defining it as a UInt it is $ff0000ff. or as Color(1.0,0,0). There is no connection with any of it!
</div>
My solution was to have a unified set of colors, that are named and shown. so you know what they are in both words and a visual color picker.E.G.
canvas.Color = Color.PicoBlack
or pop out the color picker and pick the color “PicoBlack”, or pick that sort of black color you like.
The color picker also shows what the rgb values are in floats.
Be very carful with having any sort of floating dialog – they get in the way
etc, etc
</div>
November 16, 2016 at 9:18 am #5095For the end user, editing a non-sensical document full of color0, etc makes no sense.
The rule is: If you are not ready to study each param inside of theme – don’t touch this.
The end user should be enough to use predefined themes.
And as I said earlier – color picker is in todo.
November 16, 2016 at 1:41 pm #5096I’ve built Monkey 2 from the master branch and Ted2Go from the master branch and applied your theme.
The colour is still wrong.November 16, 2016 at 2:18 pm #5097nerobot, you the bomb!
November 16, 2016 at 3:26 pm #5098I tried the “dev” branch of both Monkey 2 and Ted2Go now and the colour is STILL wrong. :/
November 16, 2016 at 4:02 pm #5100Hm. Looked like mystic.
I will try to understand this situation a bit later, ok? Probably, there is needed core monkey fixes.
November 16, 2016 at 4:21 pm #5102It seems the error isn’t specifically linked to the IDE!
I’ve been experimenting and it looks like ALL my colours in Monkey 2 are wrong.Here I’m drawing 3 rectangles, the 2 at the top should be blue-ish but are green when drawn.
The bottom one should be very different from the 2 at the top, but they look exactly the same when I draw them.Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class MyWindow Extends WindowMethod OnRender( canvas:Canvas ) Override'Blue via HEXcanvas.Color=GetHexColor("#282C34")canvas.DrawRect(0,0,256,256)'Blue via RGBcanvas.Color=New Color(40.0/255.0,44.0/255.0,52.0/255.0)canvas.DrawRect(256,0,256,256)'Green via HEXcanvas.Color=GetHexColor("#223333")canvas.DrawRect(0,256,256,256)EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()End'Taken from Mojo's theme loaderFunction GetHexColor:Color(str:String)Local a:=1.0,r:=0.0,g:=0.0,b:=0.0If str.StartsWith("#")If str.Length=4 '#RGBr=StringToULong( str.Slice( 1,2 ),16 )/15.0g=StringToULong( str.Slice( 2,3 ),16 )/15.0b=StringToULong( str.Slice( 3,4 ),16 )/15.0Else If str.Length=5 '#ARGBa=StringToULong( str.Slice( 1,2 ),16 )/15.0r=StringToULong( str.Slice( 2,3 ),16 )/15.0g=StringToULong( str.Slice( 3,4 ),16 )/15.0b=StringToULong( str.Slice( 4,5 ),16 )/15.0Else If str.Length=7 '#RRGGBBr=StringToULong( str.Slice( 1,3 ),16 )/255.0g=StringToULong( str.Slice( 3,5 ),16 )/255.0b=StringToULong( str.Slice( 5,7 ),16 )/255.0Else If str.Length=9 '#AARRGGBBa=StringToULong( str.Slice( 1,3 ),16 )/255.0r=StringToULong( str.Slice( 3,5 ),16 )/255.0g=StringToULong( str.Slice( 5,7 ),16 )/255.0b=StringToULong( str.Slice( 7,9 ),16 )/255.0ElseReturn Color.MagentaEndifElseReturn Color.MagentaEndifReturn New Color( r,g,b,a )End
That is for Windows.
But if I compile for Emscripten the result is correct!

I’ve started a separate thread for this, hoping Mark will see it!
On another note, is there any way to increase the distance between lines in the text view gadget?November 18, 2016 at 4:08 am #5188@nerobot
I’ve added a toggle option for the Toolbar.
In mainwindow.monkey2 add this to the view menu creation:Monkey12345678910'View menu'_themesMenu=CreateThemesMenu( "Themes..." )_viewMenu=New Menu( "View" )AddToggleActions( _viewMenu )_viewMenu.AddSeparator()AddZoomActions( _viewMenu )_viewMenu.AddSeparator()_viewMenu.AddSubMenu( _themesMenu )And here’s the new AddToggleActions function, add anywhere (I recommend above AddZoomActions function)
Monkey12345Method AddToggleActions( menu:Menu )menu.AddAction( "Toggle Toolbar" ).Triggered=Lambda()Self._toolBar.Visible = Not Self._toolBar.VisibleEndEndI couldn’t figure out how to hide the code toolbar menu though, I’d like a toggle option for that too.
November 18, 2016 at 4:17 am #5189For code toolbar – look into codedocument.monkey2 -> CodeDocunent class -> New() method.
There is a code at the end of New():
Monkey1234' bar + editorLocal docker:=New DockingViewdocker.AddView( bar,"top" )docker.ContentView=_codeViewas a simplest solution just comment line
Monkey1docker.AddView( bar,"top" )later I’ll add show/hide options into menu.
November 18, 2016 at 4:20 am #5190Yeah I had a look at that.
But I couldn’t find a way to access “docker” after the New() method, and I want to Toggle it like the Toolbar.November 18, 2016 at 4:32 am #5191Steps to do are:
- Replace local bar variable with field _toolBar
 - Add property ToolBarVisible:Bool
 - In mainwindow for toogle logic add method ToggleCodeToolBar()
 
Monkey12345678'Field _barVisible:Boolproperty ToolBarVisible:Bool()return _barVisiblesetter(value:Bool)_barVisible=value_toolBar.Visible=_barVisibleendMonkey1234567' in mainwindowmethod ToggleCodeToolBar()local docs:=_docsManager.getAll<CodeDocument>() 'any way to get all docs herefor doc = eachin docsdoc.ToolBarVisible=not doc.ToolBarVisibleendifendI wrote this code inside of browser to show you my direction. So need to be fixed of course.
November 18, 2016 at 4:38 am #5192There are many bugs and weak spots in current version. I can’t wait I have spare time to fix them.
November 18, 2016 at 4:50 am #5193Yeah the search window is driving me crazy heh.
If I paste something in there it doesn’t work, if I open it and hit enter it clears the field etc.
But overall it’s a great improvement! So well done.
I can add a toggle option for the code toolbar, I know how, I just wasn’t sure how much of your code you wanted me to alter.
I was hoping you’d use my code I posted above in your next release hehe. - 
		AuthorPosts
 
You must be logged in to reply to this topic.
		
		
	