Enlightenment CVS committal
Author : handyande
Project : e17
Module : apps/examine
Dir : e17/apps/examine/src
Modified Files:
examine.c examine_client.c
Log Message:
Add captions for theme previews - and have a bit more space to display in
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/examine/src/examine.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- examine.c 13 May 2004 15:08:51 -0000 1.13
+++ examine.c 23 May 2004 16:05:33 -0000 1.14
@@ -178,17 +178,15 @@
change = (examine_prop *) user_data;
- if (!(theme = rindex(EWL_IMAGE(w)->path, '/') + 1))
- theme = EWL_IMAGE(w)->path;
-
- theme = strdup(theme);
- if (ext = rindex(theme, '.'))
- *ext = '\0';
+ theme = strdup(EWL_TEXT(EWL_CONTAINER(w)->redirect)->text);
ewl_container_child_iterate_begin(EWL_CONTAINER(w->parent));
- while (sibling = ewl_container_next_child(EWL_CONTAINER(w->parent)))
- ewl_object_set_padding(EWL_OBJECT(sibling), 2, 2, 2, 2);
- ewl_object_set_padding(EWL_OBJECT(w), 0, 0, 0, 0);
+ while (sibling = ewl_container_next_child(EWL_CONTAINER(w->parent))) {
+ sibling = EWL_WIDGET(EWL_CONTAINER(sibling)->redirect);
+ if (strcmp(EWL_TEXT(sibling)->text, theme))
+ ewl_text_color_set(EWL_TEXT(sibling), 0, 0, 0, 0xFF);
+ ewl_text_color_set(EWL_TEXT(sibling), 0xFF, 0, 0, 0xFF);
+ }
if (change->value.ptr)
free(change->value.ptr);
@@ -200,7 +198,7 @@
void
draw_tree(examine_prop * prop_item)
{
- Ewl_Widget *entries[2], *tree_box, *tmp_row, *tmp;
+ Ewl_Widget *entries[2], *tree_box, *tmp_row, *tmp, *tmp_col, *tmp_text;
examine_panel *panel_ptr;
char *key_tmp;
char *panel_name;
@@ -292,6 +290,7 @@
DIR *dp;
char *search_path, *path, *ptr, *end;
char *file;
+ int file_len;
entries[1] = ewl_hbox_new();
@@ -321,10 +320,31 @@
tmp = ewl_image_new(file, (char *) prop_item->data);
ewl_widget_show(tmp);
- ewl_container_append_child(EWL_CONTAINER(entries[1]), tmp);
- ewl_callback_append(tmp, EWL_CALLBACK_CLICKED, cb_choose_theme,
+ free(file);
+
+ file_len = strlen(next->d_name) - 4; /* 4 = .eet*/
+ file = malloc(file_len + 1);
+ strncpy(file, next->d_name, file_len);
+ *(file + file_len) = '\0';
+ tmp_text = ewl_text_new(file);
+ ewl_object_set_alignment(EWL_OBJECT(tmp_text), EWL_FLAG_ALIGN_CENTER);
+
+ ewl_widget_show(tmp_text);
+ free(file);
+
+ tmp_col = ewl_vbox_new();
+ ewl_widget_show(tmp_col);
+
+ ewl_container_append_child(EWL_CONTAINER(tmp_col), tmp);
+ ewl_container_append_child(EWL_CONTAINER(tmp_col), tmp_text);
+ ewl_container_append_child(EWL_CONTAINER(entries[1]), tmp_col);
+ ewl_callback_append(tmp_col, EWL_CALLBACK_CLICKED, cb_choose_theme,
prop_item);
- ewl_object_set_padding(EWL_OBJECT(tmp), 2, 2, 2, 2);
+
+ ewl_container_set_redirect(EWL_CONTAINER(tmp_col),
+ EWL_CONTAINER(tmp_text));
+ ewl_object_set_padding(EWL_OBJECT(tmp_col), 2, 2, 0, 0);
+ ewl_object_set_minimum_h(EWL_OBJECT(tmp_col), 60);
}
ptr++;
path = ptr;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/examine/src/examine_client.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- examine_client.c 13 May 2004 15:08:51 -0000 1.10
+++ examine_client.c 23 May 2004 16:05:33 -0000 1.11
@@ -441,14 +441,12 @@
prop->value.ptr = strdup(ret);
prop->oldvalue.ptr = strdup(ret);
- tmp = malloc(strlen(ret) + 5); // 5 = .eet + \0
- strcpy(tmp, ret);
- strcat(tmp, ".eet");
ewl_container_child_iterate_begin(EWL_CONTAINER(prop->w));
- while (sibling = ewl_container_next_child(EWL_CONTAINER(prop->w)))
- if (!memcmp(EWL_IMAGE(sibling)->path + strlen(EWL_IMAGE(sibling)->path)
- - strlen(tmp), tmp, strlen(tmp)))
- ewl_object_set_padding(EWL_OBJECT(sibling), 0, 0, 0, 0);
+ while (sibling = ewl_container_next_child(EWL_CONTAINER(prop->w))) {
+ sibling = EWL_WIDGET(EWL_CONTAINER(sibling)->redirect);
+ if (!strcmp(EWL_TEXT(sibling)->text, ret))
+ ewl_text_color_set(EWL_TEXT(sibling), 0xFF, 0, 0, 0xFF);
+ }
break;
default: /* PT_STR, PT_RGB */
prop->value.ptr = strdup(ret);
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs