title font

master
Daniel Napora 2022-05-11 01:35:24 +02:00
parent da987e7683
commit 6280c43885
1 changed files with 29 additions and 11 deletions

View File

@ -2,13 +2,20 @@
# mb-setfont
getfont () {
FONT=$(yad --title='Select A Font' --font --separate-output --button=Cancel:1 --button=Select:0)
case "$LANG" in
pl*)
SELECTFONT="Wybierz czcionkę i jej rozmiar"
CANCEL="Anuluj"
SELECT="Wybierz"
;;
*)
SELECTFONT="Select A Font"
CANCEL="Cancel"
SELECT="Select"
;;
esac
FONT=$(yad --title="${SELECTFONT}" --font --separate-output --button="$CANCEL:1" --button="$SELECT:0")
FONTNAME=$(echo $FONT | cut -d'|' -f1)
FONTSTYLE=$(echo $FONT | cut -d'|' -f2)
FONTSIZE=$(echo $FONT | cut -d'|' -f3)
@ -37,7 +44,7 @@ font_obtitle () {
fi
}
font_menu () {
font_menu_item () {
if [[ "$FONT" ]]; then
mb-setvar menu_font_family="'${FONTNAME} ${FONTSTYLE}'"
mb-setvar menu_font_size=${FONTSIZE}
@ -45,16 +52,27 @@ font_menu () {
exit 0
fi
}
font_menu_sep () {
if [[ "$FONT" ]]; then
mb-setvar menu_sep_font_family="'${FONTNAME} ${FONTSTYLE}'"
mb-setvar menu_sep_font_size=${FONTSIZE}
else
exit 0
fi
}
case "$1" in
obtitle)
getfont
font_obtitle
;;
menu)
menu_item)
getfont
font_menu
font_menu_item
;;
menu_sep)
getfont
font_menu_sep
;;
*)
: