1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Added input text to theme

This commit is contained in:
James Booth 2012-11-22 02:01:49 +00:00
parent 1adbc17194
commit c5b4fc4a80
6 changed files with 32 additions and 23 deletions

View File

@ -58,6 +58,7 @@
#include "log.h"
#include "preferences.h"
#include "profanity.h"
#include "theme.h"
#include "ui.h"
static WINDOW *inp_win;
@ -79,7 +80,7 @@ create_input_window(void)
getmaxyx(stdscr, rows, cols);
inp_win = newpad(1, INP_WIN_MAX);
wbkgd(inp_win, COLOR_PAIR(1));
wbkgd(inp_win, COLOUR_INPUT_TEXT);
keypad(inp_win, TRUE);
wmove(inp_win, 0, 0);
prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1);

View File

@ -32,6 +32,7 @@
#include <ncurses/ncurses.h>
#endif
#include "theme.h"
#include "ui.h"
static WINDOW *status_bar;

View File

@ -69,6 +69,7 @@ static struct colours_t {
NCURSES_COLOR_T statusbaractive;
NCURSES_COLOR_T statusbarnew;
NCURSES_COLOR_T maintext;
NCURSES_COLOR_T inputtext;
NCURSES_COLOR_T splashtext;
NCURSES_COLOR_T online;
NCURSES_COLOR_T away;
@ -156,6 +157,7 @@ theme_init_colours(void)
init_pair(2, colour_prefs.splashtext, colour_prefs.bkgnd);
init_pair(3, colour_prefs.error, colour_prefs.bkgnd);
init_pair(4, colour_prefs.incoming, colour_prefs.bkgnd);
init_pair(5, colour_prefs.inputtext, colour_prefs.bkgnd);
// title bar
init_pair(10, colour_prefs.titlebartext, colour_prefs.titlebar);
@ -252,6 +254,9 @@ _load_colours(void)
gchar *splashtext_val = g_key_file_get_string(theme, "colours", "splashtext", NULL);
_set_colour(splashtext_val, &colour_prefs.splashtext, COLOR_CYAN);
gchar *inputtext_val = g_key_file_get_string(theme, "colours", "inputtext", NULL);
_set_colour(inputtext_val, &colour_prefs.inputtext, COLOR_WHITE);
gchar *online_val = g_key_file_get_string(theme, "colours", "online", NULL);
_set_colour(online_val, &colour_prefs.online, COLOR_GREEN);

View File

@ -34,6 +34,29 @@
#include <ncurses/ncurses.h>
#endif
#define COLOUR_TEXT COLOR_PAIR(1)
#define COLOUR_SPLASH COLOR_PAIR(2)
#define COLOUR_ERROR COLOR_PAIR(3)
#define COLOUR_INCOMING COLOR_PAIR(4)
#define COLOUR_INPUT_TEXT COLOR_PAIR(5)
#define COLOUR_TITLE_TEXT COLOR_PAIR(10)
#define COLOUR_TITLE_BRACKET COLOR_PAIR(11)
#define COLOUR_STATUS_TEXT COLOR_PAIR(20)
#define COLOUR_STATUS_BRACKET COLOR_PAIR(21)
#define COLOUR_STATUS_ACTIVE COLOR_PAIR(22)
#define COLOUR_STATUS_NEW COLOR_PAIR(23)
#define COLOUR_ME COLOR_PAIR(30)
#define COLOUR_THEM COLOR_PAIR(31)
#define COLOUR_ROOMINFO COLOR_PAIR(40)
#define COLOUR_ONLINE COLOR_PAIR(50)
#define COLOUR_OFFLINE COLOR_PAIR(51)
#define COLOUR_AWAY COLOR_PAIR(52)
#define COLOUR_CHAT COLOR_PAIR(53)
#define COLOUR_DND COLOR_PAIR(54)
#define COLOUR_XA COLOR_PAIR(55)
#define COLOUR_TYPING COLOR_PAIR(60)
#define COLOUR_GONE COLOR_PAIR(61)
void theme_load(const char * const theme_name);
void theme_init_colours(void);
gboolean theme_change(const char * const theme_name);

View File

@ -24,6 +24,7 @@
#include <string.h>
#include "common.h"
#include "theme.h"
#include "ui.h"
static WINDOW *title_bar;

View File

@ -38,28 +38,6 @@
#define INP_WIN_MAX 1000
#define COLOUR_TEXT COLOR_PAIR(1)
#define COLOUR_SPLASH COLOR_PAIR(2)
#define COLOUR_ERROR COLOR_PAIR(3)
#define COLOUR_INCOMING COLOR_PAIR(4)
#define COLOUR_TITLE_TEXT COLOR_PAIR(10)
#define COLOUR_TITLE_BRACKET COLOR_PAIR(11)
#define COLOUR_STATUS_TEXT COLOR_PAIR(20)
#define COLOUR_STATUS_BRACKET COLOR_PAIR(21)
#define COLOUR_STATUS_ACTIVE COLOR_PAIR(22)
#define COLOUR_STATUS_NEW COLOR_PAIR(23)
#define COLOUR_ME COLOR_PAIR(30)
#define COLOUR_THEM COLOR_PAIR(31)
#define COLOUR_ROOMINFO COLOR_PAIR(40)
#define COLOUR_ONLINE COLOR_PAIR(50)
#define COLOUR_OFFLINE COLOR_PAIR(51)
#define COLOUR_AWAY COLOR_PAIR(52)
#define COLOUR_CHAT COLOR_PAIR(53)
#define COLOUR_DND COLOR_PAIR(54)
#define COLOUR_XA COLOR_PAIR(55)
#define COLOUR_TYPING COLOR_PAIR(60)
#define COLOUR_GONE COLOR_PAIR(61)
typedef enum {
WIN_UNUSED,
WIN_CONSOLE,