Style fixes to ListView
This commit is contained in:
@@ -3,11 +3,11 @@
|
|||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Ulrich Wimboeck
|
* Stephan Assmus, [email protected]
|
||||||
* Marc Flerackers ([email protected])
|
|
||||||
* Stephan Assmus <[email protected]>
|
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
* Rene Gollent ([email protected])
|
* Marc Flerackers, [email protected]
|
||||||
|
* Rene Gollent, [email protected]
|
||||||
|
* Ulrich Wimboeck
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -33,8 +33,10 @@ struct track_data {
|
|||||||
bigtime_t last_click_time;
|
bigtime_t last_click_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const float kDoubleClickTresh = 6;
|
const float kDoubleClickTresh = 6;
|
||||||
|
|
||||||
|
|
||||||
static property_info sProperties[] = {
|
static property_info sProperties[] = {
|
||||||
{ "Item", { B_COUNT_PROPERTIES, 0 }, { B_DIRECT_SPECIFIER, 0 },
|
{ "Item", { B_COUNT_PROPERTIES, 0 }, { B_DIRECT_SPECIFIER, 0 },
|
||||||
"Returns the number of BListItems currently in the list.", 0, { B_INT32_TYPE }
|
"Returns the number of BListItems currently in the list.", 0, { B_INT32_TYPE }
|
||||||
@@ -494,8 +496,9 @@ BListView::MouseDown(BPoint point)
|
|||||||
if (timeDelta < doubleClickSpeed
|
if (timeDelta < doubleClickSpeed
|
||||||
&& fabs(delta.x) < kDoubleClickTresh
|
&& fabs(delta.x) < kDoubleClickTresh
|
||||||
&& fabs(delta.y) < kDoubleClickTresh
|
&& fabs(delta.y) < kDoubleClickTresh
|
||||||
&& fTrack->item_index == index)
|
&& fTrack->item_index == index) {
|
||||||
doubleClick = true;
|
doubleClick = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (doubleClick && index >= fFirstSelected && index <= fLastSelected) {
|
if (doubleClick && index >= fFirstSelected && index <= fLastSelected) {
|
||||||
fTrack->drag_start.Set(INT32_MAX, INT32_MAX);
|
fTrack->drag_start.Set(INT32_MAX, INT32_MAX);
|
||||||
@@ -518,8 +521,10 @@ BListView::MouseDown(BPoint point)
|
|||||||
if (fListType == B_MULTIPLE_SELECTION_LIST) {
|
if (fListType == B_MULTIPLE_SELECTION_LIST) {
|
||||||
if (modifiers & B_SHIFT_KEY) {
|
if (modifiers & B_SHIFT_KEY) {
|
||||||
// select entire block
|
// select entire block
|
||||||
// TODO: maybe review if we want it like in Tracker (anchor item)
|
// TODO: maybe review if we want it like in Tracker
|
||||||
Select(min_c(index, fFirstSelected), max_c(index, fLastSelected));
|
// (anchor item)
|
||||||
|
Select(min_c(index, fFirstSelected), max_c(index,
|
||||||
|
fLastSelected));
|
||||||
} else {
|
} else {
|
||||||
if (modifiers & B_COMMAND_KEY) {
|
if (modifiers & B_COMMAND_KEY) {
|
||||||
// toggle selection state of clicked item (like in Tracker)
|
// toggle selection state of clicked item (like in Tracker)
|
||||||
@@ -545,7 +550,7 @@ BListView::MouseDown(BPoint point)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MouseUp
|
|
||||||
void
|
void
|
||||||
BListView::MouseUp(BPoint pt)
|
BListView::MouseUp(BPoint pt)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user