background: fade it with the color defined as background in the color scheme
This commit is contained in:
parent
7c6f9f1e6b
commit
293081bb3c
|
@ -2,6 +2,12 @@
|
||||||
Terminology 1.12.1
|
Terminology 1.12.1
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
Changes since 1.12.1:
|
||||||
|
--------------------
|
||||||
|
* Add part "terminology.fade" in group "terminology/core" to set the color
|
||||||
|
used to fade the background of the terminal. Terminology sets it to the
|
||||||
|
background color of the colorscheme.
|
||||||
|
|
||||||
Changes since 1.8.0:
|
Changes since 1.8.0:
|
||||||
--------------------
|
--------------------
|
||||||
* Add group "terminology/color_preview" to display a preview of a
|
* Add group "terminology/color_preview" to display a preview of a
|
||||||
|
|
|
@ -176,6 +176,11 @@ To notify that the current tab is being dragged outside of other tabs.
|
||||||
|
|
||||||
## Swallowed parts
|
## Swallowed parts
|
||||||
|
|
||||||
|
### Part `terminology.fade`
|
||||||
|
|
||||||
|
Part used to fade the background, either with a solid color or the screen
|
||||||
|
background when the `translucent` option is set.
|
||||||
|
|
||||||
### Part `terminology.background`
|
### Part `terminology.background`
|
||||||
|
|
||||||
Actual background.
|
Actual background.
|
||||||
|
|
|
@ -10,23 +10,25 @@ group { name: "terminology/core";
|
||||||
new r, g, b, a, v;
|
new r, g, b, a, v;
|
||||||
v = (getarg(2) * 255) / 100;
|
v = (getarg(2) * 255) / 100;
|
||||||
|
|
||||||
custom_state(PART:"fade", "default", 0.0);
|
custom_state(PART:"terminology.fade", "default", 0.0);
|
||||||
get_state_val(PART:"fade", STATE_COLOR, r, g, b, a);
|
get_state_val(PART:"terminology.fade", STATE_COLOR, r, g, b, a);
|
||||||
set_state_val(PART:"fade", STATE_COLOR, r, g, b, v);
|
set_state_val(PART:"terminology.fade", STATE_COLOR, r, g, b, v);
|
||||||
set_state(PART:"fade", "custom", 0.0);
|
set_state(PART:"terminology.fade", "custom", 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parts {
|
parts {
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// background handling
|
// background handling
|
||||||
part { name: "fade"; type: RECT;
|
part { name: "terminology.fade"; type: RECT;
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
|
color_class: "BG";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "terminology.background"; type: SWALLOW;
|
part { name: "terminology.background"; type: SWALLOW;
|
||||||
clip_to: "fade";
|
clip_to: "terminology.fade";
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
|
color_class: "BG";
|
||||||
}
|
}
|
||||||
description { state: "image" 0.0;
|
description { state: "image" 0.0;
|
||||||
inherit: "default" 0.0;
|
inherit: "default" 0.0;
|
||||||
|
|
|
@ -51,7 +51,6 @@ _cb_op_video_trans_chg(void *data,
|
||||||
Config *config = ctx->config;
|
Config *config = ctx->config;
|
||||||
|
|
||||||
config->translucent = elm_check_state_get(obj);
|
config->translucent = elm_check_state_get(obj);
|
||||||
elm_object_disabled_set(ctx->op_opacity, !config->translucent);
|
|
||||||
config_save(config);
|
config_save(config);
|
||||||
main_trans_update();
|
main_trans_update();
|
||||||
}
|
}
|
||||||
|
@ -65,8 +64,6 @@ _cb_op_video_opacity_chg(void *data,
|
||||||
Config *config = ctx->config;
|
Config *config = ctx->config;
|
||||||
|
|
||||||
config->opacity = elm_slider_value_get(obj);
|
config->opacity = elm_slider_value_get(obj);
|
||||||
if (!config->translucent)
|
|
||||||
return;
|
|
||||||
config_save(config);
|
config_save(config);
|
||||||
main_trans_update();
|
main_trans_update();
|
||||||
}
|
}
|
||||||
|
@ -569,7 +566,6 @@ options_background(Evas_Object *opbox, Evas_Object *term)
|
||||||
elm_slider_indicator_format_set(o, _("%1.0f%%"));
|
elm_slider_indicator_format_set(o, _("%1.0f%%"));
|
||||||
elm_slider_min_max_set(o, 0, 100);
|
elm_slider_min_max_set(o, 0, 100);
|
||||||
elm_slider_value_set(o, config->opacity);
|
elm_slider_value_set(o, config->opacity);
|
||||||
elm_object_disabled_set(o, !config->translucent);
|
|
||||||
elm_box_pack_end(bx, o);
|
elm_box_pack_end(bx, o);
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
evas_object_smart_callback_add(o, "changed",
|
evas_object_smart_callback_add(o, "changed",
|
||||||
|
|
|
@ -1058,10 +1058,7 @@ _term_trans(Term *term)
|
||||||
Evas_Object *edje = elm_layout_edje_get(term->core);
|
Evas_Object *edje = elm_layout_edje_get(term->core);
|
||||||
Win *wn = term->wn;
|
Win *wn = term->wn;
|
||||||
|
|
||||||
if (term->config->translucent)
|
|
||||||
msg.val = term->config->opacity;
|
msg.val = term->config->opacity;
|
||||||
else
|
|
||||||
msg.val = 100;
|
|
||||||
edje_object_message_send(term->bg_edj, EDJE_MESSAGE_INT, 1, &msg);
|
edje_object_message_send(term->bg_edj, EDJE_MESSAGE_INT, 1, &msg);
|
||||||
edje_object_message_send(edje, EDJE_MESSAGE_INT, 1, &msg);
|
edje_object_message_send(edje, EDJE_MESSAGE_INT, 1, &msg);
|
||||||
|
|
||||||
|
@ -1075,6 +1072,13 @@ _term_trans(Term *term)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (wn->config->color_scheme)
|
||||||
|
{
|
||||||
|
evas_object_color_set(wn->backbg,
|
||||||
|
wn->config->color_scheme->bg.r,
|
||||||
|
wn->config->color_scheme->bg.g,
|
||||||
|
wn->config->color_scheme->bg.b, 255);
|
||||||
|
}
|
||||||
elm_win_alpha_set(wn->win, EINA_FALSE);
|
elm_win_alpha_set(wn->win, EINA_FALSE);
|
||||||
evas_object_show(wn->backbg);
|
evas_object_show(wn->backbg);
|
||||||
wn->translucent = EINA_FALSE;
|
wn->translucent = EINA_FALSE;
|
||||||
|
@ -2237,6 +2241,15 @@ win_new(const char *name, const char *role, const char *title,
|
||||||
|
|
||||||
wn->backbg = o = evas_object_rectangle_add(evas_object_evas_get(wn->win));
|
wn->backbg = o = evas_object_rectangle_add(evas_object_evas_get(wn->win));
|
||||||
evas_object_color_set(o, 0, 0, 0, 255);
|
evas_object_color_set(o, 0, 0, 0, 255);
|
||||||
|
if (wn->config->color_scheme)
|
||||||
|
{
|
||||||
|
evas_object_color_set(o,
|
||||||
|
wn->config->color_scheme->bg.r,
|
||||||
|
wn->config->color_scheme->bg.g,
|
||||||
|
wn->config->color_scheme->bg.b, 255);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
evas_object_color_set(o, 0, 0, 0, 255);
|
||||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_win_resize_object_add(wn->win, o);
|
elm_win_resize_object_add(wn->win, o);
|
||||||
|
|
Loading…
Reference in New Issue