Skip to content

Commit f983f44

Browse files
Make toasts less offensive
The number of lines shown for toast and log messages could be felt to be too offensive, this PR makes the number of lines choosable via preferences between 0 (down't show any) and a max of 8. Fixes comments in darktable-org#16967
1 parent 38a6736 commit f983f44

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

data/darktableconfig.xml.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,13 @@
22772277
<shortdescription>duration of the UI transitions in ms</shortdescription>
22782278
<longdescription>how long the transitions take (in ms) for expanding or collapsing modules and other UI elements</longdescription>
22792279
</dtconfig>
2280+
<dtconfig prefs="misc" section="interface">
2281+
<name>message_list_length</name>
2282+
<type min="0" max="8">int</type>
2283+
<default>1</default>
2284+
<shortdescription>number of message lines</shortdescription>
2285+
<longdescription>how many message lines should be shown</longdescription>
2286+
</dtconfig>
22802287
<dtconfig>
22812288
<name>ui/style/preview_size</name>
22822289
<type min="100" max="500">int</type>

src/gui/gtk.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,8 +2648,9 @@ static void _ui_log_redraw_callback(gpointer instance,
26482648
dt_pthread_mutex_lock(&darktable.control->log_mutex);
26492649
if(darktable.control->log_ack != darktable.control->log_pos)
26502650
{
2651+
const int numlines = MAX(0, MIN(DT_CTL_TOAST_SIZE, dt_conf_get_int("message_list_length")));
26512652
const uint32_t first_message = MAX(darktable.control->log_ack,
2652-
darktable.control->log_pos - DT_CTL_LOG_SIZE + 1);
2653+
darktable.control->log_pos - numlines);
26532654
gchar *message = g_malloc(ALLMESSSIZE);
26542655
if(message)
26552656
{
@@ -2686,8 +2687,9 @@ static void _ui_toast_redraw_callback(gpointer instance,
26862687
dt_pthread_mutex_lock(&darktable.control->toast_mutex);
26872688
if(darktable.control->toast_ack != darktable.control->toast_pos)
26882689
{
2690+
const int numlines = MAX(0, MIN(DT_CTL_TOAST_SIZE, dt_conf_get_int("message_list_length")));
26892691
const uint32_t first_message = MAX(darktable.control->toast_ack,
2690-
darktable.control->toast_pos - DT_CTL_TOAST_SIZE + 1);
2692+
darktable.control->toast_pos - numlines);
26912693
gchar *message = g_malloc(ALLMESSSIZE);
26922694
if(message)
26932695
{

0 commit comments

Comments
 (0)