Page 1 of 3

A New Design for the Top Bar?

Posted: May 19th, '18, 21:53
by Calloway
I don't know seems to organize things in categories of similarity, any thoughts?
Capture.PNG

Code for ProjectEditor.gp:

Code: Select all

method addTopBarParts ProjectEditor {
  scale = (global 'scale')
  page = (global 'page')
  space = (15 * scale)

  title = (newText '' 'Arial Bold' (14 * scale))
  addPart morph (morph title)

  connectorLabel = (newText 'Show arrows:' 'Arial' (11 * scale))
  connectorToggle = (toggleButton
	(action 'toggleConnectors' page) (action 'isShowingConnectors' page)
	(scale * 20) (scale * 13) (scale * 5) (max 1 (scale / 2)) false)
  addPart morph (morph connectorLabel)
  addPart morph (morph connectorToggle)

  stealthSlider = (slider 'horizontal' (* scale 50) (action 'setBlocksStealthLevel' this) nil -50 110 (global 'stealthLevel'))
  addPart morph (morph stealthSlider)

  leftItems = (list)
  add leftItems (textButton this 'New' 'newProject')
  add leftItems (textButton this 'Open' 'openProjectMenu')
  add leftItems (textButton this 'Save' 'saveProject')


  rightItems = (list)
    if (not (isOneOf (platform) 'Browser' 'iOS')) {
	  add rightItems (textButton this 'Export as App' 'exportProjectAsApp')
	  add rightItems (textButton this 'Export to Web' 'exportProjectToWeb')
  }
  add rightItems space
  add rightItems (textButton this 'Go' (action 'broadcastGo' page))
  add rightItems (textButton this 'Stop' (action 'stopAll' page))
  add rightItems (textButton this 'Present' 'enterPresentation')

  leftItemsRow2 = (list)
  

  rightItemsRow2 = (list)
  add rightItemsRow2 connectorLabel
  add rightItemsRow2 connectorToggle
  add rightItemsRow2 (clickLabel this 'Blocks' 'slideToBlocks')
  add rightItemsRow2 stealthSlider
  add rightItemsRow2 (clickLabel this 'Text' 'slideToText')
  add rightItemsRow2 space
  add rightItemsRow2 (addFPSReadout this)
}

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 08:13
by MSandro
"organize things in categories", maybe you could use menus
Bildschirmfoto vom 2018-05-20 10-11-51.png
Code ProjectEdtor:

Code: Select all

method openSettings ProjectEditor {
  menu = (menu 'GP Settings' (global 'page'))
  addItem menu 'stage ratio' 'confStageRatio'
  addItem menu 'stage resolution'
  addItem menu 'keyboard hotfix'
  addItem menu 'defaults'
  addLine menu
  addItem menu 'Help' 'showSettingsHelp'
  popUp menu (global 'page') 150 -50 1
}
...

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 13:59
by Calloway
Oo you're right that's a lot better

Do you know how (or if it's possible) to change the top bar colour?

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 14:55
by MSandro
In the ProjectEditor you should find a "drawTopBar" method. If I remember correctly you should be able to set the background color there.

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 15:22
by Calloway
Oo thank you, wouldn't have ever found it without that.
Would you think it'd be good for GP to have an INI or TXT file for themeing or styling the editor (or the sidebars if the project's in presentation mode/exported)?

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 15:27
by MSandro
Yes I think this would be grate. I've already thought to add styling functionalities to my settings menu. I would suggest you to use json files because GP already has a json en/decoder.

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 15:35
by Calloway
I'm still trying to piece together the different parts of the lib together and figure out the code, but do you think it would be possible by setting some global variables from a file at startup time and then have those variables act as the 'color R G B' and 'gray 'Amount'' (maybe just take out gray in general and use purely color for more customization)
I don't really know if this would be possible but maybe through tinkering we could figure something out, you seem far more ahead though hehe

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 15:39
by MSandro
For my settings I proceed as follows:
> in the startup.gp class I call a methode "applySettings"
> The method reads my "settings.json"
> seperate the values using "jsonParse"
> finaly it saves those values into global variables

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 15:43
by Calloway
That sounds good, and GP already has a JSON decoder/encoder doesn't it?

Re: A New Design for the Top Bar?

Posted: May 20th, '18, 15:46
by MSandro
yes, it is available under the category network, but only in developer mode
Bildschirmfoto vom 2018-05-20 17-50-56.png