diff options
author | Vincent Sanders <vince@kyllikki.org> | 2016-04-23 23:32:21 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2016-04-23 23:32:21 +0100 |
commit | 974a4a21e16a2da85a66aae9b80eeca15ca26dd6 (patch) | |
tree | 4433113896c8f5aec5a3f4130b50f9a73075907c /desktop/browser_history.c | |
parent | cdd53bcffb00819360b3e62ef41de6607aca2c76 (diff) | |
download | netsurf-974a4a21e16a2da85a66aae9b80eeca15ca26dd6.tar.gz netsurf-974a4a21e16a2da85a66aae9b80eeca15ca26dd6.tar.bz2 |
split out the layout glyph sizing and splitting API
This refactors the core "font" sizing API to be handled through gui
function tables similar to every other core/frontend calling API.
Diffstat (limited to 'desktop/browser_history.c')
-rw-r--r-- | desktop/browser_history.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c index 1ee800019..f2b0fb3ee 100644 --- a/desktop/browser_history.c +++ b/desktop/browser_history.c @@ -37,11 +37,11 @@ #include "css/css.h" #include "image/bitmap.h" +#include "desktop/gui_layout.h" #include "desktop/gui_internal.h" #include "desktop/browser_history.h" #include "desktop/browser_private.h" #include "desktop/plotters.h" -#include "desktop/font.h" #define WIDTH 100 #define HEIGHT 86 @@ -273,6 +273,7 @@ browser_window_history__redraw_entry(struct history *history, .stroke_width = entry == history->current ? 3 : 1, }; plot_font_style_t fstyle = *plot_style_font; + nserror res; if (clip) { struct rect rect; @@ -292,17 +293,21 @@ browser_window_history__redraw_entry(struct history *history, WIDTH, HEIGHT, entry->bitmap, 0xffffff, 0); } + if (!plot->rectangle(entry->x - 1 + xoffset, entry->y - 1 + yoffset, entry->x + xoffset + WIDTH, entry->y + yoffset + HEIGHT, - &pstyle_history_rect)) + &pstyle_history_rect)) { return false; + } - if (!nsfont.font_position_in_string(plot_style_font, entry->page.title, - strlen(entry->page.title), WIDTH, - &char_offset, &actual_x)) + res = guit->layout->position(plot_style_font, entry->page.title, + strlen(entry->page.title), WIDTH, + &char_offset, &actual_x); + if (res != NSERROR_OK) { return false; + } fstyle.background = HISTORY_COLOUR_BACKGROUND; fstyle.foreground = c; |