Compare commits

...

2 Commits

Author SHA1 Message Date
Jacopo De Simoi 3c4e1ea62f Leaner appearance 7 years ago
Jacopo De Simoi 9e16df7503 Add shortcut to hide panel 7 years ago
  1. 44
      lookandfeel/contents/runcommand/RunCommand.qml
  2. 8
      shell/panelview.cpp
  3. 2
      shell/panelview.h
  4. 28
      shell/shellcorona.cpp
  5. 5
      shell/shellcorona.h

@ -54,13 +54,13 @@ ColumnLayout {
Layout.alignment: Qt.AlignTop
PlasmaComponents.ToolButton {
iconSource: "configure"
visible: false
onClicked: {
runnerWindow.visible = false
runnerWindow.displayConfiguration()
}
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Configure")
Accessible.description: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Configure Search Plugins")
visible: runnerWindow.canConfigure
tooltip: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Configure...")
}
PlasmaComponents.TextField {
@ -117,16 +117,28 @@ ColumnLayout {
}
}
Keys.onPressed: {
allowCompletion = (event.key !== Qt.Key_Backspace && event.key !== Qt.Key_Delete)
if ((length === 0) && ((event.key == Qt.Key_P) || (event.key == Qt.Key_N)) && (event.modifiers & Qt.ControlModifier)) {
root.showHistory = true;
}
allowCompletion = (event.key !== Qt.Key_Backspace && event.key !== Qt.Key_Delete);
if (event.modifiers & Qt.ControlModifier) {
if (event.key == Qt.Key_J) {
move_down()
event.accepted = true;
} else if (event.key == Qt.Key_K) {
move_up()
event.accepted = true;
}
}
Keys.onUpPressed: {
if (length === 0) {
root.showHistory = true;
listView.forceActiveFocus();
} else if (results.count > 0) {
results.forceActiveFocus();
results.decrementCurrentIndex();
}
}
Keys.onDownPressed: {
if (length === 0) {
root.showHistory = true;
listView.forceActiveFocus();
} else if (results.count > 0) {
results.forceActiveFocus();
results.incrementCurrentIndex();
}
}
Keys.onUpPressed: move_up()
@ -169,6 +181,7 @@ ColumnLayout {
}
PlasmaComponents.ToolButton {
iconSource: "window-close"
visible: false
onClicked: runnerWindow.visible = false
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Close")
Accessible.description: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Close Search")
@ -271,8 +284,15 @@ ColumnLayout {
queryField.text += event.text;
queryField.focus = true;
}
}
if ((event.key == Qt.Key_P) && (event.modifiers & Qt.ControlModifier)) {
decrementCurrentIndex();
event.accepted=true;
}
else if ((event.key == Qt.Key_N) && (event.modifiers & Qt.ControlModifier)) {
incrementCurrentIndex();
event.accepted=true;
}
}
Keys.onUpPressed: decrementCurrentIndex()
Keys.onDownPressed: incrementCurrentIndex()

@ -303,9 +303,9 @@ void PanelView::setBackgroundHints(Plasma::Types::BackgroundHints hint)
if (m_backgroundHints == hint) {
return;
}
m_backgroundHints = hint;
emit backgroundHintsChanged();
}
@ -1109,13 +1109,13 @@ void PanelView::themeChanged()
{
if (m_backgroundHints == Plasma::Types::NoBackground) {
KWindowEffects::enableBlurBehind(winId(), false);
KWindowEffects::enableBackgroundContrast(winId(), false);
KWindowEffects::enableBackgroundContrast(winId(), false);
} else {
KWindowEffects::enableBlurBehind(winId(), true);
KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(),
m_theme.backgroundContrast(),
m_theme.backgroundIntensity(),
m_theme.backgroundSaturation());
m_theme.backgroundSaturation());
}
updateMask();

@ -81,7 +81,7 @@ class PanelView : public PlasmaQuick::ContainmentView
* support NoBackground in order to disable blur/contrast effects and remove
* the panel shadows
* @since 5.9
*/
*/
Q_PROPERTY(Plasma::Types::BackgroundHints backgroundHints WRITE setBackgroundHints READ backgroundHints NOTIFY backgroundHintsChanged)
/**

@ -162,6 +162,8 @@ ShellCorona::ShellCorona(QObject *parent)
connect(this, &ShellCorona::containmentAdded,
this, &ShellCorona::handleContainmentAdded);
QAction *dashboardAction = actions()->addAction(QStringLiteral("show dashboard"));
QObject::connect(dashboardAction, &QAction::triggered,
this, &ShellCorona::setDashboardShown);
@ -177,6 +179,21 @@ ShellCorona::ShellCorona(QObject *parent)
dashboardAction->setData(Plasma::Types::ControlAction);
KGlobalAccel::self()->setGlobalShortcut(dashboardAction, Qt::CTRL + Qt::Key_F12);
QAction *panelAction = actions()->addAction(QStringLiteral("show panel"));
QObject::connect(panelAction, &QAction::triggered,
this, &ShellCorona::togglePanelVisibility);
panelAction->setText(i18n("Toggle Panel"));
// connect(KWindowSystem::self(), &KWindowSystem::showingDesktopChanged, [panelAction](bool showing) {
// panelAction->setText(showing ? i18n("Hide Desktop") : i18n("Show Desktop"));
// panelAction->setChecked(showing);
// });
// panelAction->setAutoRepeat(true);
// panelAction->setCheckable(true);
// panelAction->setIcon(QIcon::fromTheme(QStringLiteral("panel-show")));
// panelAction->setData(Plasma::Types::ControlAction);
KGlobalAccel::self()->setGlobalShortcut(panelAction, Qt::CTRL + Qt::Key_F11);
checkAddPanelAction();
connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(checkAddPanelAction(QStringList)));
@ -1102,6 +1119,16 @@ QList<PanelView *> ShellCorona::panelsForScreen(QScreen *screen) const
return ret;
}
void ShellCorona::togglePanelVisibility()
{
for (auto it = m_panelViews.constBegin(), end = m_panelViews.constEnd(); it != end; ++it) {
if (it.value()->screen() != qGuiApp->primaryScreen()) {
continue;
}
it.value()->setVisible(!it.value()->isVisible());
}
}
DesktopView* ShellCorona::desktopForScreen(QScreen* screen) const
{
return m_desktopViewforId.value(m_screenPool->id(screen->name()));
@ -2119,4 +2146,3 @@ void ShellCorona::activateTaskManagerEntry(int index)
#include "moc_shellcorona.cpp"

@ -142,7 +142,7 @@ public Q_SLOTS:
void showInteractiveKWinConsole();
void loadKWinScriptInInteractiveConsole(const QString &script);
void toggleActivityManager();
void toggleWidgetExplorer();
void toggleWidgetExplorer();
void evaluateScript(const QString &string);
void activateLauncherMenu();
@ -187,6 +187,7 @@ protected Q_SLOTS:
void showAlternativesForApplet(Plasma::Applet *applet);
void togglePanelVisibility();
private Q_SLOTS:
void createWaitingPanels();
void handleContainmentAdded(Plasma::Containment *c);
@ -253,5 +254,3 @@ private:
};
#endif // SHELLCORONA_H

Loading…
Cancel
Save