hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=5944f3d4c1b418547ce7ad0b408de0bcc4484c2f

commit 5944f3d4c1b418547ce7ad0b408de0bcc4484c2f
Author: ChunEon Park <[email protected]>
Date:   Fri Aug 8 17:32:46 2014 +0900

    statusbar: improve layout.
    
    improve structure to be customizable.
    also, this removes the annoying padding at the end of the group name.
---
 data/themes/default/layout_common.edc | 543 +++++++++++++++++++++++++++++++---
 src/bin/statusbar.c                   |  39 +--
 2 files changed, 523 insertions(+), 59 deletions(-)

diff --git a/data/themes/default/layout_common.edc 
b/data/themes/default/layout_common.edc
index 2bee26e..b94d11a 100644
--- a/data/themes/default/layout_common.edc
+++ b/data/themes/default/layout_common.edc
@@ -8,12 +8,6 @@ images {
    image: "bub_over_bot.png" COMP;
 }
 
-styles {
-     style { name: "entry_statusbar_style";
-        base: "font="FN" font_size=11 text_class=entry color=#ffffff 
style=shadow,bottom shadow_color=#00000080 glow_color=#3399ff18 valign=1 
ellipsis=1.0 wrap=none";
-     }
-}
-
 group { name: "about_layout";
    parts {
       part { name: "clipper";
@@ -1414,63 +1408,324 @@ group { name: "statusbar_layout";
             color: 0 0 0 0;
          }
       }
-      part { name: "elm.text.view_size";
-         type: TEXTBLOCK;
+      part { name: "size_spacer";
+         type: SPACER;
          scale: 1;
+         description { state: "default" 0.0;
+            rel1.relative: 0 0;
+            rel2.relative: 0 1;
+            min: 250 0;
+            fixed: 1 0;
+         }
+      }
+      part { name: "elm.text.size[";
+         type: TEXT;
          clip_to: "base_clip";
-         description {
-            rel1.to: "base_clip";
-            rel2.to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
             rel2.relative: 0.0 1.0;
             align: 0 0.5;
-            min: 120 14;
-            fixed: 1 0;
             rel1.offset: 0 -2;
             rel2.offset: -1 -3;
-            text.style: "entry_statusbar_style";
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "Size [";
+               size: 11;
+               align: 0 0;
+               min: 1 0;
+               ellipsis: -1;
+            }
          }
       }
-      part { name: "elm.text.cur_pos";
-         type: TEXTBLOCK;
+      part { name: "elm.text.size_w";
+         type: TEXT;
+         clip_to: "base_clip";
          scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.size[";
+            rel2.to_x: "elm.text.size[";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.size_x";
+         type: TEXT;
          clip_to: "base_clip";
-         description {
-            rel1.to: "elm.text.view_size";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.size_w";
+            rel2.to_x: "elm.text.size_w";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "x";
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.size_h";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.size_x";
+            rel2.to_x: "elm.text.size_x";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.size]";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.size_h";
+            rel2.to_x: "elm.text.size_h";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "]";
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_px[";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to: "size_spacer";
             rel1.relative: 1 0.0;
-            rel2.to: "elm.text.view_size";
+            rel2.to: "size_spacer";
             rel2.relative: 1 1.0;
-            min: 200 14;
+            align: 0 0.5;
             fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "Cursor [";
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_pxx";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_px[";
+            rel2.to_x: "elm.text.cursor_px[";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
             align: 0 0.5;
-            text.style: "entry_statusbar_style";
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
          }
       }
-      part { name: "elm.text.group_name";
-         type: TEXTBLOCK;
+      part { name: "elm.text.cursor_px.";
+         type: TEXT;
+         clip_to: "base_clip";
          scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_pxx";
+            rel2.to_x: "elm.text.cursor_pxx";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: ",";
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_pxy";
+         type: TEXT;
          clip_to: "base_clip";
-         description {
-            rel1.to: "elm.text.cur_pos";
-            rel1.relative: 1 0.0;
-            rel2.to: "elm.text.line";
-            rel2.relative: 0 1.0;
-            min: 180 14;
-            align: 1 0.5;
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_px.";
+            rel2.to_x: "elm.text.cursor_px.";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
             fixed: 1 0;
-            text.style: "entry_statusbar_style";
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
          }
       }
-      part { name: "elm.text.group_name_bracket";
+      part { name: "elm.text.cursor_px][";
          type: TEXT;
+         clip_to: "base_clip";
          scale: 1;
          effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_pxy";
+            rel2.to_x: "elm.text.cursor_pxy";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "][";
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_relx";
+         type: TEXT;
          clip_to: "base_clip";
-         description {
-            rel1.to_x: "elm.text.group_name";
-            rel1.relative: 1 0.0;
-            rel2.to_x: "elm.text.group_name";
-            rel2.relative: 1 1.0;
-            min: 6 14;
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_px][";
+            rel2.to_x: "elm.text.cursor_px][";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_rel.";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_relx";
+            rel2.to_x: "elm.text.cursor_relx";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: ",";
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_rely";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_rel.";
+            rel2.to_x: "elm.text.cursor_rel.";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 0 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.cursor_rel]";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.cursor_rely";
+            rel2.to_x: "elm.text.cursor_rely";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
             align: 0 0.5;
             fixed: 1 0;
             color: 255 255 255 255;
@@ -1479,21 +1734,225 @@ group { name: "statusbar_layout";
                text: "]";
                size: 11;
                align: 0 0.5;
+               min: 1 0;
+               ellipsis: -1;
             }
          }
       }
-      part { name: "elm.text.line";
-         type: TEXTBLOCK;
+      part { name: "cursor_spacer";
+         type: SPACER;
          scale: 1;
+         description {
+            rel1.to: "size_spacer";
+            rel1.relative: 1.0 0.0;
+            rel2.to: "size_spacer";
+            rel2.relative: 1.0 1.0;
+            min: 200 0;
+            fixed: 1 0;
+            align: 0 0.5;
+         }
+      }
+      part { name: "group_spacer";
+         type: SPACER;
+         scale: 1;
+         description {
+            rel1.to: "line_spacer";
+            rel1.relative: 0.0 0.0;
+            rel2.to: "line_spacer";
+            rel2.relative: 0.0 1.0;
+            min: 200 0;
+            fixed: 1 0;
+            align: 1 0.5;
+         }
+      }
+      part { name: "elm.text.group[";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to_x: "cursor_spacer";
+            rel2.to_x: "elm.text.group_name";
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 1 0.5;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "Group [";
+               size: 11;
+               align: 1 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.group_name";
+         type: TEXT;
          clip_to: "base_clip";
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "group_spacer";
+            rel2.to_x: "elm.text.group]";
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 1 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 1 0.5;
+               min: 0 0;
+               max: 1 0;
+            }
+         }
+      }
+      part { name: "elm.text.group]";
+         type: TEXT;
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         clip_to: "base_clip";
+         description {
+            rel1.to_x: "line_spacer";
+            rel1.relative: 0 0.0;
+            rel2.to_x: "line_spacer";
+            rel2.relative: 0 1.0;
+            align: 1 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "]";
+               size: 11;
+               align: 1 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "line_spacer";
+         type: SPACER;
+         scale: 1;
          description {
             rel1.relative: 1 0;
+            align: 1 0.5;
+            min: 100 0;
+            fixed: 1 0;
+         }
+      }
+      part { name: "elm.text.line_[";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to: "elm.text.line_cur";
+            rel2.to: "elm.text.line_cur";
+            rel2.relative: 0 1.0;
+            align: 1 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "Line [";
+               size: 11;
+               align: 1 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.line_cur";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to: "elm.text.line_c";
+            rel2.to: "elm.text.line_c";
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 1 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 1 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.line_c";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.to: "elm.text.line_max";
+            rel2.to: "elm.text.line_max";
+            rel2.relative: 0 1.0;
+            align: 1 0.5;
+            fixed: 1 0;
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: ":";
+               size: 11;
+               align: 1 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.line_max";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: GLOW;
+         description { state: "default" 0.0;
+            rel1.to_x: "elm.text.line]";
+            rel2.to_x: "elm.text.line]";
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 1 0.5;
+            fixed: 1 0;
+            color: 51 153 255 255;
+            color2: 51 153 255 24;
+            color3: 51 153 255 18;
+            text {
+               size: 11;
+               align: 1 0.5;
+               min: 1 0;
+               ellipsis: -1;
+            }
+         }
+      }
+      part { name: "elm.text.line]";
+         type: TEXT;
+         clip_to: "base_clip";
+         scale: 1;
+         effect: SHADOW BOTTOM;
+         description { state: "default" 0.0;
+            rel1.relative: 1 0;
             rel1.offset: 0 -2;
             rel2.offset: -1 -3;
             align: 1 0.5;
-            min: 100 14;
             fixed: 1 0;
-            text.style: "entry_statusbar_style";
+            color: 255 255 255 255;
+            color3: 0 0 0 128;
+            text {
+               text: "]";
+               size: 11;
+               align: 1 0;
+               min: 1 0;
+               ellipsis: -1;
+            }
          }
       }
       part { name: "elm.text.info_msg";
diff --git a/src/bin/statusbar.c b/src/bin/statusbar.c
index 0edee74..b42956b 100644
--- a/src/bin/statusbar.c
+++ b/src/bin/statusbar.c
@@ -16,10 +16,12 @@ stats_line_num_update(int cur_line, int max_line)
 {
    stats_data *sd = g_sd;
 
-   char buf[128];
-   snprintf(buf, sizeof(buf),
-            "<align=right>Line 
[<style=glow><color=#3399ff>%d</color></style>:<style=glow><color=#3399ff>%d</color></style>]</align>",
 cur_line, max_line);
-   elm_object_part_text_set(sd->layout, "elm.text.line", buf);
+   char buf[20];
+   snprintf(buf, sizeof(buf), "%d", cur_line);
+   elm_object_part_text_set(sd->layout, "elm.text.line_cur", buf);
+   snprintf(buf, sizeof(buf), "%d", max_line);
+   elm_object_part_text_set(sd->layout, "elm.text.line_max", buf);
+
    sd->cur_line = cur_line;
    sd->max_line = max_line;
 }
@@ -28,10 +30,7 @@ void
 stats_edc_group_update(Eina_Stringshare *group_name)
 {
    stats_data *sd = g_sd;
-
-   char buf[1028];
-   snprintf(buf, sizeof(buf), "<align=right>Group 
[<style=glow><color=#3399ff>%s</color></style></align>", group_name);
-   elm_object_part_text_set(sd->layout, "elm.text.group_name", buf);
+   elm_object_part_text_set(sd->layout, "elm.text.group_name", group_name);
    sd->group_name = eina_stringshare_add(group_name);
 }
 
@@ -89,20 +88,26 @@ stats_view_size_update(void)
    Evas_Coord w, h;
    config_view_size_get(&w, &h);
 
-   char buf[128];
-   snprintf(buf, sizeof(buf),
-            "Size 
[<style=glow><color=#3399ff>%d</color></style>x<style=glow><color=#3399ff>%d</color></style>]",
 w, h);
-
-   elm_object_part_text_set(sd->layout, "elm.text.view_size", buf);
+   char buf[10];
+   snprintf(buf, sizeof(buf), "%d", w);
+   elm_object_part_text_set(sd->layout, "elm.text.size_w", buf);
+   snprintf(buf, sizeof(buf), "%d", h);
+   elm_object_part_text_set(sd->layout, "elm.text.size_h", buf);
 }
 
 void
 stats_cursor_pos_update(Evas_Coord x, Evas_Coord y, float rel_x, float rel_y)
 {
    stats_data *sd = g_sd;
-   char buf[250];
-   snprintf(buf, sizeof(buf),
-            "Cursor 
[<style=glow><color=#3399ff>%d</color></style>,<style=glow><color=#3399ff>%d</color></style>]
 
[<style=glow><color=#3399ff>%0.2f</color></style>,<style=glow><color=#3399ff>%0.2f</color></style>]",
 x, y, rel_x, rel_y);
 
-   elm_object_part_text_set(sd->layout, "elm.text.cur_pos", buf);
+   char buf[10];
+   snprintf(buf, sizeof(buf), "%d", x);
+   elm_object_part_text_set(sd->layout, "elm.text.cursor_pxx", buf);
+   snprintf(buf, sizeof(buf), "%d", y);
+   elm_object_part_text_set(sd->layout, "elm.text.cursor_pxy", buf);
+
+   snprintf(buf, sizeof(buf), "%0.2f", rel_x);
+   elm_object_part_text_set(sd->layout, "elm.text.cursor_relx", buf);
+   snprintf(buf, sizeof(buf), "%0.2f", rel_y);
+   elm_object_part_text_set(sd->layout, "elm.text.cursor_rely", buf);
 }

-- 


Reply via email to