de-uglify desklock gfx - make it ask for your passowrd if you havent set one

up (config dialog instead of lock) and make it a menu item for obvious access
:)


SVN revision: 20808
This commit is contained in:
Carsten Haitzler 2006-02-27 06:35:56 +00:00
parent 6491c0bad9
commit 62ca6a2cbc
5 changed files with 512 additions and 415 deletions

View File

@ -1,72 +1,68 @@
images {
image, "e17_entry_cursor.png" COMP;
image, "e17_brushed.png" COMP;
image, "e17_logo.png" COMP;
image, "e17_gadman_overlay.png" COMP;
image: "e17_brushed.png" COMP;
image: "e17_"SM"reflection_shadow_overlay.png" LOSSY 90;
image: "e17_entry_cursor.png" COMP;
image: "e17_logo.png" COMP;
image: "e17_gadman_overlay.png" COMP;
}
group
{
group {
name, "widgets/desklock/main";
min, 640 480;
parts
{
part
{
name, "background";
type, IMAGE;
mouse_events, 0;
description
{
state, "default" 0.0;
rel1
{
relative, 0.0 0.0;
offset, 0 0;
part {
name: "background_image";
description {
state: "default" 0.0;
image {
normal: "e17_brushed.png";
}
rel2
{
relative, 1.0 1.0;
offset, -1 -1;
fill {
size {
relative: 0 0;
offset: 400 300;
}
image
{
normal, "e17_brushed.png";
}
}
}
part {
name: "reflection_shadow_overlay";
description {
state: "default" 0.0;
image {
normal: "e17_"SM"reflection_shadow_overlay.png";
}
}
}
part
{
name: "logo";
mouse_events, 0;
mouse_events: 0;
description
{
state, "default" 0.0;
min, 64 64;
max, 64 64;
//align, 0.5 0.0;
state: "default" 0.0;
min: 64 64;
max: 64 64;
//align: 0.5 0.0;
rel1
{
relative, 0.45 0.5;
offset, 0 0;
relative: 0.45 0.5;
offset: 0 0;
}
rel2
{
relative, 0.45 0.5;
offset, 0 0;
relative: 0.45 0.5;
offset: 0 0;
}
image
{
normal, "e17_logo.png";
normal: "e17_logo.png";
}
}
}
part
{
name: "text_label1";
name: "label";
type: TEXT;
effect: SHADOW;
description {
@ -76,21 +72,21 @@ images {
align: 0.0 0.5;
rel1
{
relative, 1.0 0.0;
offset, 20 0;
to, "logo";
relative: 1.0 0.0;
offset: 20 0;
to: "logo";
}
rel2
{
relative, 1.0 0.3;
offset, 0 0;
to, "logo";
relative: 1.0 0.3;
offset: 0 0;
to: "logo";
}
color: 0 0 0 255;
color3: 255 255 255 128;
text {
text: "Please enter your password to unlock:";
text: "Please enter your unlock password";
font: "Edje-Vera-Bold";
size: 10;
align: 0.0 0.5;
@ -100,58 +96,33 @@ images {
}
part
{
name, "passwd_border";
mouse_events, 0;
name: "passwd_entry_clip";
type: RECT;
mouse_events: 0;
description
{
state, "default" 0.0;
state: "default" 0.0;
visible: 1;
rel1
{
relative, 1.0 0.3;
offset, 0 0;
to, "logo";
relative: 0.0 0.0;
offset: 10 10;
to: "passwd_border";
}
rel2
{
relative, 5.0 0.9;
offset, 0 0;
to, "logo";
}
image
{
normal, "e17_gadman_overlay.png";
relative: 1.0 1.0;
offset: -17 -10;
to: "passwd_border";
}
}
}
part
{
name, "passwd_entry_clip";
type, RECT;
mouse_events, 0;
description
{
state, "default" 0.0;
visible, 1;
rel1
{
relative, 0.0 0.0;
offset, 10 10;
to, "passwd_border";
}
rel2
{
relative, 1.0 1.0;
offset, -17 -10;
to, "passwd_border";
}
}
}
part
{
name, "passwd";
type, TEXT;
effect, SOFT_SHADOW;
clip_to, "passwd_entry_clip";
name: "passwd";
type: TEXT;
effect: SHADOW;
clip_to: "passwd_entry_clip";
description {
state: "default" 0.0;
color: 0 0 0 255;
@ -160,15 +131,15 @@ images {
rel1
{
relative, 0.0 0.0;
offset, 0 0;
to, "passwd_entry_clip";
relative: 0.0 0.0;
offset: 0 0;
to: "passwd_entry_clip";
}
rel2
{
relative, 0.0 1.0;
offset, 0 0;
to, "passwd_entry_clip";
relative: 0.0 1.0;
offset: 0 0;
to: "passwd_entry_clip";
}
color: 0 0 0 255;
@ -185,9 +156,9 @@ images {
}
part
{
name, "cursor";
mouse_events, 0;
clip_to, "passwd_entry_clip";
name: "cursor";
mouse_events: 0;
clip_to: "passwd_entry_clip";
description {
state: "default" 0.0;
min: 16 16;
@ -209,5 +180,31 @@ images {
}
}
}
part
{
name: "passwd_border";
mouse_events: 0;
description
{
state: "default" 0.0;
rel1
{
relative: 1.0 0.3;
offset: 0 0;
to: "logo";
}
rel2
{
relative: 5.0 0.9;
offset: 0 0;
to: "logo";
}
image
{
normal: "e17_gadman_overlay.png";
border: 15 15 15 15;
}
}
}
}
}

View File

@ -86,5 +86,56 @@ group {
}
}
}
part {
name: "drag";
mouse_events: 1;
type: RECT;
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2 {
relative: 1.0 0.0;
offset: -3 5;
}
color: 255 0 0 100;
}
}
part {
name: "resize_l";
mouse_events: 1;
type: RECT;
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 2 6;
}
rel2 {
relative: 0.0 1.0;
offset: 5 -7;
}
color: 0 0 255 100;
}
}
part {
name: "resize_r";
mouse_events: 1;
type: RECT;
description {
state: "default" 0.0;
rel1 {
relative: 1.0 0.0;
offset: -6 6;
}
rel2 {
relative: 1.0 1.0;
offset: -3 -7;
}
color: 0 0 255 100;
}
}
}
}

View File

@ -1,11 +1,8 @@
#include "e.h"
#define ELOCK_POPUP_LAYER 10000
#define PASSWD_LEN 256
/**************************** private data ******************************/
typedef struct _E_Desklock_Data E_Desklock_Data;
typedef struct _E_Desklock_Popup_Data E_Desklock_Popup_Data;
@ -42,11 +39,23 @@ EAPI int
e_desklock_show(void)
{
Evas_List *managers, *l, *l2, *l3;
//E_Zone *zone = NULL;
int m = 0, c = 0, z = 0;
E_Desklock_Popup_Data *edp;
if (!e_config->desklock_personal_passwd)
{
E_Zone *zone;
zone = e_util_zone_current_get(e_manager_current_get());
if (zone)
{
E_Config_Dialog *cfd;
cfd = e_int_config_desklock(zone->container);
}
return 0;
}
if (!edd)
{
edd = E_NEW(E_Desklock_Data, 1);
@ -61,8 +70,8 @@ e_desklock_show(void)
for (l = managers; l; l = l->next)
{
E_Manager *man;
m ++;
m++;
man = l->data;
for (l2 = man->containers; l2; l2 = l2->next)
{
@ -95,12 +104,16 @@ e_desklock_show(void)
evas_event_freeze(edp->popup_wnd->evas);
edp->bg_object = edje_object_add(edp->popup_wnd->evas);
//FIXME: This should come from config file
e_theme_edje_object_set(edp->bg_object, "base/theme/desklock",
e_theme_edje_object_set(edp->bg_object,
"base/theme/desklock",
"widgets/desklock/main");
evas_object_move(edp->bg_object, 0, 0);
evas_object_resize(edp->bg_object, zone->w, zone->h);
evas_object_show(edp->bg_object);
edje_object_part_text_set(edp->bg_object, "title",
_("Please enter your unlock password"));
e_popup_edje_bg_object_set(edp->popup_wnd, edp->bg_object);
evas_event_thaw(edp->popup_wnd->evas);
@ -182,7 +195,7 @@ _e_desklock_cb_key_down(void *data, int type, void *event)
else if (!strcmp(ev->keysymbol, "KP_Enter"))
{
// here we have to go to auth
if (strcmp(edd->passwd, e_config->desklock_personal_passwd) == 0)
if (!strcmp(edd->passwd, e_config->desklock_personal_passwd))
{
e_desklock_hide();
return 1;
@ -196,7 +209,8 @@ _e_desklock_cb_key_down(void *data, int type, void *event)
else if (!strcmp(ev->keysymbol, "Return"))
{
// here we have to go to auth
if (strcmp(edd->passwd, e_config->desklock_personal_passwd) == 0)
if ((e_config->desklock_personal_passwd) &&
(!strcmp(edd->passwd, e_config->desklock_personal_passwd)))
{
e_desklock_hide();
return 1;
@ -292,7 +306,6 @@ _e_desklock_passwd_update()
edp = l->data;
edje_object_part_text_set(edp->bg_object, "passwd", passwd_hidden);
}
return;
}
static void
@ -313,6 +326,7 @@ _e_desklock_backspace()
}
}
}
static void
_e_desklock_delete()
{

View File

@ -25,6 +25,8 @@ static void _e_int_menus_main_del_hook (void *obj);
static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi);
static int _e_int_menus_main_run_defer_cb (void *data);
static void _e_int_menus_main_run (void *data, E_Menu *m, E_Menu_Item*mi);
static int _e_int_menus_main_lock_defer_cb (void *data);
static void _e_int_menus_main_lock (void *data, E_Menu *m, E_Menu_Item*mi);
static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_int_menus_main_exit (void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_int_menus_apps_scan (E_Menu *m);
@ -401,6 +403,22 @@ _e_int_menus_main_run(void *data, E_Menu *m, E_Menu_Item *mi)
ecore_idle_enterer_add(_e_int_menus_main_run_defer_cb, m->zone);
}
/* FIXME: this is a workaround for menus' haveing a key grab ANd exebuf
* wanting one too
*/
static int
_e_int_menus_main_lock_defer_cb(void *data)
{
e_desklock_show();
return 0;
}
static void
_e_int_menus_main_lock(void *data, E_Menu *m, E_Menu_Item *mi)
{
ecore_idle_enterer_add(_e_int_menus_main_lock_defer_cb, m->zone);
}
static void
_e_int_menus_main_fm(void *data, E_Menu *m, E_Menu_Item *mi)
{
@ -540,6 +558,15 @@ _e_int_menus_desktops_pre_cb(void *data, E_Menu *m)
E_Menu *root;
e_menu_pre_activate_callback_set(m, NULL, NULL);
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("Lock Screen"));
e_util_menu_item_edje_icon_set(mi, "enlightenment/lock");
e_menu_item_callback_set(mi, _e_int_menus_main_lock, NULL);
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
root = e_menu_root_get(m);
if ((root) && (root->zone))
{

View File

@ -9,6 +9,13 @@ static void _e_shelf_config_port(E_Config_Shelf_Config *cf1, E_Config_Shelf_Conf
static Evas_List *shelves = NULL;
static int shelf_id = 0;
/* FIXME: shelves need to do this:
* 1. allow them to be moved, resized etc. etc.
* 2. have a configuration panel per shelf to select if its inline, layer etc.
* 3. catch all right clicks not on modules for right click context menu
* 4. a global config dialog that lists shelves u have to configure them
*/
/* externally accessible functions */
EAPI int
e_shelf_init(void)
@ -131,7 +138,8 @@ e_shelf_zone_new(E_Zone *zone, char *name, char *style, int popup, int layer)
snprintf(buf, sizeof(buf), "shelf/%s/base", es->style);
evas_object_resize(es->o_base, es->w, es->h);
if (!e_theme_edje_object_set(es->o_base, "base/theme/shelf", buf))
e_theme_edje_object_set(es->o_base, "base/theme/shelf", "shelf/default/base");
e_theme_edje_object_set(es->o_base, "base/theme/shelf",
"shelf/default/base");
if (es->popup)
{
evas_object_show(es->o_base);