shoes / shoes4

Shoes 4 : the next version of Shoes
Other
1.59k stars 194 forks source link

Adjust the `Shoes says...` text in popups #1056

Open PragTob opened 9 years ago

PragTob commented 9 years ago

For reference we are talking about this:

Shoes 3.2: screenshot from 2015-02-11 22 45 26

On Shoes 4, right now no such text is displayed:

screenshot from 2015-02-11 22 47 17

We probably want to to introduce that and make it adjustable, though.

edit: issue came in through the mailing list:

is there a possibility maybe to change the text("Shoes says:" which comes up when shoes-alert message is called?

PragTob commented 9 years ago

I imagine that this could be implemented as a style of dialog windows :)

ccoupe commented 9 years ago

I can safely say some Shoes 3.2 folk would like to turn off the "Shoes Says" or replace it with their own phrase.

PragTob commented 9 years ago

I think turning it off through an option might be a good first step. Maybe default, but that would lose some shoeesiness - I dunno :)

ccoupe commented 9 years ago

Also it's cousin "Shoes asks". My preference would be a way to replace the phrase (they are C level app global *char).

ccoupe commented 9 years ago

May I propose :

alert("this is an alert")
alert("Your consciousness", "this is an alert")
alert("this is an alert", :notitle => true)

With one argument it would behave as normal in Shoes 3. - "Shoes says this is an alert" With two arguments it would produce "Your consciousness, this is an alert" If the second arg is :notittle => true it would produce "this is an alert"

Is this something that Shoes 4 can accept or do you have a suggestion that would work better for you?

PragTob commented 9 years ago

This seems nice :-)

I'd propose to do it all with the options hash, like:

alert("some alert", title: "this is the title")
alert("some alert", title: :none) # could also be nil

# And for app level styling I'd propose using the `style` method to change it everywhere:

style Shoes::Ask, title: "the new app wide title"
tryzniak commented 9 years ago

@PragTob +1 for the options hash.

ccoupe commented 9 years ago

The consensus at Shoes 3.2 is we like alert("some alert", title: nil) # or false and we'll do the style Shoes::Ask thing if its easy enough.

jasonrclark commented 9 years ago

:+1: for the options hash with any falsey value for :title turning it off entirely. Hopefully should be easy enough to accomplish for both dialog types in Shoes 4 (alert is a built-in SWT thing, ask is now a Shoes-based modal window).

tryzniak commented 9 years ago

I've tackled this a bit and found that the hash options are very easy to implement. In fact I've already got a solution and can send a PR. But about that style thing, if I understand how style works correctly there needs to be a separate class Shoes::Ask, but as for now all dialog windows are implemented in Shoes::Dialog. So maybe split Shoes::Dialog into several classes? Which kinda looks 'meh' to me :)

PragTob commented 9 years ago

@seethemhigh yes it'd need separate classes... it's kind of "meh" for something that is this similar in its current state but overall it is how shoes works currently, every separate thing has it's separate class. And if we want to have different options per class (one for confirm, one for ask for instance) - then I think there is hardly a way around it. Open for options and suggestions, though :)

KCErb commented 9 years ago

I think something similar is done with radio vs check. They both inherit from check_button, but have different style_with arrays. Since check and radio are so similar, check ends up being no more than a declaration of unique attributes to style_with.

I haven't looked carefully at Shoes::Dialog, so this might not apply, but I thought I'd toss my two cents in that having separate classes doesn't have to be too much code. :)