Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some GUI proposal for the script manager #438

Closed
TurboGit opened this issue Dec 20, 2023 · 13 comments · Fixed by #474
Closed

Some GUI proposal for the script manager #438

TurboGit opened this issue Dec 20, 2023 · 13 comments · Fixed by #474

Comments

@TurboGit
Copy link
Member

The current script manager looks like:

image

I find it hard to read each line and do proper separation between the script name and the status.

A proposal would be to left align the script name and right align the status and possibly use some symbol for started / stopped.

@wpferguson
Copy link
Member

Let's work on status first...

The buttons can be styled using CSS.

Add this to your user.css to control the color of the labels (red for stopped, green for running):

button#sm_started label { color: rgb(50,210,50); }
button#sm_stopped label { color: rgb(210,50,50); }

colorlabels

or if you'd rather have the button background turn colors:

button#sm_started label { background: rgb(0,128,0);
			 font-weight: bold; }

button#sm_stopped label { color: rgb(128,0,0);
			 font-weight: bold; }

colorbkgd

You also need to drop down the start/stop scripts combobox and select configure, then click the use color interface? checkbox.
colorinf

The buttons in the lua API currently only support ellipsize as an argument. I'd have to change the API and add halign. I agree that they are hard to read with each line starting in a different place.

Probably the best solution to the just text configuration would be a table on each button with the name left aligned and the status right aligned. I'll play with it and see if I can pass a widget to the button creation.

@wpferguson
Copy link
Member

wpferguson commented Dec 21, 2023

Added left align

leftalign

with color

leftaligncolor

EDIT: Probably need to change the colors a little bit with the default theme :)

@TurboGit
Copy link
Member Author

I'm not convinced with the color :)

What about just making the background as "selected" button on dt interface?

@TurboGit
Copy link
Member Author

I was initially thinking about something like this:

292300579-42eabdbe-0f7b-4609-ab8c-dd0f200a7ae8

@wpferguson
Copy link
Member

More thoughts....

Changed the color to shades of gray to show on/off

grays

I also added an image option to button so that I can do a box with a button on the left and a label on the right

|--------------------------------------|
| image button | label             |
|--------------------------------------|

that looks like this...

poweroff

poweron

the problem being that the box isn't fixed size and my GTK CSS skills suck :)

@wpferguson
Copy link
Member

Another try...

If I turn off box padding and fill I can get

latest

Looks like another API change.... :)

@TurboGit
Copy link
Member Author

Oh yes, I love this last version. It fits really well into darktable GUI.

I really think that the Lua plug-ins should be more first class citizen and we should put effort on making it more integrated. So there is the GUI, hence my proposal here and the translation.

The fact that there is no translation make some label in English and all lower case in the now capitalized French UI (and of course this is true for all languages I suppose).

What can we do to improve this? (maybe need another issue to discuss this).

@TurboGit
Copy link
Member Author

TurboGit commented Jan 17, 2024

For Lua being a first class citizen, I'd propose the following:

  1. make the tooltip describing the script structured, we have:

image

or

image

That is, the section (USAGE) is surrounded by -- or nothing. We have paragraphs starting with * or 1)...

So maybe we need a structured way to describe a modules (like dt modules) and have the Lua manager use the same layout.

In dt each IOP give a set of strings but the layout is done by dt. For example in Crop module we have:

const char **description(struct dt_iop_module_t *self)
{
  return dt_iop_set_description(self,
                                _("change the framing"),
                                _("corrective or creative"),
                                _("linear, RGB, scene-referred"),
                                _("geometric, RGB"),
                                _("linear, RGB, scene-referred"));
}

Maybe something similar would work too for Lua.

For the translation, I'm not sure yet but maybe if we set the lua Git repository as sub-project we can use the main dt translation support also for Lua. Would that be ok with you? I can experiment and see if it works.

@TurboGit
Copy link
Member Author

@wpferguson : For the translation, how to tell the Lua scripts to look for the darktable .mo files?

@wpferguson
Copy link
Member

The way I get the current tooltip is by grabbing the comments at the start of the file and using a regular expression to pull out the description.

I've thought about using a table to organize the information, but in order to access the table I'd have to run the script. I just had a thought to see if there is a way to load the script without running it which might make the data available. I'd like to keep the scripts self documenting if at all possible.

@wpferguson
Copy link
Member

I figured out a way to get the data from the script.

I can create a code snippet in the file like

script_data.description = {
	name = "this is the name",
        purpose = "this is the purpose",
        author = "this is the author",
        something_else = "this is something_else",
}

I can grab that out of the script and write it to a temporary file, then import it using dofile("tmpfile")to fill in whatever information we need.

@wpferguson
Copy link
Member

progress

Got the button interface working.

Figured out how to pass the description

script_data.metadata = {
  name = "clear_GPS",
  purpose = _("remove GPS data from selected image(s)"),
  author = "Bill Ferguson <wpferguson@gmail.com",
  help = "https://docs.darktable.org/lua/stable/lua.scripts.manual/scripts/contrib/clear_gps/"
}

I'm using user.css to hold the css. Should I add it to the themes?

@wpferguson
Copy link
Member

Actually closed by #479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants