Commit a529dff3 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Can now create one-character directory names.

Dropping on the lower half of an open, empty directory will now drop
inside it rather than after it.
parent 4d616ea4
......@@ -586,12 +586,12 @@ static _kernel_oserror * hotlist_new_directory(hotlist_item * parent, char * dir
if (!*directory_name) directory_name = tokens;
else
{
int len = strlen(directory_name) - 1;
int len = strlen(directory_name);
while (len && directory_name[len] <= ' ') len--;
while (len && directory_name[len - 1] <= ' ') len--;
if (!len) directory_name = tokens;
else directory_name[len + 1] = '\0';
else directory_name[len] = '\0';
}
}
......@@ -5131,14 +5131,13 @@ static int hotlist_drag_completed_handler(int event_code, WimpPollBlock * event,
if ((-winy % item_height) > item_height / 2)
{
/* If we're over half way past the item, place after it, unless */
/* it is an open directory with something inside. Again, the */
/* null handler dealing with highlighting directory sprites */
/* reflects this situation correctly. */
/* it is an open directory. Again, the null handler dealing */
/* with highlighting directory sprites reflects this situation */
/* correctly. */
if (
targetitem->type == hl_directory &&
targetitem->flags & HOTLIST_D_IS_OPEN &&
targetitem->data.directory_content
targetitem->flags & HOTLIST_D_IS_OPEN
)
{
position = HOTLIST_POSITION_BEGINNING;
......@@ -5642,7 +5641,7 @@ static int hotlist_null_handler(int event_code, WimpPollBlock * event, IdBlock *
ChkError(hotlist_get_shape(&xmin, &xmax, item));
/* If we're over the directory sprite, or half way under the item height when */
/* the directory is open and has contents. */
/* the directory is open. */
if (
(
......@@ -5652,8 +5651,7 @@ static int hotlist_null_handler(int event_code, WimpPollBlock * event, IdBlock *
||
(
((-y % item_height) > item_height / 2) &&
item->flags & HOTLIST_D_IS_OPEN &&
item->data.directory_content
item->flags & HOTLIST_D_IS_OPEN
)
)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment