Allow small execute area to be used in TDEListView

This partially resolves Bug 1543
pull/16/head
Timothy Pearson 12 years ago
parent b4eb5d6af6
commit e2c42b9bb6

@ -70,6 +70,7 @@ public:
TDEListViewPrivate (TDEListView* listview) TDEListViewPrivate (TDEListView* listview)
: pCurrentItem (0), : pCurrentItem (0),
autoSelectDelay(0), autoSelectDelay(0),
useSmallExecuteArea(false),
dragOverItem(0), dragOverItem(0),
dragDelay (TDEGlobalSettings::dndEventDelay()), dragDelay (TDEGlobalSettings::dndEventDelay()),
editor (new TDEListViewLineEdit (listview)), editor (new TDEListViewLineEdit (listview)),
@ -116,6 +117,7 @@ public:
TQTimer autoSelect; TQTimer autoSelect;
int autoSelectDelay; int autoSelectDelay;
bool useSmallExecuteArea;
TQTimer dragExpand; TQTimer dragExpand;
TQListViewItem* dragOverItem; TQListViewItem* dragOverItem;
@ -505,10 +507,9 @@ bool TDEListView::isExecuteArea( int x, TQListViewItem* item )
x += contentsX(); // in case of a horizontal scrollbar x += contentsX(); // in case of a horizontal scrollbar
// What was this supposed to do??? // If a small execute area was requested, trim area to the size of the item text/icon
// Just use the column width, as at least one entire column is highlighted on row selection! // Otherwise just use the column width, as at least one entire column is highlighted on row selection!
#if 0 if ( item && d->useSmallExecuteArea ) {
if ( item ) {
width = treeStepSize()*( item->depth() + ( rootIsDecorated() ? 1 : 0 ) ); width = treeStepSize()*( item->depth() + ( rootIsDecorated() ? 1 : 0 ) );
width += itemMargin(); width += itemMargin();
int ca = AlignHorizontal_Mask & columnAlignment( 0 ); int ca = AlignHorizontal_Mask & columnAlignment( 0 );
@ -519,7 +520,6 @@ bool TDEListView::isExecuteArea( int x, TQListViewItem* item )
} }
} }
} }
#endif
if ( item ) { if ( item ) {
if (!allColumnsShowFocus()) { if (!allColumnsShowFocus()) {
offset += treeStepSize()*( item->depth() + ( rootIsDecorated() ? 1 : 0 ) ); offset += treeStepSize()*( item->depth() + ( rootIsDecorated() ? 1 : 0 ) );
@ -2414,6 +2414,16 @@ void TDEListView::selectAll( bool select )
} }
} }
void TDEListView::setUseSmallExecuteArea(bool enable)
{
d->useSmallExecuteArea = enable;
}
bool TDEListView::useSmallExecuteArea() const
{
return d->useSmallExecuteArea;
}
void TDEListView::virtual_hook( int, void* ) void TDEListView::virtual_hook( int, void* )
{ /*BASE::virtual_hook( id, data );*/ } { /*BASE::virtual_hook( id, data );*/ }

@ -403,6 +403,22 @@ public:
* @since 3.4 * @since 3.4
*/ */
bool shadeSortColumn(void) const; bool shadeSortColumn(void) const;
/**
* @param enable TRUE if small execute area should be used (e.g. KonqListViewItem), FALSE if not.
* The default is FALSE to match TQt3 behaviour.
*
* @since 14.0
*/
void setUseSmallExecuteArea(bool enable);
/**
* @return TRUE if small execute area is in use, FALSE if not.
*
* @since 14.0
*/
bool useSmallExecuteArea() const;
signals: signals:
/** /**

Loading…
Cancel
Save