This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository edi.

View the commit online.

commit 69c546bbe5caf489740460f6eb46d80fc6c7587f
Author: Alastair Poole <[email protected]>
AuthorDate: Wed Apr 15 22:14:51 2026 +0100

    panel: ensure elm_code* panels render background.
    
    Ensure when initialised or empty the panels render the
    background in the widget, this is much cleaner visually.
---
 src/bin/edi_consolepanel.c | 38 +++++++++++++++++++++++++++++++++++++-
 src/bin/edi_logpanel.c     | 28 ++++++++++++++++++++++++++++
 src/bin/edi_searchpanel.c  | 34 +++++++++++++++++++++++++++++++++-
 3 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/src/bin/edi_consolepanel.c b/src/bin/edi_consolepanel.c
index 3f40208..677d82c 100644
--- a/src/bin/edi_consolepanel.c
+++ b/src/bin/edi_consolepanel.c
@@ -32,6 +32,32 @@ static int _edi_test_fail;
 static Elm_Code *_edi_test_code, *_edi_console_code;
 static void _edi_test_line_callback(const char *content);
 
+static void
+_edi_code_file_placeholder_set(Elm_Code_File *file)
+{
+   if (elm_code_file_lines_get(file) == 0)
+     elm_code_file_line_append(file, "", 0, NULL);
+}
+
+static void
+_edi_code_file_placeholder_clear(Elm_Code_File *file)
+{
+   Elm_Code_Line *line;
+   const char *text;
+   unsigned int length = 0;
+
+   if (elm_code_file_lines_get(file) != 1)
+     return;
+
+   line = elm_code_file_line_get(file, 1);
+   if (!line)
+     return;
+
+   text = elm_code_line_text_get(line, &length);
+   if (text && length == 0)
+     elm_code_file_clear(file);
+}
+
 static Eina_Bool
 _edi_consolepanel_startswith_location(const char *line)
 {
@@ -128,6 +154,7 @@ _edi_consolepanel_line_cb(void *data EINA_UNUSED, const Efl_Event *event)
 static void _edi_consolepanel_append_line_type(const char *line, Eina_Bool err)
 {
    _edi_consolepanel_parse_directory(line);
+   _edi_code_file_placeholder_clear(_edi_console_code->file);
 
    elm_code_file_line_append(_edi_console_code->file, line, strlen(line),
                              err && _current_dir ? strdup(_current_dir) : NULL);
@@ -149,6 +176,8 @@ void edi_consolepanel_clear()
 {
    elm_code_file_clear(_edi_console_code->file);
    elm_code_file_clear(_edi_test_code->file);
+   _edi_code_file_placeholder_set(_edi_console_code->file);
+   _edi_code_file_placeholder_set(_edi_test_code->file);
 
    _edi_test_count = _edi_test_pass = _edi_test_fail = 0;
 }
@@ -168,6 +197,7 @@ _edi_test_output_suite(int count, int pass, int fail)
      percent = (int) ((pass / (double) count) * 100);
 
    snprintf(line, linemax, format, pass, percent, fail);
+   _edi_code_file_placeholder_clear(_edi_test_code->file);
    elm_code_file_line_append(_edi_test_code->file, line, strlen(line), (fail > 0) ? _EDI_SUITE_FAILED : _EDI_SUITE_PASSED);
    free(line);
 }
@@ -265,17 +295,20 @@ _edi_test_line_parse_suite(const char *path)
           {
              _edi_test_count++;
              _edi_test_fail++;
+             _edi_code_file_placeholder_clear(_edi_test_code->file);
              elm_code_file_line_append(_edi_test_code->file, line->start, line->length, strdup(_current_test_dir));
           }
         else if (_edi_test_line_contains(line->start, line->length, ":E:"))
           {
              _edi_test_count++;
              _edi_test_fail++;
+             _edi_code_file_placeholder_clear(_edi_test_code->file);
              elm_code_file_line_append(_edi_test_code->file, line->start, line->length, strdup(_current_test_dir));
           }
         else if (_edi_test_line_contains(line->start, line->length, "Running"))
           {
              _edi_test_count = _edi_test_pass = _edi_test_fail = 0;
+             _edi_code_file_placeholder_clear(_edi_test_code->file);
              elm_code_file_line_append(_edi_test_code->file, line->start, line->length, NULL);
           }
      }
@@ -331,12 +364,14 @@ static void _edi_test_line_callback(const char *content)
      {
         _edi_test_pass++;
 
+        _edi_code_file_placeholder_clear(_edi_test_code->file);
         elm_code_file_line_append(_edi_test_code->file, content + 10, strlen(content) - 10, _EDI_SUITE_PASSED);
      }
    else if (!strncmp(content, "--- FAIL:", 9))
      {
         _edi_test_fail++;
 
+        _edi_code_file_placeholder_clear(_edi_test_code->file);
         elm_code_file_line_append(_edi_test_code->file, content + 10, strlen(content) - 10, _EDI_SUITE_FAILED);
      }
 }
@@ -372,6 +407,7 @@ void edi_consolepanel_add(Evas_Object *parent)
 
    code = elm_code_create();
    _edi_console_code = code;
+   _edi_code_file_placeholder_set(code->file);
 
    frame = elm_frame_add(parent);
    elm_object_text_set(frame, _("Console"));
@@ -407,6 +443,7 @@ void edi_testpanel_add(Evas_Object *parent)
 
    code = elm_code_create();
    _edi_test_code = code;
+   _edi_code_file_placeholder_set(code->file);
 
    frame = elm_frame_add(parent);
    elm_object_text_set(frame, _("Tests"));
@@ -428,4 +465,3 @@ void edi_testpanel_add(Evas_Object *parent)
    elm_object_content_set(frame, widget);
    elm_box_pack_end(parent, frame);
 }
-
diff --git a/src/bin/edi_logpanel.c b/src/bin/edi_logpanel.c
index 425caae..f4e9e82 100644
--- a/src/bin/edi_logpanel.c
+++ b/src/bin/edi_logpanel.c
@@ -17,6 +17,32 @@
 static Evas_Object *_info_widget;
 static Elm_Code *_elm_code;
 
+static void
+_edi_logpanel_placeholder_set(void)
+{
+   if (elm_code_file_lines_get(_elm_code->file) == 0)
+     elm_code_file_line_append(_elm_code->file, "", 0, NULL);
+}
+
+static void
+_edi_logpanel_placeholder_clear(void)
+{
+   Elm_Code_Line *line;
+   const char *text;
+   unsigned int length = 0;
+
+   if (elm_code_file_lines_get(_elm_code->file) != 1)
+     return;
+
+   line = elm_code_file_line_get(_elm_code->file, 1);
+   if (!line)
+     return;
+
+   text = elm_code_line_text_get(line, &length);
+   if (text && length == 0)
+     elm_code_file_clear(_elm_code->file);
+}
+
 static Eina_Bool
 _edi_logpanel_ignore(Eina_Log_Level level, const char *domain, const char *fnc)
 {
@@ -52,6 +78,7 @@ _edi_logpanel_print_cb(const Eina_Log_Domain *domain, Eina_Log_Level level,
    vsnprintf(buffer + printed, buffer_len - printed, fmt, args);
 
    ecore_thread_main_loop_begin();
+   _edi_logpanel_placeholder_clear();
 
    elm_code_file_line_append(_elm_code->file, buffer, strlen(buffer),
                              (level <= EINA_LOG_LEVEL_ERR) ? _EDI_LOG_ERROR : NULL);
@@ -103,6 +130,7 @@ void edi_logpanel_add(Evas_Object *parent)
 
    _elm_code = code;
    _info_widget = widget;
+   _edi_logpanel_placeholder_set();
 
    eina_log_print_cb_set(_edi_logpanel_print_cb, NULL);
    eina_log_color_disable_set(EINA_TRUE);
diff --git a/src/bin/edi_searchpanel.c b/src/bin/edi_searchpanel.c
index 658f31c..4debc62 100644
--- a/src/bin/edi_searchpanel.c
+++ b/src/bin/edi_searchpanel.c
@@ -23,6 +23,32 @@ static Ecore_Thread *_search_thread = NULL;
 static Eina_Bool _searching = EINA_FALSE;
 static char *_search_text = NULL;
 
+static void
+_edi_searchpanel_placeholder_set(Elm_Code *code)
+{
+   if (elm_code_file_lines_get(code->file) == 0)
+     elm_code_file_line_append(code->file, "", 0, NULL);
+}
+
+static void
+_edi_searchpanel_placeholder_clear(Elm_Code *code)
+{
+   Elm_Code_Line *line;
+   const char *text;
+   unsigned int length = 0;
+
+   if (elm_code_file_lines_get(code->file) != 1)
+     return;
+
+   line = elm_code_file_line_get(code->file, 1);
+   if (!line)
+     return;
+
+   text = elm_code_line_text_get(line, &length);
+   if (text && length == 0)
+     elm_code_file_clear(code->file);
+}
+
 static Eina_Bool
 _edi_searchpanel_config_changed_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
 {
@@ -109,6 +135,8 @@ _edi_searchpanel_line_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event)
 
    line = (Elm_Code_Line *) event->info;
    filename_end = line_start = NULL;
+   if (!line->data)
+     return;
 
    path = strdup(line->data);
    if (!path) return;
@@ -425,6 +453,7 @@ main_loop_line_append_async(void *data)
    Async_Log *log = data;
    Async_Item *item;
 
+   _edi_searchpanel_placeholder_clear(log->logger);
    while ((item = eina_inarray_pop(&log->texts)))
      {
         elm_code_file_line_append(log->logger->file, item->text, item->length,
@@ -630,6 +659,7 @@ edi_searchpanel_find(const char *text)
    path = edi_project_get();
 
    elm_code_file_clear(_elm_code->file);
+   _edi_searchpanel_placeholder_set(_elm_code);
    elm_object_text_set(_button_search, _("Cancel"));
 
    _searching = EINA_TRUE;
@@ -691,6 +721,7 @@ edi_searchpanel_add(Evas_Object *parent)
 
    _elm_code = code;
    _info_widget = widget;
+   _edi_searchpanel_placeholder_set(_elm_code);
    eina_spinlock_new(&logs_lock);
 
    elm_box_pack_end(hbox, entry);
@@ -752,6 +783,7 @@ edi_taskspanel_find(void)
    if (_searching) return;
 
    elm_code_file_clear(_tasks_code->file);
+   _edi_searchpanel_placeholder_set(_tasks_code);
 
    path = edi_project_get();
 
@@ -792,10 +824,10 @@ edi_taskspanel_add(Evas_Object *parent)
 
    _tasks_code = code;
    _tasks_widget = widget;
+   _edi_searchpanel_placeholder_set(_tasks_code);
 
    elm_object_content_set(frame, widget);
    elm_box_pack_end(parent, frame);
 
    ecore_event_handler_add(EDI_EVENT_CONFIG_CHANGED, _edi_taskspanel_config_changed_cb, NULL);
 }
-

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to