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

git pushed a commit to branch tymux-10-quiet-head
in repository terminology.

View the commit online.

commit 3202454739fba8df4e81c11c15e2472a79506fb8
Author: Boris Faure <[email protected]>
AuthorDate: Sat Oct 31 22:16:41 2026 +0000

    data/themes: add a progress bar to the background
    
    A 3px bar along the bottom edge of the terminal, shown on
    progress,normal/error/paused/indeterminate and faded out on
    progress,none (all source terminology). The fill's width is set from C
    with edje_object_part_drag_size_set() on the dragable fill part; error
    and paused switch its colour class. The bar is translucent so the bottom
    row stays readable, and the track takes the FG colour so it suits light
    and dark schemes.
    
    The fill's dragable confine is an invisible spacer, with the visible
    track as a separate part: Edje does not draw a part used as a confine.
    
    Normal and paused fills carry diagonal stripes; error stays solid so a
    failed job reads as stopped. Indeterminate fills the whole track. The
    stripes of normal and indeterminate scroll, but only while the terminal
    is focused and for 10s after the state or focus changed: a long build
    would otherwise redraw the window all along. Repeated reports of the same
    state do not restart that delay. It is all Edje, no C timer.
    
    Colours are the BG_PROGRESS{,_ERROR,_PAUSED} classes, so a color scheme
    can restate them like BG_SENDFILE. nyanology does not duplicate the
    background group, so it picks the parts up through the theme fallback.
---
 data/themes/default.edc                 |   1 +
 data/themes/default/background.edc      |  78 ++++++++++++
 data/themes/default/colors.edc          |   4 +
 data/themes/default/progress.edc        | 202 ++++++++++++++++++++++++++++++++
 data/themes/images/progress_stripes.png | Bin 0 -> 88 bytes
 data/themes/meson.build                 |   1 +
 6 files changed, 286 insertions(+)

diff --git a/data/themes/default.edc b/data/themes/default.edc
index d942178a..d51096b4 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -215,6 +215,7 @@ collections {
    #include "default/keybinding.edc"
    #include "default/miniview.edc"
    #include "default/core.edc"
+   #include "default/progress.edc"
    #include "default/background.edc"
    #include "default/tabbar_back.edc"
    #include "default/base.edc"
diff --git a/data/themes/default/background.edc b/data/themes/default/background.edc
index 5a9f1e14..0b5a2937 100644
--- a/data/themes/default/background.edc
+++ b/data/themes/default/background.edc
@@ -1,4 +1,5 @@
 //// the background and general container for the terminal
+#define PROGRESS_ANIM_IDLE 10.0
 group { name: "terminology/background";
    images {
       image: "pm_shadow.png" COMP;
@@ -21,6 +22,41 @@ group { name: "terminology/background";
    }
 
    script {
+      PROGRESS_SCRIPT
+      public progress_focused;
+      public progress_idle_timer;
+
+      public progress_idle(val) {
+         set_int(progress_idle_timer, 0);
+         run_program(PROGRAM:"progress_anim_stop");
+      }
+      /* stripes move while focused, for PROGRESS_ANIM_IDLE seconds after
+       * the state or the focus changed, to save redraws */
+      public progress_anim_update() {
+         new t = get_int(progress_idle_timer);
+         new s = get_int(progress_state);
+
+         if (t) {
+            cancel_timer(t);
+            set_int(progress_idle_timer, 0);
+         }
+         if (get_int(progress_focused) &&
+             ((s == PROGRESS_NORMAL) || (s == PROGRESS_INDETERMINATE))) {
+            run_program(PROGRAM:"progress_anim_start");
+            set_int(progress_idle_timer,
+                    timer(PROGRESS_ANIM_IDLE, "progress_idle", 0));
+         } else {
+            run_program(PROGRAM:"progress_anim_stop");
+         }
+      }
+      public progress_state_changed() {
+         progress_anim_update();
+      }
+      public progress_focus_set(f) {
+         set_int(progress_focused, f);
+         progress_anim_update();
+      }
+
       public message(Msg_Type:type, id, ...) {
          new r, g, b, a, v;
 
@@ -414,6 +450,48 @@ group { name: "terminology/background";
       // }}}
 
       ////////////////////////////////////////////////////////////////////
+      ////////////////////////////////////////////////////////////////////
+      // OSC 9;4 progress indicator {{{
+      PROGRESS_BAR("terminology.content", 3)
+      program { signal: "focus,in"; source: "terminology";
+         script { progress_focus_set(1); }
+      }
+      program { signal: "focused,set"; source: "terminology";
+         script { progress_focus_set(1); }
+      }
+      program { signal: "focus,out"; source: "terminology";
+         script { progress_focus_set(0); }
+      }
+      program { name: "progress_anim_start";
+         action: ACTION_STOP;
+         target: "progress_stripes_loop";
+         target: "progress_stripes_back";
+         after: "progress_stripes_back";
+      }
+      program { name: "progress_anim_stop";
+         action: ACTION_STOP;
+         target: "progress_stripes_loop";
+         target: "progress_stripes_back";
+         after: "progress_stripes_rest";
+      }
+      program { name: "progress_stripes_rest";
+         action: STATE_SET "default" 0.0;
+         target: "progress_stripes";
+      }
+      /* one stripe period per step, so the loop is seamless */
+      program { name: "progress_stripes_loop";
+         action: STATE_SET "moved" 0.0;
+         transition: LINEAR 0.6;
+         target: "progress_stripes";
+         after: "progress_stripes_back";
+      }
+      program { name: "progress_stripes_back";
+         action: STATE_SET "default" 0.0;
+         target: "progress_stripes";
+         after: "progress_stripes_loop";
+      }
+      // }}}
+
       // miniview {{{
       part { name: "terminology.miniview"; type: SWALLOW;
          description { state: "default" 0.0;
diff --git a/data/themes/default/colors.edc b/data/themes/default/colors.edc
index 4edfb558..5193d909 100644
--- a/data/themes/default/colors.edc
+++ b/data/themes/default/colors.edc
@@ -3,6 +3,10 @@ color_class { name: "HIGHLIGHT";  color: 255 255 255 255; }
 
 color_class { name: "BG_SENDFILE";      color:  64  64  64 255; }
 
+color_class { name: "BG_PROGRESS";       color:  64 160 255 255; }
+color_class { name: "BG_PROGRESS_ERROR"; color: 255  64  64 255; }
+color_class { name: "BG_PROGRESS_PAUSED"; color: 255 200  64 255; }
+
 color_class { name: "BG";               color:  32  32  32 255; }
 color_class { name: "FG";               color: 170 170 170 255; }
 color_class { name: "CURSOR";           color: 255 255 255 255; }
diff --git a/data/themes/default/progress.edc b/data/themes/default/progress.edc
new file mode 100644
index 00000000..3bc625d2
--- /dev/null
+++ b/data/themes/default/progress.edc
@@ -0,0 +1,202 @@
+//// OSC 9;4 progress bar, shared by the background, the tab buttons and
+//// the tab selector items
+#define PROGRESS_NONE 0
+#define PROGRESS_NORMAL 1
+#define PROGRESS_ERROR 2
+#define PROGRESS_INDETERMINATE 3
+#define PROGRESS_PAUSED 4
+#define PROGRESS_ALPHA 160
+
+/* for the group's script block; the group defines
+ * progress_state_changed(), run once per actual state change */
+#define PROGRESS_SCRIPT \
+      public progress_state; \
+      public progress_state_set(s) { \
+         if (get_int(progress_state) == s) \
+           return; \
+         set_int(progress_state, s); \
+         if (s == PROGRESS_NORMAL) \
+           run_program(PROGRAM:"progress_show_normal"); \
+         else if (s == PROGRESS_ERROR) \
+           run_program(PROGRAM:"progress_show_error"); \
+         else if (s == PROGRESS_PAUSED) \
+           run_program(PROGRAM:"progress_show_paused"); \
+         else if (s == PROGRESS_INDETERMINATE) \
+           run_program(PROGRAM:"progress_show_indeterminate"); \
+         else \
+           run_program(PROGRAM:"progress_hide"); \
+         progress_state_changed(); \
+      }
+
+/* a _h pixels high bar along the bottom of _anchor; C sets the width of
+ * terminology.progress.fill with edje_object_part_drag_size_set().
+ * The fill's dragable confine is an invisible spacer: Edje does not draw
+ * a part used as a confine. */
+#define PROGRESS_BAR(_anchor, _h) \
+      images.image: "progress_stripes.png" COMP; \
+      part { name: "progress_area"; type: SPACER; \
+         description { state: "default" 0.0; \
+            fixed: 1 1; \
+            rel1.to: _anchor; \
+            rel1.relative: 0.0 1.0; \
+            rel1.offset: 0 (-_h); \
+            rel2.to: _anchor; \
+            rel2.relative: 1.0 1.0; \
+            rel2.offset: -1 -1; \
+         } \
+      } \
+      part { name: "progress_track"; type: RECT; \
+         mouse_events: 0; \
+         description { state: "default" 0.0; \
+            rel.to: "progress_area"; \
+            color: 255 255 255 0; \
+            color_class: "FG"; \
+            visible: 0; \
+         } \
+         description { state: "on" 0.0; \
+            inherit: "default" 0.0; \
+            color: 255 255 255 48; \
+            visible: 1; \
+         } \
+         description { state: "busy" 0.0; \
+            inherit: "default" 0.0; \
+            color: 255 255 255 PROGRESS_ALPHA; \
+            color_class: "BG_PROGRESS"; \
+            visible: 1; \
+         } \
+      } \
+      part { name: "terminology.progress.fill"; type: RECT; \
+         mouse_events: 0; \
+         dragable.x: 1 1 0; \
+         dragable.confine: "progress_area"; \
+         description { state: "default" 0.0; \
+            fixed: 1 1; \
+            rel.to: "progress_area"; \
+            color: 255 255 255 0; \
+            color_class: "BG_PROGRESS"; \
+            visible: 0; \
+         } \
+         description { state: "on" 0.0; \
+            inherit: "default" 0.0; \
+            color: 255 255 255 PROGRESS_ALPHA; \
+            visible: 1; \
+         } \
+         description { state: "error" 0.0; \
+            inherit: "on" 0.0; \
+            color_class: "BG_PROGRESS_ERROR"; \
+         } \
+         description { state: "paused" 0.0; \
+            inherit: "on" 0.0; \
+            color_class: "BG_PROGRESS_PAUSED"; \
+         } \
+      } \
+      part { name: "progress_stripes_clip"; type: RECT; \
+         description { state: "default" 0.0; \
+            rel.to: "terminology.progress.fill"; \
+            color: 255 255 255 0; \
+            visible: 0; \
+         } \
+         description { state: "fill" 0.0; \
+            inherit: "default" 0.0; \
+            color: 255 255 255 255; \
+            visible: 1; \
+         } \
+         description { state: "busy" 0.0; \
+            inherit: "fill" 0.0; \
+            rel.to: "progress_area"; \
+         } \
+      } \
+      part { name: "progress_stripes"; \
+         mouse_events: 0; \
+         clip_to: "progress_stripes_clip"; \
+         description { state: "default" 0.0; \
+            rel.to: "progress_area"; \
+            image.normal: "progress_stripes.png"; \
+            fill.smooth: 0; \
+            fill.size.relative: 0.0 0.0; \
+            fill.size.offset: 8 4; \
+            color: 255 255 255 80; \
+         } \
+         description { state: "moved" 0.0; \
+            inherit: "default" 0.0; \
+            fill.origin.offset: 8 0; \
+         } \
+      } \
+      program { signal: "progress,none"; source: "terminology"; \
+         script { progress_state_set(PROGRESS_NONE); } \
+      } \
+      program { signal: "progress,normal"; source: "terminology"; \
+         script { progress_state_set(PROGRESS_NORMAL); } \
+      } \
+      program { signal: "progress,error"; source: "terminology"; \
+         script { progress_state_set(PROGRESS_ERROR); } \
+      } \
+      program { signal: "progress,indeterminate"; source: "terminology"; \
+         script { progress_state_set(PROGRESS_INDETERMINATE); } \
+      } \
+      program { signal: "progress,paused"; source: "terminology"; \
+         script { progress_state_set(PROGRESS_PAUSED); } \
+      } \
+      program { name: "progress_show_normal"; \
+         action: STATE_SET "on" 0.0; \
+         transition: DECELERATE 0.3; \
+         target: "progress_track"; \
+         after: "progress_fill_on"; \
+         after: "progress_stripes_on_fill"; \
+      } \
+      program { name: "progress_show_error"; \
+         action: STATE_SET "on" 0.0; \
+         transition: DECELERATE 0.3; \
+         target: "progress_track"; \
+         after: "progress_fill_error"; \
+         after: "progress_stripes_hide"; \
+      } \
+      program { name: "progress_show_paused"; \
+         action: STATE_SET "on" 0.0; \
+         transition: DECELERATE 0.3; \
+         target: "progress_track"; \
+         after: "progress_fill_paused"; \
+         after: "progress_stripes_on_fill"; \
+      } \
+      program { name: "progress_show_indeterminate"; \
+         action: STATE_SET "busy" 0.0; \
+         transition: DECELERATE 0.3; \
+         target: "progress_track"; \
+         after: "progress_fill_hide"; \
+         after: "progress_stripes_on_track"; \
+      } \
+      program { name: "progress_hide"; \
+         action: STATE_SET "default" 0.0; \
+         transition: DECELERATE 0.3; \
+         target: "progress_track"; \
+         target: "terminology.progress.fill"; \
+         target: "progress_stripes_clip"; \
+      } \
+      program { name: "progress_fill_on"; \
+         action: STATE_SET "on" 0.0; \
+         target: "terminology.progress.fill"; \
+      } \
+      program { name: "progress_fill_error"; \
+         action: STATE_SET "error" 0.0; \
+         target: "terminology.progress.fill"; \
+      } \
+      program { name: "progress_fill_paused"; \
+         action: STATE_SET "paused" 0.0; \
+         target: "terminology.progress.fill"; \
+      } \
+      program { name: "progress_fill_hide"; \
+         action: STATE_SET "default" 0.0; \
+         target: "terminology.progress.fill"; \
+      } \
+      program { name: "progress_stripes_on_fill"; \
+         action: STATE_SET "fill" 0.0; \
+         target: "progress_stripes_clip"; \
+      } \
+      program { name: "progress_stripes_on_track"; \
+         action: STATE_SET "busy" 0.0; \
+         target: "progress_stripes_clip"; \
+      } \
+      program { name: "progress_stripes_hide"; \
+         action: STATE_SET "default" 0.0; \
+         target: "progress_stripes_clip"; \
+      }
diff --git a/data/themes/images/progress_stripes.png b/data/themes/images/progress_stripes.png
new file mode 100644
index 00000000..11f1647e
Binary files /dev/null and b/data/themes/images/progress_stripes.png differ
diff --git a/data/themes/meson.build b/data/themes/meson.build
index eaef201b..7dce63e8 100644
--- a/data/themes/meson.build
+++ b/data/themes/meson.build
@@ -12,6 +12,7 @@ default_deps = [
   'default/keybinding.edc',
   'default/miniview.edc',
   'default/core.edc',
+  'default/progress.edc',
   'default/background.edc',
   'default/tabbar_back.edc',
   'default/base.edc',

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

Reply via email to