Tweak theme a bit

dev
Kristian Høgsberg 15 years ago
parent 2cbedd1874
commit 7d7b5dbf4d
  1. 2
      cairo-util.c
  2. 38
      window.c

@ -37,7 +37,7 @@ blur_surface(cairo_surface_t *surface, int margin)
uint8_t *src, *dst; uint8_t *src, *dst;
uint32_t *s, *d, a, p; uint32_t *s, *d, a, p;
int i, j, k, size, half; int i, j, k, size, half;
uint8_t kernel[17]; uint8_t kernel[35];
double f; double f;
size = ARRAY_LENGTH(kernel); size = ARRAY_LENGTH(kernel);

@ -96,6 +96,7 @@ window_draw_decorations(struct window *window)
cairo_pattern_t *gradient, *outline, *bright, *dim; cairo_pattern_t *gradient, *outline, *bright, *dim;
struct wl_visual *visual; struct wl_visual *visual;
int width, height; int width, height;
int shadow_dx = 4, shadow_dy = 4;
window->cairo_surface = window->cairo_surface =
cairo_drm_surface_create(window->display->device, cairo_drm_surface_create(window->display->device,
@ -112,10 +113,11 @@ window_draw_decorations(struct window *window)
width = window->allocation.width - window->margin * 2; width = window->allocation.width - window->margin * 2;
height = window->allocation.height - window->margin * 2; height = window->allocation.height - window->margin * 2;
cairo_translate(cr, window->margin + 7, window->margin + 5); cairo_translate(cr, window->margin + shadow_dx,
window->margin + shadow_dy);
cairo_set_line_width (cr, border); cairo_set_line_width (cr, border);
cairo_set_source_rgba(cr, 0, 0, 0, 0.7); cairo_set_source_rgba(cr, 0, 0, 0, 0.7);
rounded_rect(cr, 0, 0, width, height, radius); rounded_rect(cr, -1, -1, width + 1, height + 1, radius);
cairo_fill(cr); cairo_fill(cr);
#define SLOW_BUT_PWETTY #define SLOW_BUT_PWETTY
@ -133,25 +135,20 @@ window_draw_decorations(struct window *window)
} }
#endif #endif
cairo_translate(cr, -7, -5); cairo_translate(cr, -shadow_dx, -shadow_dy);
cairo_set_line_width (cr, border); if (window->keyboard_device) {
rounded_rect(cr, 1, 1, width - 1, height - 1, radius); rounded_rect(cr, 0, 0, width, height, radius);
cairo_set_source(cr, outline);
cairo_stroke(cr);
rounded_rect(cr, 2, 2, width - 2, height - 2, radius - 1);
cairo_set_source(cr, bright);
cairo_stroke(cr);
rounded_rect(cr, 3, 3, width - 2, height - 2, radius - 1);
cairo_set_source(cr, dim);
cairo_stroke(cr);
rounded_rect(cr, 2, 2, width - 2, height - 2, radius - 1);
gradient = cairo_pattern_create_linear (0, 0, 0, 100); gradient = cairo_pattern_create_linear (0, 0, 0, 100);
cairo_pattern_add_color_stop_rgb(gradient, 0, 0.6, 0.6, 0.4); cairo_pattern_add_color_stop_rgb(gradient, 0, 0.6, 0.6, 0.6);
cairo_pattern_add_color_stop_rgb(gradient, 1, 0.8, 0.8, 0.7); cairo_pattern_add_color_stop_rgb(gradient, 1, 0.8, 0.8, 0.8);
cairo_set_source(cr, gradient); cairo_set_source(cr, gradient);
cairo_fill(cr); cairo_fill(cr);
cairo_pattern_destroy(gradient); cairo_pattern_destroy(gradient);
} else {
rounded_rect(cr, 0, 0, width, height, radius);
cairo_set_source_rgba(cr, 0.6, 0.6, 0.6, 1);
cairo_fill(cr);
}
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_move_to(cr, 10, 50); cairo_move_to(cr, 10, 50);
@ -178,10 +175,15 @@ window_draw_decorations(struct window *window)
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND); cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
cairo_set_line_width (cr, 4); cairo_set_line_width (cr, 4);
cairo_text_path(cr, window->title); cairo_text_path(cr, window->title);
cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); if (window->keyboard_device) {
cairo_set_source_rgb(cr, 0.56, 0.56, 0.56);
cairo_stroke_preserve(cr); cairo_stroke_preserve(cr);
cairo_set_source_rgb(cr, 1, 1, 1); cairo_set_source_rgb(cr, 1, 1, 1);
cairo_fill(cr); cairo_fill(cr);
} else {
cairo_set_source_rgb(cr, 0.8, 0.8, 0.8);
cairo_fill(cr);
}
cairo_destroy(cr); cairo_destroy(cr);
visual = wl_display_get_premultiplied_argb_visual(window->display->display); visual = wl_display_get_premultiplied_argb_visual(window->display->display);

Loading…
Cancel
Save