wizad: add a hint pointing to the frame when asking for frame color

pull/2088/head
Roman Perepelitsa 2 years ago
parent 5a3109e40d
commit 8c55eb4fa3

@ -988,6 +988,15 @@ function ask_color() {
return 0 return 0
} }
function print_frame_marker() {
local label="(1) $color_name[1]."
local -i n='wizard_columns - 7'
local -i m=$((n - $#label))
print -P "${(l:$n:: :)}frame"
print -P "%B$label%b${(l:$m:: :)} |"
print -P "${(l:$n:: :)} v"
}
function ask_ornaments_color() { function ask_ornaments_color() {
[[ $style != (rainbow|lean*) || $num_lines == 1 ]] && return [[ $style != (rainbow|lean*) || $num_lines == 1 ]] && return
[[ $gap_char == ' ' && $left_frame == 0 && $right_frame == 0 ]] && return [[ $gap_char == ' ' && $left_frame == 0 && $right_frame == 0 ]] && return
@ -995,10 +1004,17 @@ function ask_ornaments_color() {
[[ $gap_char != ' ' ]] && ornaments+=Connection [[ $gap_char != ' ' ]] && ornaments+=Connection
(( left_frame || right_frame )) && ornaments+=Frame (( left_frame || right_frame )) && ornaments+=Frame
add_widget 0 flowing -c "%B${(j: & :)ornaments} Color%b" add_widget 0 flowing -c "%B${(j: & :)ornaments} Color%b"
if (( left_frame || right_frame )); then
add_widget 0 print_frame_marker
add_widget 3 print -P "%B(1) $color_name[1].%b"
add_prompt_n color=1
add_widget 0 print add_widget 0 print
add_widget 2
else
add_widget 1 add_widget 1
add_widget 0 print -P "%B(1) $color_name[1].%b" add_widget 0 print -P "%B(1) $color_name[1].%b"
add_prompt color=1 add_prompt color=1
fi
add_widget 0 print -P "%B(2) $color_name[2].%b" add_widget 0 print -P "%B(2) $color_name[2].%b"
add_prompt color=2 add_prompt color=2
add_widget 0 print -P "%B(3) $color_name[3].%b" add_widget 0 print -P "%B(3) $color_name[3].%b"

Loading…
Cancel
Save