Commit 1948f21b authored by Albert Astals Cid's avatar Albert Astals Cid

Merge remote-tracking branch 'origin/Plasma/5.12'

parents a0ca2d1b 2b098f69
......@@ -319,6 +319,28 @@ Kicker.DashboardWindow {
flat: false
onClicked: searchField.clear();
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
event.accepted = true;
if (runnerModel.count) {
mainColumn.tryActivate(0, 0);
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
event.accepted = true;
if (tabBar.visible) {
tabBar.focus = true;
} else if (globalFavoritesGrid.enabled) {
globalFavoritesGrid.tryActivate(0, 0);
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
}
}
}
Row {
......@@ -339,8 +361,6 @@ Kicker.DashboardWindow {
Item {
id: favoritesColumn
anchors {
top: parent.top
bottom: parent.bottom
......@@ -438,6 +458,23 @@ Kicker.DashboardWindow {
systemFavoritesGrid.tryActivate(0, currentCol());
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
event.accepted = true;
if (tabBar.visible) {
tabBar.focus = true;
} else if (searching) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
event.accepted = true;
systemFavoritesGrid.tryActivate(0, 0);
}
}
Binding {
target: globalFavorites
property: "iconSize"
......@@ -477,6 +514,32 @@ Kicker.DashboardWindow {
onKeyNavUp: {
globalFavoritesGrid.tryActivate(globalFavoritesGrid.rows - 1, currentCol());
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
event.accepted = true;
if (globalFavoritesGrid.enabled) {
globalFavoritesGrid.tryActivate(0, 0);
} else if (tabBar.visible) {
tabBar.focus = true;
} else if (searching && !runnerModel.count) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
event.accepted = true;
if (filterList.enabled) {
filterList.forceActiveFocus();
} else if (searching && !runnerModel.count) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
}
}
}
}
}
......@@ -693,6 +756,30 @@ Kicker.DashboardWindow {
target.tryActivate(targetRow, favoritesColumn.columns - 1);
}
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
event.accepted = true;
if (filterList.enabled) {
filterList.forceActiveFocus();
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
event.accepted = true;
if (searching) {
cancelSearchButton.focus = true;
} else if (tabBar.visible) {
tabBar.focus = true;
} else if (globalFavoritesGrid.enabled) {
globalFavoritesGrid.tryActivate(0, 0);
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
}
}
}
Item {
......@@ -953,6 +1040,12 @@ Kicker.DashboardWindow {
var currentRow = Math.max(0, Math.ceil(currentItem.y / mainGrid.cellHeight) - 1);
mainColumn.tryActivate(currentRow, mainColumn.columns - 1);
} else if (event.key == Qt.Key_Tab) {
event.accepted = true;
systemFavoritesGrid.tryActivate(0, 0);
} else if (event.key == Qt.Key_Backtab) {
event.accepted = true;
mainColumn.tryActivate(0, 0);
}
}
}
......
......@@ -66,5 +66,25 @@ Row {
activeTab = 1;
}
}
Keys.onPressed: {
if (event.key == Qt.Key_Tab) {
event.accepted = true;
if (searching) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
}
} else if (event.key == Qt.Key_Backtab) {
event.accepted = true;
if (globalFavoritesGrid.enabled) {
globalFavoritesGrid.tryActivate(0, 0);
} else {
systemFavoritesGrid.tryActivate(0, 0);
}
}
}
}
......@@ -359,12 +359,38 @@ FocusScope {
hoverEnabled: true
function updatePositionProperties(x, y) {
// Prevent hover event synthesis in QQuickWindow interfering
// with keyboard navigation by ignoring repeated events with
// identical coordinates. As the work done here would be re-
// dundant in any case, these are safe to ignore.
if (lastX == x && lastY == y) {
return;
}
lastX = x;
lastY = y;
var cPos = mapToItem(gridView.contentItem, x, y);
var item = gridView.itemAt(cPos.x, cPos.y);
if (!item) {
gridView.currentIndex = -1;
pressedItem = null;
} else {
gridView.currentIndex = item.itemIndex;
itemGrid.focus = (currentIndex != -1)
}
}
onPressed: {
mouse.accepted = true;
updatePositionProperties(mouse.x, mouse.y);
pressX = mouse.x;
pressY = mouse.y;
mouse.accepted = true;
if (mouse.button == Qt.RightButton) {
if (gridView.currentItem) {
if (gridView.currentItem.hasActionList) {
......@@ -400,27 +426,9 @@ FocusScope {
}
onPositionChanged: {
// Prevent hover event synthesis in QQuickWindow interfering
// with keyboard navigation by ignoring repeated events with
// identical coordinates. As the work done here would be re-
// dundant in any case, these are safe to ignore.
if (mouse.x == lastX && mouse.y == lastY) {
return;
}
lastX = mouse.x;
lastY = mouse.y;
var cPos = mapToItem(gridView.contentItem, mouse.x, mouse.y);
var item = gridView.itemAt(cPos.x, cPos.y);
if (!item) {
gridView.currentIndex = -1;
pressedItem = null;
} else {
gridView.currentIndex = item.itemIndex;
itemGrid.focus = (currentIndex != -1)
updatePositionProperties(mouse.x, mouse.y);
if (gridView.currentIndex != -1) {
if (dragEnabled && pressX != -1 && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) {
if ("pluginName" in item.m) {
dragHelper.startDrag(kicker, item.url, item.icon,
......
......@@ -179,7 +179,9 @@ void DashboardWindow::keyPressEvent(QKeyEvent *e)
&& !(e->key() == Qt::Key_PageDown)
&& !(e->key() == Qt::Key_Enter)
&& !(e->key() == Qt::Key_Return)
&& !(e->key() == Qt::Key_Menu)) {
&& !(e->key() == Qt::Key_Menu)
&& !(e->key() == Qt::Key_Tab)
&& !(e->key() == Qt::Key_Backtab)) {
QPointer<QQuickItem> previousFocusItem = activeFocusItem();
......
......@@ -270,6 +270,7 @@ Item {
windowPin = windowPinComponent.createObject(label);
} else if (windowPin) {
windowPin.destroy();
windowPin = null;
}
}
......
......@@ -71,6 +71,8 @@ set(lookandfeeltool_SRCS
qt5_add_dbus_interface(lookandfeeltool_SRCS ${klauncher_xml} klauncher_iface)
add_executable(lookandfeeltool ${lookandfeeltool_SRCS})
# TODO: load kcm plugin instead of using code copy
target_compile_definitions(lookandfeeltool PRIVATE -DDEFINE_NO_PLUGIN)
target_link_libraries(lookandfeeltool
KF5::KIOWidgets
......
......@@ -57,7 +57,9 @@
# include <X11/extensions/Xfixes.h>
#endif
#ifndef DEFINE_NO_PLUGIN
K_PLUGIN_FACTORY_WITH_JSON(KCMLookandFeelFactory, "kcm_lookandfeel.json", registerPlugin<KCMLookandFeel>();)
#endif
KCMLookandFeel::KCMLookandFeel(QObject* parent, const QVariantList& args)
: KQuickAddons::ConfigModule(parent, args)
......
......@@ -164,6 +164,13 @@ void XlibBackend::setTouchpadEnabled(bool enable)
}
m_device->setEnabled(enable);
// FIXME? This should not be needed, m_notifications should trigger
// a propertyChanged signal when we enable/disable the touchpad,
// that will emit touchpadStateChanged, but for some reason
// XlibNotifications is not getting the property change events
// so we just emit touchpadStateChanged from here as a workaround
Q_EMIT touchpadStateChanged();
}
void XlibBackend::setTouchpadOff(TouchpadBackend::TouchpadOffState state)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment