Closed TurboGit closed 1 month ago
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); }
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; }
You also need to drop down the start/stop scripts
combobox and select configure, then click the use color interface?
checkbox.
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.
Added left align
with color
EDIT: Probably need to change the colors a little bit with the default theme :)
I'm not convinced with the color :)
What about just making the background as "selected" button on dt interface?
I was initially thinking about something like this:
More thoughts....
Changed the color to shades of gray to show on/off
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...
the problem being that the box isn't fixed size and my GTK CSS skills suck :)
Another try...
If I turn off box padding and fill I can get
Looks like another API change.... :)
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).
For Lua being a first class citizen, I'd propose the following:
or
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.
@wpferguson : For the translation, how to tell the Lua scripts to look for the darktable .mo
files?
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.
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.
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?
Actually closed by #479
The current script manager looks like:
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.