Blocks doesn't look visually good ,ZELOS

189 views
Skip to first unread message

Ray gautam

unread,
Feb 4, 2020, 5:08:47 AM2/4/20
to Blockly

blockly.PNG


Beka Westberg

unread,
Feb 4, 2020, 5:33:47 PM2/4/20
to Blockly
Hello,

Assuming the problem is that the "create list with" block is too tall, you can fix that by chaing the 'lists_create_with' block definition to define inline inputs.

Blockly.Blocks['lists_create_with'] = {
 
/**
   * Block for creating a list with any number of elements of any type.
   * @this {Blockly.Block}
   */

  init
: function() {
   
this.setHelpUrl(Blockly.Msg['LISTS_CREATE_WITH_HELPURL']);
   
this.setStyle('list_blocks');
   
this.itemCount_ = 3;
   
this.updateShape_();
   
this.setOutput(true, 'Array');
   
// This line is added.
   
this.setInputsInline(true);
   
this.setMutator(new Blockly.Mutator(['lists_create_with_item']));
   
this.setTooltip(Blockly.Msg['LISTS_CREATE_WITH_TOOLTIP']);
 
},
 
 
// etc
}

If you want to you should just be able to redefine 'lists_create_with' in your own custom files, without editting the Blockly source.

Now it looks like this:

inline.png

I hope that helps! If you have any further questions please reply!
--Beka

On Tuesday, February 4, 2020 at 2:08:47 AM UTC-8, Ray gautam wrote:

blockly.PNG


Coda Highland

unread,
Feb 4, 2020, 5:44:23 PM2/4/20
to blo...@googlegroups.com
In my opinion, the problem is more that the vertical blocks are too wide rather than being too tall -- a rounded rectangle shape or half-ellipses on the sides would be preferable to half-circles on the sides in order to avoid the huge circular blank spots, and those spots appear to get bigger as the block gets taller.

/s/ Adam

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/a71b3f1b-e4ce-4d37-af6d-1083ab904b41%40googlegroups.com.

Beka Westberg

unread,
Feb 4, 2020, 6:26:52 PM2/4/20
to Blockly
I like the half-ellipses idea! I'd probably stay away from the rounded rectangles, because that's already the shape for text and dropdowns:

TextAndDropdown.png


But I'm no designer hehe.

Also here's some other fun external-input zelos behavior:

ExternalWeirdness.png


And the inlined version:

InlinedVersion.png

To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.

Sam El-Husseini

unread,
Feb 4, 2020, 6:38:44 PM2/4/20
to blo...@googlegroups.com
Great idea Adam, I too like the half-ellipses idea for multi-line reporters. I'll play around with that.

Cheers,
Sam

To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/d46e8d1a-7714-47fd-b027-02e0f6dffa59%40googlegroups.com.
Message has been deleted
Message has been deleted

Ray gautam

unread,
Feb 5, 2020, 1:49:20 AM2/5/20
to Blockly
i would still think elipsis would look bad though , how about rectangle ? what if we had 10 items in a list,(external input)

Ray gautam

unread,
Feb 5, 2020, 2:13:09 AM2/5/20
to Blockly
is it possible to disable external inputs on menu of that list item block

Beka Westberg

unread,
Feb 5, 2020, 9:53:45 AM2/5/20
to Blockly
is it possible to disable external inputs on menu of that list item block

You can, but there are limitations.

The problem is that context menu items don't have a language-neutral ID, so you have to remove it based on the human-readable text. That means that removing it only works in English :/

If you want to disable the option globally you can override the BlockSvg's generateContextMenu function:
        var defaultGen = Blockly.BlockSvg.prototype.generateContextMenu;
       
Blockly.BlockSvg.prototype.generateContextMenu = function() {
         
var options = defaultGen.call(this);
          console
.log(options);
         
for (var i = 0, option; option = options[i]; i++) {
           
// Remove any option that includes the word "Inputs"
           
if (option.text.indexOf('Inputs') != -1) {
              options
.splice(i, 1);
             
break;
           
}
         
}
          console
.log(options);
         
return options;
       
}

If you want to only remove it for the list block you can add this to its block definition:
  customContextMenu: function(options) {
    console
.log(options);
   
for (var i = 0, option; (option = options[i]); i++) {
     
// Remove any option that includes the word "Inputs"
     
if (option.text.indexOf('Inputs') != -1) {
        options
.splice(i, 1);
       
break;
     
}
   
}
    console
.log(options);
   
return options;
 
},

I hope that helps! If you have any further questions please ask!
--Beka

Coda Highland

unread,
Feb 5, 2020, 9:57:36 AM2/5/20
to blo...@googlegroups.com
On Wed, Feb 5, 2020 at 8:53 AM Beka Westberg <bekawe...@gmail.com> wrote:
The problem is that context menu items don't have a language-neutral ID, so you have to remove it based on the human-readable text. That means that removing it only works in English :/

Is this something that's already under discussion/being evaluated/getting fixed? It sounds like it ought to be reasonably straightforward if not for the risk of breaking stuff downstream.

/s/ Adam

Beka Westberg

unread,
Feb 5, 2020, 10:04:55 AM2/5/20
to Blockly
Is this something that's already under discussion/being evaluated/getting fixed?

Mark Gibson (jollytoad) actually wrote up a lovely proposal for a fix! But it seems like it got burried :/

There's actually a lot of things I'd change about context menues (if I wanted to break everyone). But that proposal seems like a great start to me =)

--Beka

Sam El-Husseini

unread,
Feb 6, 2020, 6:23:17 PM2/6/20
to Blockly
How do folks feel about having a maximum curve radius for multi-line blocks, ending up with something that looks like this:
Screen Shot 2020-02-06 at 3.20.02 PM.png

The thing I like about the above is that you don't lose much of from the shape / connection type association (you can still tell this is a rounded reporter block), but it's not as obnoxious in it's size. (note: the padding for the inside of the block isn't quite right, but I just wanted to get some ideas from folks out there)

Cheers,
Sam

Beka Westberg

unread,
Feb 6, 2020, 6:45:55 PM2/6/20
to Blockly
I think it looks really cool! Instinctively I'd say its definitely better than the current!

One thing I'm still wondering about is how you're going to handle some inputs being larger than others. Are you planning on a ragged right or a ragged left?

Another option would be to bring all of the inputs below:

CreateListAlt.png



And make them center aligned.

Thanks for the update pics! Its so exciting to see the progress :D
--Beka

Coda Highland

unread,
Feb 6, 2020, 10:00:37 PM2/6/20
to blo...@googlegroups.com
This is the shape I was talking about when I had suggested a rounded rectangle, but I have to wonder how the half-ellipse sides would look for a point of comparison. It might look great or it might look silly.

/s/ Adam

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/c74273d2-42d9-45d6-a934-31095c2fe647%40googlegroups.com.

Andrew

unread,
Feb 6, 2020, 10:48:28 PM2/6/20
to Blockly
I'm looking to use Blockly to provide a limited programming facility for a commercial software offering.  That much curvature may be OK for a kids programming environment but it doesn't have a commercial look an feel. This is why I'm looking to use the block style other than the original in the first place. I'd prefer blocks that did not waste a lot of real estate on the screen so I'm a vote for maximum on curves, angles, nibbles off the corners and such.  I'm only a few days into Blockly so I'm not at all knowledgeable on programming the blocks themselves but I'm game to learn.

Coda Highland

unread,
Feb 6, 2020, 11:10:43 PM2/6/20
to blo...@googlegroups.com
No need to worry. This "Zelos" renderer is an optional, alternative visual style, and introducing it provided a means for Blockly to get a lot more ability for customized styling. If you don't like it, you have other choices.

/s/ Adam

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.

Ray gautam

unread,
Feb 13, 2020, 1:28:42 AM2/13/20
to Blockly
I checked how makecode.com makes it array list , and what they were implementing was the "INLINE INPUTS" on the block and not giving them option to switch to "EXTERNAL INPUTS" , overall i would still say making it center align , seems pretty bad, :(

Ray gautam

unread,
Feb 13, 2020, 1:29:26 AM2/13/20
to Blockly
I AGREE, but still we need to make zelos look brighter :)
To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages