From 2f5e5620e218d317d5e853fd4ee9d9123b346610 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 1 Mar 2017 12:50:30 +0000 Subject: Change interface to system colours to allow reporting of errors Allow system colour interface to report errors instead of silently failing and propogate the errors. This also fixes teh system colour documentation. --- desktop/browser_history.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'desktop/browser_history.c') diff --git a/desktop/browser_history.c b/desktop/browser_history.c index 10154b780..cf70c4700 100644 --- a/desktop/browser_history.c +++ b/desktop/browser_history.c @@ -478,17 +478,27 @@ static bool browser_window_history__enumerate_entry( /* exported interface documented in desktop/browser_history.h */ nserror browser_window_history_create(struct browser_window *bw) { + nserror res; struct history *history; - pstyle_bg.fill_colour = ns_system_colour_char("Window"); + res = ns_system_colour_char("Window", &pstyle_bg.fill_colour); + if (res != NSERROR_OK) { + return res; + } pfstyle_node.background = pstyle_bg.fill_colour; pfstyle_node_sel.background = pstyle_bg.fill_colour; - pstyle_line.stroke_colour = ns_system_colour_char("GrayText"); + res = ns_system_colour_char("GrayText", &pstyle_line.stroke_colour); + if (res != NSERROR_OK) { + return res; + } pstyle_rect.stroke_colour = pstyle_line.stroke_colour; pfstyle_node.foreground = pstyle_line.stroke_colour; - pstyle_rect_sel.stroke_colour = ns_system_colour_char("Highlight"); + res = ns_system_colour_char("Highlight", &pstyle_rect_sel.stroke_colour); + if (res != NSERROR_OK) { + return res; + } pfstyle_node_sel.foreground = pstyle_rect_sel.stroke_colour; bw->history = NULL; -- cgit v1.2.3