diff options
author | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-30 02:52:54 +0000 |
---|---|---|
committer | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-30 02:52:54 +0000 |
commit | 9c301c3e16546f00e9230abfbe36a45793bd9389 (patch) | |
tree | 6a9d061f301f41be8a36c1329543bc283d1f8b92 /libmenu/menu_console.c | |
parent | 22e18ebe856009ba68761c24fae14a166b7f0fe5 (diff) | |
download | mpv-9c301c3e16546f00e9230abfbe36a45793bd9389.tar.bz2 mpv-9c301c3e16546f00e9230abfbe36a45793bd9389.tar.xz |
Add a function to draw flat boxes and use it to make the list
menu and console look much cooler. Idea take from Otvos Atilla's
patches (oattila_At_chello--.--hu).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17994 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu/menu_console.c')
-rw-r--r-- | libmenu/menu_console.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c index 936692a566..5f70b871bd 100644 --- a/libmenu/menu_console.c +++ b/libmenu/menu_console.c @@ -55,6 +55,7 @@ struct menu_priv_s { int height; // Display size in % int minb; int vspace; + int bg,bg_alpha; unsigned int hide_time; unsigned int show_time; int history_max; @@ -81,6 +82,7 @@ static struct menu_priv_s cfg_dflt = { 33, // % 3, 3, + 0x80,0x40, 500, 500, 10, @@ -96,6 +98,8 @@ static m_option_t cfg_fields[] = { { "height", ST_OFF(height), CONF_TYPE_INT, M_OPT_RANGE, 1, 100, NULL }, { "minbor", ST_OFF(minb), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, { "vspace", ST_OFF(vspace), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, + { "bg", ST_OFF(bg), CONF_TYPE_INT, M_OPT_RANGE, -1, 255, NULL }, + { "bg-alpha", ST_OFF(bg_alpha), CONF_TYPE_INT, M_OPT_RANGE, 0, 255, NULL }, { "show-time",ST_OFF(show_time), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, { "hide-time",ST_OFF(hide_time), CONF_TYPE_INT, M_OPT_MIN, 0, 0, NULL }, { "history-size",ST_OFF(history_max), CONF_TYPE_INT, M_OPT_MIN, 1, 0, NULL }, @@ -190,6 +194,9 @@ static void draw(menu_t* menu, mp_image_t* mpi) { if(x < 0 || y < 0 || w <= 0 || h <= 0 ) return; + if(mpriv->bg >= 0) + menu_draw_box(mpi,mpriv->bg,mpriv->bg_alpha,0,0,mpi->w,h); + if(!mpriv->child || !mpriv->raw_child){ char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1]; sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer); |