summaryrefslogtreecommitdiff
path: root/src/ui/theme.c
diff options
context:
space:
mode:
authorOmer Akram <[email protected]>2014-02-17 11:52:58 +0100
committerStefano Karapetsas <[email protected]>2014-02-17 11:52:58 +0100
commit3feed0c67e8713fa9db08605ff21740d41d321c0 (patch)
tree0f7734545351c75c7c41884d50d56e0099dcd153 /src/ui/theme.c
parentfc2a3980ffd50c3e79bfb13dfbfb3990d40eda93 (diff)
downloadmarco-3feed0c67e8713fa9db08605ff21740d41d321c0.tar.bz2
marco-3feed0c67e8713fa9db08605ff21740d41d321c0.tar.xz
Cut with fading the Bar title when it's longer than the decoration bar.
Diffstat (limited to 'src/ui/theme.c')
-rw-r--r--src/ui/theme.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 589c68e5..4d430b7c 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -3850,6 +3850,33 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
rx = parse_x_position_unchecked (op->data.title.x, env);
ry = parse_y_position_unchecked (op->data.title.y, env);
+ if (rx - env->rect.x + env->title_width >= env->rect.width)
+ {
+ const double alpha_margin = 30.0;
+ int text_space = env->rect.x + env->rect.width -
+ (rx - env->rect.x) - env->right_width;
+
+ double startalpha = 1.0 - (alpha_margin/((double)text_space));
+
+ cairo_pattern_t *linpat;
+ linpat = cairo_pattern_create_linear (rx, ry, text_space,
+ env->title_height);
+ cairo_pattern_add_color_stop_rgb (linpat, 0, color.red/65535.0,
+ color.green/65535.0,
+ color.blue/65535.0);
+ cairo_pattern_add_color_stop_rgb (linpat, startalpha,
+ color.red/65535.0,
+ color.green/65535.0,
+ color.blue/65535.0);
+ cairo_pattern_add_color_stop_rgba (linpat, 1, color.red/65535.0,
+ color.green/65535.0,
+ color.blue/65535.0, 0);
+ cairo_set_source(cr, linpat);
+ cairo_pattern_destroy(linpat);
+ } else {
+ gdk_cairo_set_source_color (cr, &color);
+ }
+
cairo_move_to (cr, rx, ry);
pango_cairo_show_layout (cr, info->title_layout);
}