haxeui / haxeui-core

The core library of the HaxeUI framework
http://haxeui.org
MIT License
347 stars 72 forks source link

Add support to change the title if available #134

Closed elnabo closed 7 years ago

elnabo commented 7 years ago

PR Status

MSGhero commented 7 years ago

Can you add the flixel lib and just copy OpenFL's PR over, importing flash.Lib so it compiles?

elnabo commented 7 years ago

Ok it's on the todo list. Didn't see haxeui-flixel as it's not yet in the backend list.

elnabo commented 7 years ago

Are you ok on how I do it for target that do not support it such as html5 ?

MSGhero commented 7 years ago

I think it has to be defined in every backend. If that target doesn't support changing the title, it should just be blank. So yeah your HTML5 example is fine if it's not possible to change there.

elnabo commented 7 years ago

Ok, i've finished adding compatibility to all backends.

ianharrigan commented 7 years ago

So one thing, in the haxeui-html5 could possibly set the page title? That might be neat.

Another thing, i wonder if this should be an initialisation option rather than a properly on screen?

ibilon commented 7 years ago

Another thing, i wonder if this should be an initialisation option rather than a properly on screen?

It's useful to be able to change it, for instance web browser show the current tab title as window title, most editing app show the open file's name.

elnabo commented 7 years ago

So one thing, in the haxeui-html5 could possibly set the page title? That might be neat.

It could be possible to set the page title via js. However, I think you can put multiple application on the same page, so the page title doesn't really correspond to the application title. So, I'm unsure what best in this case.

ianharrigan commented 7 years ago

@ibilon - fair point, might want it to be dynamic.

@elnabo - in that case, having multiple apps on the same page, would you not just opt to not use title?

elnabo commented 7 years ago

So, changing haxeui-html5 & haxeui-pixijs to use the page title as the application title.

ianharrigan commented 7 years ago

It might make sense... i mean, if its possible, makes sense to implement in as many backends as possible.

elnabo commented 7 years ago

I've updated html5 & pixijs to use base js to change the title.

elnabo commented 7 years ago

And the others to display a warning when title cannot be changed.

ianharrigan commented 7 years ago

Ok, all looks great... so one i accept all the PRs, this can be closed, right?

elnabo commented 7 years ago

Yeah, it is what I had in mind.

ianharrigan commented 7 years ago

Single remark here, but not sure if its relevant: https://github.com/haxeui/haxeui-nme/pull/16

ianharrigan commented 7 years ago

Great... thanks @elnabo - all merged.... thanks again!