Drop more unused TabBox related code
Especially we do no longer need to invoke JavaScript methods from C++.icc-effect-5.14.5
parent
28dd3b1353
commit
58725981eb
|
@ -271,21 +271,6 @@ void DeclarativeView::setCurrentIndex(const QModelIndex &index)
|
|||
}
|
||||
}
|
||||
|
||||
QModelIndex DeclarativeView::indexAt(const QPoint &pos) const
|
||||
{
|
||||
if (QObject *item = rootObject()->findChild<QObject*>("listView")) {
|
||||
QVariant returnedValue;
|
||||
QVariant xPos(pos.x());
|
||||
QVariant yPos(pos.y());
|
||||
QMetaObject::invokeMethod(item, "indexAtMousePos", Q_RETURN_ARG(QVariant, returnedValue), Q_ARG(QVariant, QVariant(pos)));
|
||||
if (!returnedValue.canConvert<int>()) {
|
||||
return QModelIndex();
|
||||
}
|
||||
return m_model->index(returnedValue.toInt(), 0);
|
||||
}
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
void DeclarativeView::currentIndexChanged(int row)
|
||||
{
|
||||
tabBox->setCurrentIndex(m_model->index(row, 0));
|
||||
|
|
|
@ -57,7 +57,6 @@ public:
|
|||
virtual void showEvent(QShowEvent *event);
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
void setCurrentIndex(const QModelIndex &index);
|
||||
QModelIndex indexAt(const QPoint &pos) const;
|
||||
|
||||
protected:
|
||||
virtual void hideEvent(QHideEvent *event);
|
||||
|
|
|
@ -85,12 +85,6 @@ Item {
|
|||
}
|
||||
}
|
||||
ListView {
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return iconsListView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: iconsListView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -166,12 +166,6 @@ Item {
|
|||
// icon size or two text elements and margins and hoverItem margins
|
||||
return Math.max(16, height + hoverItem.margins.top + hoverItem.margins.bottom);
|
||||
}
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return compactListView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: compactListView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -140,12 +140,6 @@ Item {
|
|||
// icon size or two text elements and margins and hoverItem margins
|
||||
return Math.max(32, height + desktopTabBox.textMargin * 2 + hoverItem.margins.top + hoverItem.margins.bottom);
|
||||
}
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return listView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: listView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -182,12 +182,6 @@ Item {
|
|||
// icon size or two text elements and margins and hoverItem margins
|
||||
return Math.max(32, height*2 + informativeTabBox.textMargin * 3 + hoverItem.margins.top + hoverItem.margins.bottom);
|
||||
}
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return listView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: listView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -131,12 +131,6 @@ Item {
|
|||
// icon size or two text elements and margins and hoverItem margins
|
||||
return height + hoverItem.margins.top + hoverItem.margins.bottom;
|
||||
}
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return textListView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: textListView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -64,12 +64,6 @@ Item {
|
|||
}
|
||||
|
||||
ListView {
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return thumbnailListView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: thumbnailListView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -55,12 +55,6 @@ Item {
|
|||
}
|
||||
|
||||
ListView {
|
||||
/**
|
||||
* Called from C++ to get the index at a mouse pos.
|
||||
**/
|
||||
function indexAtMousePos(pos) {
|
||||
return thumbnailListView.indexAt(pos.x, pos.y);
|
||||
}
|
||||
signal currentIndexChanged(int index)
|
||||
id: thumbnailListView
|
||||
objectName: "listView"
|
||||
|
|
|
@ -342,11 +342,6 @@ int TabBoxHandler::desktop(const QModelIndex& index) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
int TabBoxHandler::currentSelectedDesktop() const
|
||||
{
|
||||
return desktop(d->index);
|
||||
}
|
||||
|
||||
void TabBoxHandler::setCurrentIndex(const QModelIndex& index)
|
||||
{
|
||||
if (d->index == index) {
|
||||
|
@ -440,18 +435,6 @@ bool TabBoxHandler::containsPos(const QPoint& pos) const
|
|||
return w->geometry().contains(pos);
|
||||
}
|
||||
|
||||
QModelIndex TabBoxHandler::indexAt(const QPoint& pos) const
|
||||
{
|
||||
if (d->m_declarativeView && d->m_declarativeView->isVisible()) {
|
||||
QPoint widgetPos = d->m_declarativeView->mapFromGlobal(pos);
|
||||
return d->m_declarativeView->indexAt(widgetPos);
|
||||
} else if (d->m_declarativeDesktopView && d->m_declarativeDesktopView->isVisible()) {
|
||||
QPoint widgetPos = d->m_declarativeDesktopView->mapFromGlobal(pos);
|
||||
return d->m_declarativeDesktopView->indexAt(widgetPos);
|
||||
}
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
QModelIndex TabBoxHandler::index(KWin::TabBox::TabBoxClient* client) const
|
||||
{
|
||||
return d->clientModel()->index(client);
|
||||
|
|
|
@ -256,11 +256,6 @@ public:
|
|||
* @see DesktopModel::desktopIndex
|
||||
*/
|
||||
int desktop(const QModelIndex& index) const;
|
||||
/**
|
||||
* @return The current selected desktop. If there is no selected desktop
|
||||
* or TabBoxMode is not TabBoxConfig::DesktopTabBox -1 will be returned.
|
||||
*/
|
||||
int currentSelectedDesktop() const;
|
||||
|
||||
/**
|
||||
* Handles additional grabbed key events by the TabBox controller.
|
||||
|
@ -278,15 +273,6 @@ public:
|
|||
*/
|
||||
bool containsPos(const QPoint& pos) const;
|
||||
/**
|
||||
* Returns the index at the given position in global coordinates
|
||||
* of the view.
|
||||
* @param pos The position in global coordinates
|
||||
* @return The model index at given position. If there is no item
|
||||
* at the position or the position is not in the view an invalid
|
||||
* model index will be returned;
|
||||
*/
|
||||
QModelIndex indexAt(const QPoint& pos) const;
|
||||
/**
|
||||
* @param client The TabBoxClient whose index should be returned
|
||||
* @return Returns the ModelIndex of given TabBoxClient or an invalid ModelIndex
|
||||
* if the model does not contain the given TabBoxClient.
|
||||
|
|
Loading…
Reference in New Issue