[Google-Desktop-Developer] Re: Help testing a new plugin
very interesting and useful. :) i too would like to have a 'add item'
button at the bottom (or better, at the top like the todo panel so that
it never goes out of view). you can do that similar to how the calendar
plugin has the 'add note' button, which is basically an item that
responds to the onDetailsView event.
can the 'idle task' be removed? not sure what purpose it serves and if
you ran into any trouble without such an item.
about the layout, as you mentioned in the site it would be nice to see
more text about the task without getting clipped. why not use a
news-like layout where you have the task description in the title and
the time counter as the 'source' parameter? that way your time is
automatically displayed in a different color easier to recognize and
you have more space for the task description if needed. yes it does
make it slightly harder to find where the time used is (for non-current
tasks) but the advantage is that you can more easily recognize which
task you want to click at since it takes more space and shows more
info.
I tried it out by modifying the plugin source, and here is the modified
'DisplayTask' function which shows what I am talking about. Overall, a
really useful plugin :)
----
function DisplayTask(task) {
var newTask = new ContentItem();
var taskHour = parseInt(task.taskTime / 3600);
var taskMin = parseInt(task.taskTime / 60) % 3600;
var taskSec = task.taskTime % 60;
if(task.active) newTask.flags = gddContentItemFlagPinned;
if(task.id == 0) { // if task is the idle task
if(task.active) {
newTask.flags = gddContentItemFlagNoRemove +
gddContentItemFlagPinned; // if the idle task is active, pin it
} else {
newTask.flags = gddContentItemFlagNoRemove;
}
newTask.heading = task.taskHeading;
} else { // only show timestamp if the task is not the idle task
newTask.heading = tasks[i].taskHeading;
newTask.layout = gddContentItemLayoutNews;
newTask.source = "-- " +
((taskHour < 10) ? "0" : "") + taskHour + ":" +
((taskMin < 10) ? "0" : "") + taskMin + ":" +
((taskSec < 10) ? "0" : "") + taskSec + " --";
}
newTask.onRemoveItem = RemoveTask;
newTask.snippet = task.id;
newTask.onToggleItemPinnedState = ToggleItemPinnedState;
pluginHelper.AddContentItem(newTask, gddItemDisplayInSidebar);
}
----
0 Comments:
Yorum Gönder
<< Home