summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-29 00:56:54 +0800
committerruki <[email protected]>2025-10-29 10:37:58 +0800
commitb0d93f0996b95ee5e74b0ddbca3237d7734a789f (patch)
treebbece1a85f85d6bad5e5f8a8d1111db9821ff58c
parentbfb71ee9883ac2d0e115913f089bef36899645c2 (diff)
improve theme
-rw-r--r--xmake/modules/utils/progress.lua8
-rw-r--r--xmake/themes/default/xmake.lua3
2 files changed, 6 insertions, 5 deletions
diff --git a/xmake/modules/utils/progress.lua b/xmake/modules/utils/progress.lua
index 28e1a7eb9..6a8d9e156 100644
--- a/xmake/modules/utils/progress.lua
+++ b/xmake/modules/utils/progress.lua
@@ -153,7 +153,6 @@ function _show_progress_with_multirow_refresh(progress, format, ...)
if progress_lineinfos == nil then
progress_lineinfos = {}
_g.progress_lineinfos = progress_lineinfos
- tty.cursor_hide()
is_first = true
end
@@ -172,11 +171,11 @@ function _show_progress_with_multirow_refresh(progress, format, ...)
local timecolor = ""
local spent_time = lineinfo.spent_time
if spent_time > 1000 then
- timecolor = "${magenta}"
+ timecolor = "${color.build.progress_veryslow}"
elseif spent_time > 500 then
- timecolor = "${yellow}"
+ timecolor = "${color.build.progress_slow}"
end
- local subprogress_line = _strip_progress_line(vformat(" ${dim}> %s%0.02fs${clear}${dim} ", timecolor, spent_time / 1000) .. progress_msg)
+ local subprogress_line = _strip_progress_line(vformat(" > %s%0.02fs${clear} ", timecolor, spent_time / 1000) .. progress_msg)
lineinfo.progress_line = subprogress_line
local maxwidth = os.getwinsize().width
@@ -204,7 +203,6 @@ function _show_progress_with_multirow_refresh(progress, format, ...)
_g.showing_without_scroll = false
_g.progress_lineinfos = nil
_g.linecount = 0
- tty.cursor_show()
else
_g.showing_without_scroll = true
end
diff --git a/xmake/themes/default/xmake.lua b/xmake/themes/default/xmake.lua
index ee0c3a0b9..ee7533afa 100644
--- a/xmake/themes/default/xmake.lua
+++ b/xmake/themes/default/xmake.lua
@@ -45,6 +45,9 @@ theme("default")
set_text("build.progress_format", "[%3d%%]")
set_text("build.progress_style", "multirow_refresh")
set_color("build.progress", "green bright")
+ -- only for multirow_refresh
+ set_color("build.progress_veryslow", "magenta")
+ set_color("build.progress_slow", "yellow")
-- the building object file
set_color("build.object", "")