more config in gui plus translucency now works. even from gui. wordsep

and scrollback config wont save/change. need to do.



SVN revision: 72237
devs/lucas/wip
Carsten Haitzler 11 years ago
parent b04669cd32
commit 2b75cba66b
  1. 22
      data/themes/default.edc
  2. BIN
      data/themes/images/bg_shadow.png
  3. 1
      src/bin/Makefile.am
  4. 17
      src/bin/main.c
  5. 1
      src/bin/main.h
  6. 3
      src/bin/options.c
  7. 109
      src/bin/options_behavior.c
  8. 1
      src/bin/options_behavior.h

@ -13,12 +13,20 @@ collections {
fill.smooth: 0;
visible: 0;
}
description { state: "translucent" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "base"; type: RECT;
mouse_events: 1;
description { state: "default" 0.0;
color: 48 48 48 255;
}
description { state: "translucent" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "terminology.content"; type: SWALLOW;
description { state: "default" 0.0;
@ -84,6 +92,20 @@ collections {
transition: DECELERATE 0.5;
target: "terminology.options";
}
program { name: "trans_on";
signal: "translucent,on";
source: "terminology";
action: STATE_SET "translucent" 0.0;
target: "base";
target: "shadow";
}
program { name: "trans_off";
signal: "translucent,off";
source: "terminology";
action: STATE_SET "default" 0.0;
target: "base";
target: "shadow";
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -15,6 +15,7 @@ keyin.c keyin.h \
main.c main.h \
options.c options.h \
options_font.c options_font.h \
options_behavior.c options_behavior.h \
termio.c termio.h \
termpty.c termpty.h \
utf8.c utf8.h \

@ -47,6 +47,21 @@ _cb_options(void *data, Evas_Object *obj, void *event)
options_toggle(win, bg, term);
}
void
main_trans_update(void)
{
if (config->translucent)
{
edje_object_signal_emit(bg, "translucent,on", "terminology");
elm_win_alpha_set(win, EINA_TRUE);
}
else
{
edje_object_signal_emit(bg, "translucent,off", "terminology");
elm_win_alpha_set(win, EINA_FALSE);
}
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
@ -90,6 +105,8 @@ elm_main(int argc, char **argv)
evas_object_smart_callback_add(o, "options", _cb_options, NULL);
evas_object_show(o);
main_trans_update();
evas_object_smart_callback_add(win, "focus,in", _cb_focus_in, term);
evas_object_smart_callback_add(win, "focus,out", _cb_focus_out, term);
_cb_size_hint(win, evas_object_evas_get(win), term, NULL);

@ -0,0 +1 @@
void main_trans_update(void);

@ -1,6 +1,7 @@
#include <Elementary.h>
#include "options.h"
#include "options_font.h"
#include "options_behavior.h"
static Evas_Object *op_frame, *op_box = NULL, *op_toolbar = NULL, *op_opbox = NULL;
static Eina_Bool op_out = EINA_FALSE;
@ -30,7 +31,7 @@ static void
_cb_op_behavior(void *data, Evas_Object *obj, void *event)
{
elm_box_clear(op_opbox);
// XXX: not done yet
options_behavior(op_opbox, data);
}
void

@ -0,0 +1,109 @@
#include <Elementary.h>
#include "config.h"
#include "termio.h"
#include "options.h"
#include "options_font.h"
#include "main.h"
static Evas_Object *op_sbslider, *op_jumpcheck, *op_trans, *op_wordsep;
static void
_cb_op_behavior_jump_chg(void *data, Evas_Object *obj, void *event)
{
config->jump_on_change = elm_check_state_get(obj);
termio_config_update(data);
config_save();
}
static void
_cb_op_behavior_trans_chg(void *data, Evas_Object *obj, void *event)
{
config->translucent = elm_check_state_get(obj);
main_trans_update();
config_save();
}
static void
_cb_op_behavior_wsep_chg(void *data, Evas_Object *obj, void *event)
{
// XXX: do
}
static void
_cb_op_behavior_sback_chg(void *data, Evas_Object *obj, void *event)
{
// XXX: do
}
void
options_behavior(Evas_Object *opbox, Evas_Object *term)
{
Evas_Object *o;
char *txt;
op_jumpcheck = o = elm_check_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Jump to bottom on change");
elm_check_state_set(o, config->jump_on_change);
elm_box_pack_end(opbox, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_behavior_jump_chg, term);
op_jumpcheck = o = elm_check_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_object_text_set(o, "Translucent");
elm_check_state_set(o, config->translucent);
elm_box_pack_end(opbox, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_behavior_trans_chg, NULL);
o = elm_label_add(opbox);
evas_object_size_hint_weight_set(o, 0.0, 0.0);
evas_object_size_hint_align_set(o, 0.0, 0.5);
elm_object_text_set(o, "Word separators:");
elm_box_pack_end(opbox, o);
evas_object_show(o);
op_wordsep = o = elm_entry_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
elm_entry_scrollable_set(o, EINA_TRUE);
elm_entry_single_line_set(o, EINA_TRUE);
txt = elm_entry_utf8_to_markup(config->wordsep);
if (txt)
{
elm_object_text_set(o, txt);
free(txt);
}
elm_box_pack_end(opbox, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "changed",
_cb_op_behavior_wsep_chg, term);
o = elm_label_add(opbox);
evas_object_size_hint_weight_set(o, 0.0, 0.0);
evas_object_size_hint_align_set(o, 0.0, 0.5);
elm_object_text_set(o, "Scrollback lines:");
elm_box_pack_end(opbox, o);
evas_object_show(o);
op_sbslider = o = elm_slider_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
elm_slider_span_size_set(o, 160);
elm_slider_unit_format_set(o, "%1.0f");
elm_slider_indicator_format_set(o, "%1.0f");
elm_slider_min_max_set(o, 0, 10000);
elm_slider_value_set(o, config->scrollback);
elm_box_pack_end(opbox, o);
evas_object_show(o);
evas_object_smart_callback_add(o, "delay,changed",
_cb_op_behavior_sback_chg, term);
elm_box_pack_end(opbox, o);
evas_object_show(o);
}

@ -0,0 +1 @@
void options_behavior(Evas_Object *opbox, Evas_Object *term);
Loading…
Cancel
Save