projects
/
windtk
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
theme
[windtk]
/
src
/
window.c
diff --git
a/src/window.c
b/src/window.c
index
a103ed4
..
d0d8d74
100644
(file)
--- a/
src/window.c
+++ b/
src/window.c
@@
-1,6
+1,7
@@
#include "wtimpl.h"
#include "wtimpl.h"
-static void draw_win(wt_widget *w);
+static void draw_win(wt_widget *w, struct wt_graphics *gfx);
+static void use_theme(wt_widget *w, struct wt_theme *theme);
wt_widget *wt_window(wt_widget *par, const char *title, int style, int x, int y, int xsz, int ysz)
{
wt_widget *wt_window(wt_widget *par, const char *title, int style, int x, int y, int xsz, int ysz)
{
@@
-15,12
+16,17
@@
wt_widget *wt_window(wt_widget *par, const char *title, int style, int x, int y,
wt_resize(w, xsz, ysz);
/* TODO: style */
wt_resize(w, xsz, ysz);
/* TODO: style */
- w->draw = draw_win;
+ use_theme(w, wt->theme);
return w;
}
return w;
}
-static void draw_win(wt_widget *w)
+static void draw_win(wt_widget *w, struct wt_graphics *gfx)
{
wt_gfx_color(COL_BG);
wt_gfx_fillrect(&w->rect);
}
{
wt_gfx_color(COL_BG);
wt_gfx_fillrect(&w->rect);
}
+
+static void use_theme(wt_widget *w, struct wt_theme *theme)
+{
+ w->draw = theme && theme->draw_window ? theme->draw_window : draw_win;
+}