Ejemplo n.º 1
0
/* rerender header window to reflect active module */
void
update_active_module (WINDOW * header_win, GModule current)
{
  const char *module = module_to_label (current);
  int col = getmaxx (stdscr);

  char *lbl = xmalloc (snprintf (NULL, 0, "[Active Module: %s]", module) + 1);
  sprintf (lbl, "[Active Module: %s]", module);

  if (conf.color_scheme == NO_COLOR)
    wattron (header_win, A_REVERSE);
  else
    wattron (header_win, COLOR_PAIR (BLUE_GREEN));

  wmove (header_win, 0, 30);
  mvwprintw (header_win, 0, col - strlen (lbl) - 1, "%s", lbl);

  if (conf.color_scheme == NO_COLOR)
    wattroff (header_win, A_REVERSE);
  else
    wattroff (header_win, COLOR_PAIR (BLUE_GREEN));
  wrefresh (header_win);

  free (lbl);
}
Ejemplo n.º 2
0
static void
disabled_panel_msg (GModule module)
{
  const char *lbl = module_to_label (module);
  int row, col;

  getmaxyx (stdscr, row, col);
  draw_header (stdscr, lbl, "'%s' panel is disabled", row - 1, 0, col,
               WHITE_RED, 0);
}
Ejemplo n.º 3
0
/* rerender header window to reflect active module */
void
update_active_module (WINDOW * header_win, GModule current)
{
  GColors *color = get_color (COLOR_ACTIVE_LABEL);
  const char *module = module_to_label (current);
  int col = getmaxx (stdscr);

  char *lbl = xmalloc (snprintf (NULL, 0, "[Active Panel: %s]", module) + 1);
  sprintf (lbl, "[Active Panel: %s]", module);

  wmove (header_win, 0, 30);

  wattron (header_win, color->attr | COLOR_PAIR (color->pair->idx));
  mvwprintw (header_win, 0, col - strlen (lbl) - 1, "%s", lbl);
  wattroff (header_win, color->attr | COLOR_PAIR (color->pair->idx));

  wrefresh (header_win);

  free (lbl);
}