billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=65d729ce323b72c9e52967d77609e3f1e0df075e

commit 65d729ce323b72c9e52967d77609e3f1e0df075e
Author: Boris Faure <bill...@gmail.com>
Date:   Sun Mar 1 17:17:56 2015 +0100

    font selector: use bg/fg for the preview from config/theme
---
 data/themes/default.edc |  4 ++--
 src/bin/options_font.c  | 12 +++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/data/themes/default.edc b/data/themes/default.edc
index 1d0eb46..37d1d9f 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -4404,7 +4404,7 @@ target: "0.clip"; target: "1.clip"; target: "2.clip"; 
target: "3.clip"; target:
          part { name: "base"; type: RECT;
             mouse_events: 1;
             description { state: "default" 0.0;
-               color: 255 255 255 255;
+               color: BG_COL;
                rel1.offset: 2 2;
                rel2.offset: -3 -3;
             }
@@ -4415,7 +4415,7 @@ target: "0.clip"; target: "1.clip"; target: "2.clip"; 
target: "3.clip"; target:
                rel2.to: "base";
                color: 255 255 255 255;
             }
-         }                                              
+         }
          part { name: "terminology.text.preview"; type: SWALLOW;
             clip_to: "clip";
             description { state: "default" 0.0;
diff --git a/src/bin/options_font.c b/src/bin/options_font.c
index 4580d61..19ade5a 100644
--- a/src/bin/options_font.c
+++ b/src/bin/options_font.c
@@ -204,9 +204,15 @@ _cb_op_font_preview_delayed_eval(void *data)
    if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, vx, vy, vw, vh))
      {
         char buf[4096];
-        
-        o = evas_object_text_add(evas_object_evas_get(obj));
-        evas_object_color_set(o, 0, 0, 0, 255);
+        int r, g, b, a;
+        Evas *evas = evas_object_evas_get(obj);
+        Evas_Object *textgrid = termio_textgrid_get(f->term);
+
+        evas_object_textgrid_palette_get(textgrid, 
EVAS_TEXTGRID_PALETTE_STANDARD,
+                                         0, &r, &g, &b, &a);
+
+        o = evas_object_text_add(evas);
+        evas_object_color_set(o, r, g, b, a);
         evas_object_text_text_set(o, TEST_STRING);
         evas_object_scale_set(o, elm_config_scale_get());
         if (f->bitmap)

-- 


Reply via email to