summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/editormanager/openeditorsview.h
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-03-26 18:22:26 +0100
committermae <qt-info@nokia.com>2009-03-26 18:22:26 +0100
commit2ef4a169fb97a94e7e62981a0b87b8963e672876 (patch)
tree7e892d06c5a0debd4ce2e0853feeeec8203afbee /src/plugins/coreplugin/editormanager/openeditorsview.h
parentbd3bf8a348957200e10460ca85fdfa6ce0d83604 (diff)
downloadqt-creator-2ef4a169fb97a94e7e62981a0b87b8963e672876.tar.gz
small tweaks to the open editors view, and an attempt to implement a down state for the close button.
Why isn't pressedIndex in QAbstractItemView accessible, or at least a state flag in the delegate to indicate that this item is pressed down?
Diffstat (limited to 'src/plugins/coreplugin/editormanager/openeditorsview.h')
-rw-r--r--src/plugins/coreplugin/editormanager/openeditorsview.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.h b/src/plugins/coreplugin/editormanager/openeditorsview.h
index 45cfc62a01..b6dc10366a 100644
--- a/src/plugins/coreplugin/editormanager/openeditorsview.h
+++ b/src/plugins/coreplugin/editormanager/openeditorsview.h
@@ -45,6 +45,20 @@
namespace Core {
namespace Internal {
+class OpenEditorsDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+
+public:
+ OpenEditorsDelegate(QObject *parent = 0);
+
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const;
+
+ mutable QModelIndex pressedIndex;
+};
+
+
class OpenEditorsWidget : public QWidget
{
Q_OBJECT
@@ -54,12 +68,14 @@ public:
~OpenEditorsWidget();
private slots:
- void selectEditor(const QModelIndex &);
+ void handleClicked(const QModelIndex &);
+ void handlePressed(const QModelIndex &);
void updateCurrentItem(Core::IEditor*);
private:
Ui::OpenEditorsView m_ui;
QWidget *m_widget;
+ OpenEditorsDelegate *m_delegate;
};
class OpenEditorsViewFactory : public Core::INavigationWidgetFactory
@@ -75,16 +91,5 @@ public:
} // namespace Internal
} // namespace Core
-class OpenEditorsDelegate : public QStyledItemDelegate
-{
- Q_OBJECT
-
-public:
- OpenEditorsDelegate(QObject *parent = 0);
-
- void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const;
-};
-
#endif // OPENEDITORSVIEW_H