app: base the line width defaults for strokes on the screen resolution.

This value could be based on either the x or y resolution, or maybe some
kind of mean values. It could also be based off the print resolution of
any image (if the user sets a physical dimension, the actual pixel width
will vary depending on the print resolution). There is no actual "good"
answer here. But any of these values will be better than a default 96.0.
This commit is contained in:
Jehan
2017-03-23 01:43:49 +01:00
parent c97209ba4a
commit 4beff2fa60

View File

@ -978,6 +978,8 @@ prefs_dialog_new (Gimp *gimp,
GtkWidget *calibrate_button; GtkWidget *calibrate_button;
GSList *group; GSList *group;
GtkWidget *editor; GtkWidget *editor;
gdouble xres;
gdouble yres;
gint i; gint i;
GObject *object; GObject *object;
@ -991,6 +993,10 @@ prefs_dialog_new (Gimp *gimp,
core_config = GIMP_CORE_CONFIG (config); core_config = GIMP_CORE_CONFIG (config);
display_config = GIMP_DISPLAY_CONFIG (config); display_config = GIMP_DISPLAY_CONFIG (config);
gimp_get_monitor_resolution (gdk_screen_get_default (), /* FIXME monitor */
0, /* FIXME monitor */
&xres, &yres);
dialog = gimp_dialog_new (_("Preferences"), "gimp-preferences", dialog = gimp_dialog_new (_("Preferences"), "gimp-preferences",
NULL, 0, NULL, 0,
prefs_help_func, prefs_help_func,
@ -2114,8 +2120,12 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Stroke Selection & Stroke Path Dialogs"), vbox2 = prefs_frame_new (_("Stroke Selection & Stroke Path Dialogs"),
GTK_CONTAINER (vbox), FALSE); GTK_CONTAINER (vbox), FALSE);
/* The stroke line width physical values could be based on either the
* x or y resolution, some average, or whatever which makes a bit of
* sense. There is no perfect answer. So let's just use whatever.
*/
table = gimp_stroke_editor_new (GIMP_DIALOG_CONFIG (object)->stroke_options, table = gimp_stroke_editor_new (GIMP_DIALOG_CONFIG (object)->stroke_options,
96.0 /* FIXME */, FALSE); yres, FALSE);
gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 0);
gtk_widget_show (table); gtk_widget_show (table);
@ -2287,13 +2297,8 @@ prefs_dialog_new (Gimp *gimp,
group = NULL; group = NULL;
{ {
gdouble xres, yres;
gchar *str; gchar *str;
gimp_get_monitor_resolution (gdk_screen_get_default (), /* FIXME monitor */
0, /* FIXME monitor */
&xres, &yres);
str = g_strdup_printf (_("_Detect automatically (currently %d × %d ppi)"), str = g_strdup_printf (_("_Detect automatically (currently %d × %d ppi)"),
ROUND (xres), ROUND (yres)); ROUND (xres), ROUND (yres));