summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-06-10 17:00:41 -0500
committerTimothy Pearson <[email protected]>2013-06-10 17:00:41 -0500
commite2c42b9bb60335db0820468dbdca9582035ce56c (patch)
tree7664ac1573a992abe165acf0619676feb2001bf6
parentb4eb5d6af66e7d40f335af72914ff96abe9bd890 (diff)
downloadtdelibs-e2c42b9bb60335db0820468dbdca9582035ce56c.tar.gz
tdelibs-e2c42b9bb60335db0820468dbdca9582035ce56c.zip
Allow small execute area to be used in TDEListView
This partially resolves Bug 1543
-rw-r--r--tdeui/tdelistview.cpp20
-rw-r--r--tdeui/tdelistview.h16
2 files changed, 31 insertions, 5 deletions
diff --git a/tdeui/tdelistview.cpp b/tdeui/tdelistview.cpp
index b4529722b..c60070d4a 100644
--- a/tdeui/tdelistview.cpp
+++ b/tdeui/tdelistview.cpp
@@ -70,6 +70,7 @@ public:
TDEListViewPrivate (TDEListView* listview)
: pCurrentItem (0),
autoSelectDelay(0),
+ useSmallExecuteArea(false),
dragOverItem(0),
dragDelay (TDEGlobalSettings::dndEventDelay()),
editor (new TDEListViewLineEdit (listview)),
@@ -116,6 +117,7 @@ public:
TQTimer autoSelect;
int autoSelectDelay;
+ bool useSmallExecuteArea;
TQTimer dragExpand;
TQListViewItem* dragOverItem;
@@ -505,10 +507,9 @@ bool TDEListView::isExecuteArea( int x, TQListViewItem* item )
x += contentsX(); // in case of a horizontal scrollbar
- // What was this supposed to do???
- // Just use the column width, as at least one entire column is highlighted on row selection!
-#if 0
- if ( item ) {
+ // If a small execute area was requested, trim area to the size of the item text/icon
+ // Otherwise just use the column width, as at least one entire column is highlighted on row selection!
+ if ( item && d->useSmallExecuteArea ) {
width = treeStepSize()*( item->depth() + ( rootIsDecorated() ? 1 : 0 ) );
width += itemMargin();
int ca = AlignHorizontal_Mask & columnAlignment( 0 );
@@ -519,7 +520,6 @@ bool TDEListView::isExecuteArea( int x, TQListViewItem* item )
}
}
}
-#endif
if ( item ) {
if (!allColumnsShowFocus()) {
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* )
{ /*BASE::virtual_hook( id, data );*/ }
diff --git a/tdeui/tdelistview.h b/tdeui/tdelistview.h
index bd0473304..395ffefa7 100644
--- a/tdeui/tdelistview.h
+++ b/tdeui/tdelistview.h
@@ -403,6 +403,22 @@ public:
* @since 3.4
*/
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:
/**