From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Benjamin Poirier <bpoirier@suse.de>
Cc: Michal Marek <mmarek@suse.cz>, Wang YanQing <udknight@gmail.com>,
Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] menuconfig: Add "breadcrumbs" navigation aid
Date: Mon, 15 Apr 2013 23:39:58 +0200 [thread overview]
Message-ID: <20130415213958.GA12519@free.fr> (raw)
In-Reply-To: <1366035231-24370-2-git-send-email-bpoirier@suse.de>
Benjamin, All,
On Mon, Apr 15, 2013 at 10:13:51AM -0400, Benjamin Poirier wrote:
> Displays a trail of the menu entries used to get to the current menu.
Very good idea, indeed! :-)
> diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
> index 109d531..9a41d78 100644
> --- a/scripts/kconfig/lxdialog/util.c
> +++ b/scripts/kconfig/lxdialog/util.c
> @@ -257,13 +257,54 @@ void dialog_clear(void)
> attr_clear(stdscr, LINES, COLS, dlg.screen.atr);
> /* Display background title if it exists ... - SLH */
> if (dlg.backtitle != NULL) {
> - int i;
> + int i, len = 0;
> + struct subtitle_list *pos;
>
> wattrset(stdscr, dlg.screen.atr);
> mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle);
> wmove(stdscr, 1, 1);
> for (i = 1; i < COLS - 1; i++)
> waddch(stdscr, ACS_HLINE);
This means you'll be re-writing over this line with the following
code... (follow at [*], below)
> + for (pos = dlg.subtitles; pos != NULL; pos = pos->next) {
> + /* 3 is for the arrow and spaces */
> + len += strlen(pos->text) + 3;
> + }
> +
> + if (len) {
> + int skip = 0;
> +
> + wmove(stdscr, 1, 1);
> + if (len > COLS - 2) {
> + const char *ellipsis = "[...] ";
> + waddstr(stdscr, ellipsis);
> + skip = len - (COLS - 2 - strlen(ellipsis));
> + }
> +
> + for (pos = dlg.subtitles; pos != NULL; pos =
> + pos->next) {
> + if (skip == 0)
> + waddch(stdscr, ACS_RARROW);
> + else
> + skip--;
> +
> + if (skip == 0)
> + waddch(stdscr, ' ');
> + else
> + skip--;
> +
> + if (skip < strlen(pos->text)) {
> + waddstr(stdscr, pos->text + skip);
> + skip = 0;
> + } else
> + skip -= strlen(pos->text);
> +
> + if (skip == 0)
> + waddch(stdscr, ' ');
> + else
> + skip--;
> + }
> + }
[*] ... when you could have drawn only the needed part here:
+ wmove(stdscr, 1, len+1);
+ for (i = len + 1; i < COLS - 1; i++)
+ waddch(stdscr, ACS_HLINE);
[--SNIP--]
Queued (with that change) into:
https://git.gitorious.org/linux-kconfig/linux-kconfig.git yem-kconfig-for-next
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2013-04-15 21:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 14:13 [PATCH 1/2] menuconfig: Fix memory leak introduced by jump keys feature Benjamin Poirier
2013-04-15 14:13 ` [PATCH 2/2] menuconfig: Add "breadcrumbs" navigation aid Benjamin Poirier
2013-04-15 21:39 ` Yann E. MORIN [this message]
2013-04-16 14:07 ` [PATCH v3] " Benjamin Poirier
2013-04-16 17:20 ` Yann E. MORIN
2013-04-15 21:54 ` [PATCH 1/2] menuconfig: Fix memory leak introduced by jump keys feature Yann E. MORIN
2013-04-16 8:21 ` Michal Marek
2013-04-16 9:12 ` Michal Marek
2013-04-16 16:38 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130415213958.GA12519@free.fr \
--to=yann.morin.1998@free.fr \
--cc=bpoirier@suse.de \
--cc=gouders@et.bocholt.fh-gelsenkirchen.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=paul.gortmaker@windriver.com \
--cc=udknight@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox