Tone things down a bit. Clicking a image in normal view or list view now
lets you view that image in the single view. Exif has been temporarily moved. SVN revision: 29218
This commit is contained in:
parent
af70959233
commit
8dc67a437d
|
@ -18,7 +18,6 @@ EXTRA_DIST = \
|
|||
bits/label.edc \
|
||||
bits/scrollbar.edc \
|
||||
bits/scrollpane.edc \
|
||||
bits/select.edc \
|
||||
bits/spacer.edc \
|
||||
bits/tree.edc \
|
||||
bits/window.edc
|
||||
|
|
|
@ -6,7 +6,6 @@ combo.edc \
|
|||
label.edc \
|
||||
scrollbar.edc \
|
||||
scrollpane.edc \
|
||||
select.edc \
|
||||
spacer.edc \
|
||||
tree.edc \
|
||||
window.edc
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
group
|
||||
{
|
||||
name: "/ephoto/select";
|
||||
parts
|
||||
{
|
||||
part
|
||||
{
|
||||
name: "selection";
|
||||
type: RECT;
|
||||
mouse_events: 1;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
description
|
||||
{
|
||||
state: "selected" 0.0;
|
||||
color: 71 135 195 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs
|
||||
{
|
||||
program
|
||||
{
|
||||
name: "select";
|
||||
signal: "selected";
|
||||
source: "EWL";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
target: "selection";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "unselect";
|
||||
signal: "unselected";
|
||||
source: "EWL";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "selection";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group
|
||||
{
|
||||
name: "/ephoto/select/highlight";
|
||||
parts
|
||||
{
|
||||
part
|
||||
{
|
||||
name: "highlight";
|
||||
type: RECT;
|
||||
mouse_events: 1;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
description
|
||||
{
|
||||
state: "highlighted" 0.0;
|
||||
color: 71 135 195 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs
|
||||
{
|
||||
program
|
||||
{
|
||||
name: "highlighted";
|
||||
signal: "mouse,in";
|
||||
source: "EWL";
|
||||
action: STATE_SET "highlighted" 0.0;
|
||||
target: "highlight";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "default";
|
||||
signal: "mouse,out";
|
||||
source: "EWL";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "highlight";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,6 +22,23 @@ group
|
|||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part
|
||||
{
|
||||
name: "highlight";
|
||||
type: RECT;
|
||||
description
|
||||
{
|
||||
state: "default" 0.0;
|
||||
visible: 0;
|
||||
color: 71 135 195 255;
|
||||
}
|
||||
description
|
||||
{
|
||||
state: "selected" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs
|
||||
{
|
||||
|
@ -41,5 +58,21 @@ group
|
|||
action: STATE_SET "odd" 0.0;
|
||||
target: "background";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "selected";
|
||||
signal: "tree-selected";
|
||||
source: "*";
|
||||
action: STATE_SET "selected" 0.0;
|
||||
target: "highlight";
|
||||
}
|
||||
program
|
||||
{
|
||||
name: "unselected";
|
||||
signal: "tree-deselect";
|
||||
source: "*";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "highlight";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ collections
|
|||
#include "bits/scrollbar.edc"
|
||||
#include "bits/scrollpane.edc"
|
||||
#include "bits/seeker.edc"
|
||||
#include "bits/select.edc"
|
||||
#include "bits/separator.edc"
|
||||
#include "bits/shadow.edc"
|
||||
#include "bits/spacer.edc"
|
||||
|
@ -37,7 +36,6 @@ data
|
|||
item: "/combo/button/group" "/ephoto/combo/button";
|
||||
item: "/combo/cell/group" "/ephoto/combo/contents";
|
||||
item: "/combo/popup/group" "/ephoto/combo/popup";
|
||||
item: "/combo/popup/vbox/cell/group" "/ephoto/select/highlight";
|
||||
item: "/entry/group" "/ephoto/entry";
|
||||
item: "/entry/cursor/group" "/ephoto/entry/cursor";
|
||||
item: "/freebox/auto/padding" 16;
|
||||
|
@ -48,9 +46,6 @@ data
|
|||
item: "/hseeker/group" "/ephoto/hseeker";
|
||||
item: "/hseeker/hbutton/group" "/ephoto/hseeker/button";
|
||||
item: "/hseparator/group" "/ephoto/hseparator";
|
||||
item: "/icon/group" "/ephoto/select";
|
||||
item: "/image_thumbnail/group" "/ephoto/select";
|
||||
item: "/image/group" "/ephoto/select";
|
||||
item: "/label/group" "/ephoto/label";
|
||||
item: "/label/textpart" "/ephoto/label/text";
|
||||
item: "/notebook/pages/group" "/ephoto/window";
|
||||
|
|
|
@ -88,7 +88,7 @@ Ewl_Widget *add_ltree(Ewl_Widget *c);
|
|||
|
||||
/* Ephoto Normal View */
|
||||
Ewl_Widget *add_normal_view(Ewl_Widget *c);
|
||||
void set_info(Ewl_Widget *w, void *event, void *data);
|
||||
void freebox_image_clicked(Ewl_Widget *w, void *event, void *data);
|
||||
|
||||
/* Ephoto Slideshow */
|
||||
void start_slideshow(Ewl_Widget *w, void *event, void *data);
|
||||
|
@ -111,15 +111,11 @@ struct _Ephoto_Main
|
|||
Ecore_List *albums;
|
||||
Ecore_List *images;
|
||||
Ewl_Widget *atree;
|
||||
Ewl_Widget *currenta;
|
||||
Ewl_Widget *currentf;
|
||||
Ewl_Widget *currentl;
|
||||
Ewl_Widget *edit_tools;
|
||||
Ewl_Widget *edit_vbox;
|
||||
Ewl_Widget *eimage;
|
||||
Ewl_Widget *fbox_vbox;
|
||||
Ewl_Widget *fbox;
|
||||
Ewl_Widget *ilabel;
|
||||
Ewl_Widget *list_vbox;
|
||||
Ewl_Widget *ltree;
|
||||
Ewl_Widget *tbar;
|
||||
|
|
|
@ -27,9 +27,15 @@ Ewl_Widget *add_edit_view(Ewl_Widget *c)
|
|||
/*Show the edit view*/
|
||||
void show_edit_view(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
char *path = data;
|
||||
|
||||
ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->edit_vbox);
|
||||
ecore_dlist_goto_first(em->images);
|
||||
ewl_widget_hide(em->ilabel);
|
||||
if (path)
|
||||
{
|
||||
ewl_image_file_path_set(EWL_IMAGE(em->eimage), path);
|
||||
free(path);
|
||||
}
|
||||
else ewl_image_file_path_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images));
|
||||
}
|
||||
|
||||
/*Add edit tools to container c*/
|
||||
|
@ -37,6 +43,14 @@ void add_edit_tools(Ewl_Widget *c)
|
|||
{
|
||||
Ewl_Widget *image, *sep;
|
||||
|
||||
image = add_image(c, PACKAGE_DATA_DIR "/images/get_exif.png", 0, NULL, NULL);
|
||||
ewl_image_constrain_set(EWL_IMAGE(image), 30);
|
||||
ewl_attach_tooltip_text_set(image, "You do not have libexif 0.6.13");
|
||||
#ifdef BUILD_EXIF_SUPPORT
|
||||
ewl_callback_append(image, EWL_CALLBACK_CLICKED, display_exif_dialog, NULL);
|
||||
ewl_attach_tooltip_text_set(image, "View Exif Data");
|
||||
#endif
|
||||
|
||||
image = add_image(c, PACKAGE_DATA_DIR "/images/undo.png", 0, rotate_image_left, NULL);
|
||||
ewl_image_constrain_set(EWL_IMAGE(image), 30);
|
||||
ewl_attach_tooltip_text_set(image, "Rotate Image Left");
|
||||
|
|
|
@ -59,18 +59,7 @@ static const char *get_image(void)
|
|||
{
|
||||
const char *img = NULL;
|
||||
|
||||
if (VISIBLE(em->fbox_vbox) && em->currentf)
|
||||
{
|
||||
img = ewl_widget_name_get(em->currentf);
|
||||
}
|
||||
else if (VISIBLE(em->list_vbox) && em->currentl)
|
||||
{
|
||||
img = ewl_widget_name_get(em->currentl);
|
||||
}
|
||||
else if (VISIBLE(em->edit_vbox))
|
||||
{
|
||||
img = ewl_image_file_path_get(EWL_IMAGE(em->eimage));
|
||||
}
|
||||
if (VISIBLE(em->edit_vbox)) img = ewl_image_file_path_get(EWL_IMAGE(em->eimage));
|
||||
if(!img) return NULL;
|
||||
return strdup(img);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ static Ewl_Widget *list_view_new(void *data, int column, int row);
|
|||
static Ewl_Widget *list_header_fetch(void *data, int column);
|
||||
static void *list_data_fetch(void *data, unsigned int row, unsigned int column);
|
||||
static int list_data_count(void *data);
|
||||
static void set_active_list_view(Ewl_Widget *w, void *event, void *data);
|
||||
|
||||
/*Add the list view*/
|
||||
Ewl_Widget *add_list_view(Ewl_Widget *c)
|
||||
|
@ -24,20 +23,6 @@ Ewl_Widget *add_list_view(Ewl_Widget *c)
|
|||
void show_list_view(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->list_vbox);
|
||||
ewl_mvc_dirty_set(EWL_MVC(em->ltree), 1);
|
||||
ewl_widget_hide(em->ilabel);
|
||||
}
|
||||
|
||||
static void set_active_list_view(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
if (em->currentl)
|
||||
{
|
||||
ewl_widget_state_set(em->currentl, "unselected", EWL_STATE_PERSISTENT);
|
||||
}
|
||||
em->currentl = w;
|
||||
ewl_widget_state_set(em->currentl, "selected", EWL_STATE_PERSISTENT);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*Create and Add a Tree to the Container c*/
|
||||
|
@ -89,7 +74,7 @@ static Ewl_Widget *list_view_new(void *data, int row, int column)
|
|||
hbox = ewl_hbox_new();
|
||||
ewl_box_spacing_set(EWL_BOX(hbox), 10);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL);
|
||||
ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, set_active_list_view, NULL);
|
||||
ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, show_edit_view, strdup(image));
|
||||
ewl_widget_name_set(hbox, image);
|
||||
ewl_widget_show(hbox);
|
||||
|
||||
|
|
|
@ -138,14 +138,6 @@ void create_main_gui(void)
|
|||
ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep);
|
||||
ewl_widget_show(vsep);
|
||||
|
||||
button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/get_exif.png", NULL, NULL);
|
||||
ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 30);
|
||||
ewl_attach_tooltip_text_set(button, "You do not have libexif 0.6.13");
|
||||
#ifdef BUILD_EXIF_SUPPORT
|
||||
ewl_callback_append(button, EWL_CALLBACK_CLICKED, display_exif_dialog, NULL);
|
||||
ewl_attach_tooltip_text_set(button, "View Exif Data");
|
||||
#endif
|
||||
|
||||
button = add_button(em->toolbar, NULL, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", window_fullscreen, NULL);
|
||||
ewl_image_size_set(EWL_IMAGE(EWL_BUTTON(button)->image_object), 30, 30);
|
||||
ewl_attach_tooltip_text_set(button, "Toggle Fullscreen");
|
||||
|
@ -175,14 +167,6 @@ static void populate(Ewl_Widget *w, void *event, void *data)
|
|||
if (w)
|
||||
{
|
||||
album = (char *)ewl_widget_name_get(w);
|
||||
if (em->currenta)
|
||||
{
|
||||
ewl_widget_state_set(em->currenta, "unselected", EWL_STATE_PERSISTENT);
|
||||
ewl_widget_state_set(EWL_ICON(em->currenta)->label, "default", EWL_STATE_PERSISTENT);
|
||||
}
|
||||
em->currenta = w;
|
||||
ewl_widget_state_set(em->currenta, "selected", EWL_STATE_PERSISTENT);
|
||||
ewl_widget_state_set(EWL_ICON(em->currenta)->label, "blue", EWL_STATE_PERSISTENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -203,21 +187,18 @@ static void populate(Ewl_Widget *w, void *event, void *data)
|
|||
{
|
||||
imagef = ecore_dlist_current(em->images);
|
||||
|
||||
thumb = add_image(em->fbox, imagef, 1, set_info, NULL);
|
||||
thumb = add_image(em->fbox, imagef, 1, freebox_image_clicked, NULL);
|
||||
ewl_image_constrain_set(EWL_IMAGE(thumb), 64);
|
||||
ewl_object_alignment_set(EWL_OBJECT(thumb), EWL_FLAG_ALIGN_CENTER);
|
||||
ewl_widget_name_set(thumb, imagef);
|
||||
|
||||
ecore_dlist_next(em->images);
|
||||
}
|
||||
|
||||
ecore_dlist_goto_first(em->images);
|
||||
|
||||
ewl_mvc_data_set(EWL_MVC(em->ltree), em->images);
|
||||
ewl_mvc_dirty_set(EWL_MVC(em->ltree), 1);
|
||||
|
||||
ewl_image_file_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images), NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,10 +21,6 @@ Ewl_Widget *add_normal_view(Ewl_Widget *c)
|
|||
ewl_container_child_append(EWL_CONTAINER(sp), em->fbox);
|
||||
ewl_widget_show(em->fbox);
|
||||
|
||||
em->ilabel = add_label(em->fbox_vbox, "Image Information");
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(em->ilabel), EWL_FLAG_FILL_HFILL);
|
||||
ewl_widget_state_set(em->ilabel, "colored", EWL_STATE_PERSISTENT);
|
||||
|
||||
return em->fbox_vbox;
|
||||
}
|
||||
|
||||
|
@ -32,31 +28,15 @@ Ewl_Widget *add_normal_view(Ewl_Widget *c)
|
|||
void show_normal_view(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->fbox_vbox);
|
||||
ewl_widget_show(em->ilabel);
|
||||
}
|
||||
|
||||
/*Set the info that is in the info label on normal view*/
|
||||
void set_info(Ewl_Widget *w, void *event, void *data)
|
||||
void freebox_image_clicked(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
const char *path, *pixels, *size;
|
||||
char info[PATH_MAX];
|
||||
time_t modtime;
|
||||
|
||||
if (ewl_widget_type_is(w, EWL_IMAGE_TYPE))
|
||||
{
|
||||
if (em->currentf) ewl_widget_state_set(em->currentf, "unselected", EWL_STATE_PERSISTENT);
|
||||
em->currentf = w;
|
||||
ewl_widget_state_set(em->currentf, "selected", EWL_STATE_PERSISTENT);
|
||||
}
|
||||
const char *path;
|
||||
|
||||
path = ewl_widget_name_get(w);
|
||||
pixels = image_pixels_string_get(path);
|
||||
size = file_size_get(ecore_file_size(path));
|
||||
modtime = ecore_file_mod_time(path);
|
||||
snprintf(info, PATH_MAX, "%s - %s - %s", basename((char *)path), pixels, size);
|
||||
|
||||
ewl_label_text_set(EWL_LABEL(em->ilabel), info);
|
||||
ewl_widget_reparent(em->ilabel);
|
||||
show_edit_view(NULL, NULL, strdup(path));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue