Hello,
I, just this evening, started using the forecast module. I like it very
much.
However, I find that the popup... popping up on a hover is terribly
annoying. Its annoying for me because I like to keep it in the upper
right corner of my screen. Being there, every time I minimize a
window... I am then hovering over it, and it pops up. :(
So I wanted to have an option to have the popup window popup on either a
mouse in or a mouse down.
The attached patch alters the config panel, and provides a way to
disable the "popup on hover". If "popup on hover" is unchecked, the
popup will appear on a mouse down, and stay pinned. A second mouse down
will hide it.
PLEASE NOTE:
This patch also changes the default popup behavior to popup on the mouse
down. This is by design. My argument for doing it this way is... The
original was not a popup on *hover*... but popup immediately on a mouse
in. This meant that if you just passed over it carelessly... it popped
up. That bothered me too. A timer, to create a short "hover" delay
would be necessary to make the hover work properly, imho.
I hope someone finds this useful. :)
--
Regards,
Ravenlock
Index: e_modules/forecasts/e_mod_config.c
===================================================================
RCS file: /var/cvs/e/e_modules/forecasts/e_mod_config.c,v
retrieving revision 1.5
diff -u -r1.5 e_mod_config.c
--- e_modules/forecasts/e_mod_config.c 14 Mar 2007 11:39:02 -0000 1.5
+++ e_modules/forecasts/e_mod_config.c 21 Mar 2007 02:13:29 -0000
@@ -8,6 +8,7 @@
int degrees;
char *code;
int show_text;
+ int popup_on_hover;
};
static void *_create_data(E_Config_Dialog * cfd);
@@ -50,6 +51,7 @@
if (ci->code)
cfdata->code = strdup(ci->code);
cfdata->show_text = ci->show_text;
+ cfdata->popup_on_hover = ci->popup_on_hover;
}
static void *
@@ -94,6 +96,8 @@
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Show Description"), &(cfdata->show_text));
e_widget_framelist_object_append(of, ob);
+ ob = e_widget_check_add(evas, _("Popup on hover"),
&(cfdata->popup_on_hover));
+ e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, D_("Unit Settings"), 0);
@@ -142,6 +146,7 @@
*t = toupper(*t);
ci->code = evas_stringshare_add(t);
ci->show_text = cfdata->show_text;
+ ci->popup_on_hover = cfdata->popup_on_hover;
e_config_save_queue();
_forecasts_config_updated(ci->id);
Index: e_modules/forecasts/e_mod_main.c
===================================================================
RCS file: /var/cvs/e/e_modules/forecasts/e_mod_main.c,v
retrieving revision 1.7
diff -u -r1.7 e_mod_main.c
--- e_modules/forecasts/e_mod_main.c 14 Mar 2007 11:39:02 -0000 1.7
+++ e_modules/forecasts/e_mod_main.c 21 Mar 2007 02:13:30 -0000
@@ -130,6 +130,7 @@
static Evas_Object * _forecasts_popup_icon_create(Popup *popup, int code);
static void _forecasts_popup_destroy(Instance *inst);
static void _forecasts_popup_toggle_pinned_state(Popup *popup);
+static void _forecasts_display_popup(void *data, Evas *e, Evas_Object *obj,
void *event_info);
/* Gadcon Functions */
static E_Gadcon_Client *
@@ -1112,8 +1113,14 @@
{
Instance *inst;
Evas_Event_Mouse_Down *ev;
+ Config_Item *ci;
inst = data;
+ ci = _forecasts_config_item_get(inst->gcc->id);
+ if (!ci) return;
+ if (!ci->popup_on_hover)
+ _forecasts_display_popup(data, e,obj, event_info);
+
ev = event_info;
if (ev->button == 1) {
_forecasts_popup_toggle_pinned_state(inst->popup);
@@ -1121,12 +1128,12 @@
}
static void
-_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+_forecasts_display_popup(void *data, Evas *e, Evas_Object *obj, void
*event_info)
{
Instance *inst;
int ww, wh;
Evas_Coord gx, gy, gw, gh, zw, zh, px, py;
-
+
inst = data;
if (!inst->popup) return;
e_popup_show(inst->popup->win);
@@ -1189,6 +1196,20 @@
return;
}
e_popup_move_resize(inst->popup->win, px, py, inst->popup->w,
inst->popup->h);
+
+}
+
+static void
+_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Instance *inst;
+ Config_Item *ci;
+
+ inst = data;
+ ci = _forecasts_config_item_get(inst->gcc->id);
+ if (!ci || !ci->popup_on_hover) return;
+
+ _forecasts_display_popup(data, e,obj, event_info);
}
static void
Index: e_modules/forecasts/e_mod_main.h
===================================================================
RCS file: /var/cvs/e/e_modules/forecasts/e_mod_main.h,v
retrieving revision 1.3
diff -u -r1.3 e_mod_main.h
--- e_modules/forecasts/e_mod_main.h 3 Mar 2007 18:29:20 -0000 1.3
+++ e_modules/forecasts/e_mod_main.h 21 Mar 2007 02:13:30 -0000
@@ -27,6 +27,7 @@
int degrees;
const char *host, *code;
int show_text;
+ int popup_on_hover;
};
struct _Popup
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel