mrobe changes:

stop it thinking the battery is always flat and shutting down
add keymap for time/date screen
pressing a list item will highlight it before accepting it (looks better than it just entering the item without the selection changing first)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15280 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-10-23 14:33:16 +00:00
parent dbff3731a5
commit eed41ff985
4 changed files with 23 additions and 6 deletions

View file

@ -301,6 +301,6 @@ int action_get_touchpad_press(short *x, short *y)
return BUTTON_REPEAT; return BUTTON_REPEAT;
if (short_press) if (short_press)
return BUTTON_REL; return BUTTON_REL;
return BUTTON_NONE; return BUTTON_TOUCHPAD;
} }
#endif #endif

View file

@ -918,6 +918,8 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * lists)
short x,y; short x,y;
unsigned button = action_get_touchpad_press(&x, &y); unsigned button = action_get_touchpad_press(&x, &y);
int line; int line;
if (button == BUTTON_NONE)
return ACTION_NONE;
if (x<SCROLLBAR_WIDTH) if (x<SCROLLBAR_WIDTH)
{ {
/* top left corner is hopefully GO_TO_ROOT */ /* top left corner is hopefully GO_TO_ROOT */
@ -956,7 +958,16 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * lists)
else else
{ {
if (button != BUTTON_REL && button != BUTTON_REPEAT) if (button != BUTTON_REL && button != BUTTON_REPEAT)
return ACTION_NONE; {
if (global_settings.statusbar)
y -= STATUSBAR_HEIGHT;
if (SHOW_LIST_TITLE)
y -= gui_list->display->char_height;
line = y / gui_list->display->char_height;
if (line != gui_list->selected_item - gui_list->start_item)
gui_synclist_select_item(lists, gui_list->start_item+line);
return ACTION_REDRAW;
}
/* title or statusbar is cancel */ /* title or statusbar is cancel */
if (global_settings.statusbar) if (global_settings.statusbar)
{ {

View file

@ -86,6 +86,12 @@ static const struct button_mapping button_context_listtree_scroll_without_combo[
}; };
static const struct button_mapping button_context_settings[] = { static const struct button_mapping button_context_settings[] = {
{ ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_RC_HEART, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_RC_MODE, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_settings */ }; /* button_context_settings */

View file

@ -26,24 +26,24 @@
unsigned short current_voltage = 3910; unsigned short current_voltage = 3910;
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{ {
3450 0
}; };
const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
{ {
3400 0
}; };
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
{ {
{ 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 }, { 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320 },
}; };
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
const unsigned short percent_to_volt_charge[11] = const unsigned short percent_to_volt_charge[11] =
{ {
3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320,
}; };
void read_battery_inputs(void) void read_battery_inputs(void)
{ {