Compare commits

...

3 commits

Author SHA1 Message Date
catpswin56
3bc9f88ce4 Desktop Containment: improve "Refresh" menu item 2026-10-13 17:44:12 -03:00
catpswin56
9aa1d4206e Desktop Containment: fix "Sort By" submenu 2026-10-13 17:18:40 -03:00
catpswin56
6209b0e1cf Merge VTP lockscreen fix 2026-10-13 16:57:24 -03:00
7 changed files with 54 additions and 45 deletions

View file

@ -174,11 +174,9 @@ FocusScope {
main.generateDragImage(); main.generateDragImage();
} }
function onHasRefreshed(isExplicit) { function onHasRefreshed() {
if(isExplicit) { gridView.visible = false;
gridView.visible = false; refreshGridView.start();
refreshGridView.start();
}
} }
} }
Timer { Timer {
@ -1408,7 +1406,6 @@ FocusScope {
: (gridView.height / gridView.cellHeight)) : (gridView.height / gridView.cellHeight))
Component.onCompleted: { Component.onCompleted: {
positioner.updateResolution();
positioner.loadAndApplyPositionsConfig(); positioner.loadAndApplyPositionsConfig();
} }

View file

@ -393,10 +393,10 @@ FocusScope {
Plasmoid.contextualActions.push(actionSeparator); Plasmoid.contextualActions.push(actionSeparator);
} }
if (actionName === "refresh") { if (actionName === "refresh") {
Plasmoid.contextualActions.push(viewPropertiesAction) Plasmoid.contextualActions.push(viewPropertiesAction);
Plasmoid.contextualActions.push(viewSortMenu) Plasmoid.contextualActions.push(viewSortMenu);
} }
Plasmoid.contextualActions.push(modelAction) Plasmoid.contextualActions.push(modelAction);
if (actionName === "refresh") { if (actionName === "refresh") {
Plasmoid.contextualActions.push(actionSeparatorSecond); Plasmoid.contextualActions.push(actionSeparatorSecond);
} }

View file

@ -545,8 +545,7 @@ void FolderModel::setUsedByContainment(bool used)
QAction *action = m_actionCollection.action(QStringLiteral("refresh")); QAction *action = m_actionCollection.action(QStringLiteral("refresh"));
if (action) { if (action) {
action->setText(m_usedByContainment ? i18n("&Refresh Desktop") : i18n("&Refresh View")); action->setText(i18n("&Refresh"));
action->setIcon(m_usedByContainment ? QIcon::fromTheme(QStringLiteral("user-desktop")) : QIcon::fromTheme(QStringLiteral("view-refresh")));
} }
m_screenMapper->disconnect(this); m_screenMapper->disconnect(this);
@ -1837,7 +1836,7 @@ void FolderModel::createActions()
QAction *paste = KStandardAction::paste(this, &FolderModel::paste, this); QAction *paste = KStandardAction::paste(this, &FolderModel::paste, this);
QAction *pasteTo = KStandardAction::paste(this, &FolderModel::pasteTo, this); QAction *pasteTo = KStandardAction::paste(this, &FolderModel::pasteTo, this);
QAction *refresh = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("&Refresh View"), this); QAction *refresh = new QAction(QIcon(), i18n("&Refresh"), this);
refresh->setShortcut(QKeySequence(QKeySequence::Refresh)); refresh->setShortcut(QKeySequence(QKeySequence::Refresh));
connect(refresh, &QAction::triggered, this, &FolderModel::refresh); connect(refresh, &QAction::triggered, this, &FolderModel::refresh);
@ -2273,6 +2272,7 @@ void FolderModel::refresh()
Q_EMIT errorStringChanged(); Q_EMIT errorStringChanged();
m_dirModel->dirLister()->updateDirectory(m_dirModel->dirLister()->url()); m_dirModel->dirLister()->updateDirectory(m_dirModel->dirLister()->url());
Q_EMIT hasRefreshed();
} }
Plasma::Applet *FolderModel::applet() const Plasma::Applet *FolderModel::applet() const

View file

@ -324,6 +324,7 @@ Q_SIGNALS:
void selectionDone(); void selectionDone();
void creatingNewItemsChanged() const; void creatingNewItemsChanged() const;
void selectionCountChanged() const; void selectionCountChanged() const;
void hasRefreshed();
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;

View file

@ -18,33 +18,33 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
{ {
m_menu = new QMenu(); m_menu = new QMenu();
QMenu *menu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("view-sort")), i18n("Sort By")); m_sortMenu = new QMenu(i18n("Sort By"));
m_sortMode = new QActionGroup(this); m_sortMode = new QActionGroup(this);
connect(m_sortMode, &QActionGroup::triggered, this, &ViewPropertiesMenu::sortModeChanged); connect(m_sortMode, &QActionGroup::triggered, this, &ViewPropertiesMenu::sortModeChanged);
QAction *action = menu->addAction(i18nc("@item:inmenu Sort icons manually", "Unsorted")); QAction *action = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons manually", "Unsorted"));
action->setCheckable(true); action->setCheckable(true);
action->setData(-1); action->setData(-1);
m_sortMode->addAction(action); m_sortMode->addAction(action);
action = menu->addAction(i18nc("@item:inmenu Sort icons by name", "Name")); action = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons by name", "Name"));
action->setCheckable(true); action->setCheckable(true);
action->setData(int(KDirModel::Name)); action->setData(int(KDirModel::Name));
m_sortMode->addAction(action); m_sortMode->addAction(action);
action = menu->addAction(i18nc("@item:inmenu Sort icons by size", "Size")); action = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons by size", "Size"));
action->setCheckable(true); action->setCheckable(true);
action->setData(int(KDirModel::Size)); action->setData(int(KDirModel::Size));
m_sortMode->addAction(action); m_sortMode->addAction(action);
action = menu->addAction(i18nc("@item:inmenu Sort icons by file type", "Type")); action = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons by file type", "Type"));
action->setCheckable(true); action->setCheckable(true);
action->setData(int(KDirModel::Type)); action->setData(int(KDirModel::Type));
m_sortMode->addAction(action); m_sortMode->addAction(action);
action = menu->addAction(i18nc("@item:inmenu Sort icons by date", "Date")); action = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons by date", "Date"));
action->setCheckable(true); action->setCheckable(true);
action->setData(int(KDirModel::ModifiedTime)); action->setData(int(KDirModel::ModifiedTime));
m_sortMode->addAction(action); m_sortMode->addAction(action);
menu->addSeparator(); m_sortMenu->addSeparator();
m_sortDesc = menu->addAction(i18nc("@item:inmenu Sort icons in descending order", "Descending"), this, &ViewPropertiesMenu::sortDescChanged); m_sortDesc = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons in descending order", "Descending"), this, &ViewPropertiesMenu::sortDescChanged);
m_sortDesc->setCheckable(true); m_sortDesc->setCheckable(true);
m_sortDirsFirst = menu->addAction(i18nc("@item:inmenu Sort icons with folders first", "Folders First"), this, &ViewPropertiesMenu::sortDirsFirstChanged); m_sortDirsFirst = m_sortMenu->addAction(i18nc("@item:inmenu Sort icons with folders first", "Folders First"), this, &ViewPropertiesMenu::sortDirsFirstChanged);
m_sortDirsFirst->setCheckable(true); m_sortDirsFirst->setCheckable(true);
m_iconSizeMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("transform-scale")), i18n("Icon Size")); m_iconSizeMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("transform-scale")), i18n("Icon Size"));
@ -67,26 +67,25 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
m_arrangementMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("object-rows")), i18nc("@item:inmenu arrangement of icons", "Arrange")); m_arrangementMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("object-rows")), i18nc("@item:inmenu arrangement of icons", "Arrange"));
m_arrangement = new QActionGroup(this); m_arrangement = new QActionGroup(this);
connect(m_arrangement, &QActionGroup::triggered, this, &ViewPropertiesMenu::arrangementChanged); connect(m_arrangement, &QActionGroup::triggered, this, &ViewPropertiesMenu::arrangementChanged);
action = m_arrangementMenu->addAction(i18nc("@item:inmenu arrangement of icons", "In Rows")); const auto isLtR = qApp->layoutDirection() == Qt::LeftToRight;
action = m_arrangementMenu->addAction(isLtR ? i18nc("@item:inmenu arrangement of icons", "Left to Right")
: i18nc("@item:inmenu arrangement of icons", "Right to Left"));
action->setCheckable(true); action->setCheckable(true);
action->setData(0); action->setData(0);
m_arrangement->addAction(action); m_arrangement->addAction(action);
action = m_arrangementMenu->addAction(i18nc("@item:inmenu arrangement of icons", "In Columns")); action = m_arrangementMenu->addAction(i18nc("@item:inmenu arrangement of icons", "Top to Bottom"));
action->setData(1); action->setData(1);
action->setCheckable(true); action->setCheckable(true);
m_arrangement->addAction(action); m_arrangement->addAction(action);
m_alignmentMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("align-horizontal-left")), i18n("Sort Alignment")); m_alignmentMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("align-horizontal-left")), i18n("Align"));
m_alignment = new QActionGroup(this); m_alignment = new QActionGroup(this);
connect(m_alignment, &QActionGroup::triggered, this, &ViewPropertiesMenu::alignmentChanged); connect(m_alignment, &QActionGroup::triggered, this, &ViewPropertiesMenu::alignmentChanged);
const auto isLtR = qApp->layoutDirection() == Qt::LeftToRight; action = m_alignmentMenu->addAction(i18nc("@item:inmenu alignment of icons", "Left"));
auto LtRText = i18nc("@item:inmenu alignment of icons", "Left-to-Right");
auto RtLText = i18nc("@item:inmenu alignment of icons", "Right-to-Left");
action = m_alignmentMenu->addAction(isLtR ? LtRText : RtLText);
action->setCheckable(true); action->setCheckable(true);
action->setData(0); action->setData(0);
m_alignment->addAction(action); m_alignment->addAction(action);
action = m_alignmentMenu->addAction(isLtR ? RtLText : LtRText); action = m_alignmentMenu->addAction(i18nc("@item:inmenu alignment of icons", "Right"));
action->setCheckable(true); action->setCheckable(true);
action->setData(1); action->setData(1);
m_alignment->addAction(action); m_alignment->addAction(action);
@ -104,12 +103,17 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
ViewPropertiesMenu::~ViewPropertiesMenu() ViewPropertiesMenu::~ViewPropertiesMenu()
{ {
delete m_menu; delete m_menu;
delete m_sortMenu;
} }
QMenu *ViewPropertiesMenu::menu() const QObject *ViewPropertiesMenu::menu() const
{ {
return m_menu; return m_menu;
} }
QObject *ViewPropertiesMenu::sortMenu() const
{
return m_sortMenu;
}
bool ViewPropertiesMenu::showLayoutActions() const bool ViewPropertiesMenu::showLayoutActions() const
{ {

View file

@ -18,7 +18,8 @@ class ViewPropertiesMenu : public QObject
Q_OBJECT Q_OBJECT
QML_ELEMENT QML_ELEMENT
Q_PROPERTY(QMenu *menu READ menu CONSTANT) Q_PROPERTY(QObject *menu READ menu CONSTANT)
Q_PROPERTY(QObject *sortMenu READ sortMenu CONSTANT)
Q_PROPERTY(bool showLayoutActions READ showLayoutActions WRITE setShowLayoutActions NOTIFY showLayoutActionsChanged) Q_PROPERTY(bool showLayoutActions READ showLayoutActions WRITE setShowLayoutActions NOTIFY showLayoutActionsChanged)
Q_PROPERTY(bool showLockAction READ showLockAction WRITE setShowLockAction NOTIFY showLockActionChanged) Q_PROPERTY(bool showLockAction READ showLockAction WRITE setShowLockAction NOTIFY showLockActionChanged)
@ -38,7 +39,8 @@ public:
explicit ViewPropertiesMenu(QObject *parent = nullptr); explicit ViewPropertiesMenu(QObject *parent = nullptr);
~ViewPropertiesMenu() override; ~ViewPropertiesMenu() override;
QMenu *menu() const; QObject *menu() const;
QObject *sortMenu() const;
bool showLayoutActions() const; bool showLayoutActions() const;
void setShowLayoutActions(bool show); void setShowLayoutActions(bool show);
@ -91,6 +93,7 @@ Q_SIGNALS:
void iconSizeChanged(); void iconSizeChanged();
private: private:
QMenu *m_sortMenu;
QMenu *m_menu; QMenu *m_menu;
QMenu *m_arrangementMenu; QMenu *m_arrangementMenu;
QActionGroup *m_arrangement; QActionGroup *m_arrangement;

View file

@ -42,8 +42,8 @@ Item {
function beginAuth() { function beginAuth() {
if(!authenticator.graceLocked && password.enabled) { if(!authenticator.graceLocked && password.enabled) {
authenticator.startAuthenticating();
pageView.replaceCurrentItem(welcomePage); pageView.replaceCurrentItem(welcomePage);
authenticator.respond(password.text);
} }
} }
@ -107,25 +107,22 @@ Item {
// If this is coming from the noninteractive authenticators // If this is coming from the noninteractive authenticators
if(kind != 0) return; if(kind != 0) return;
showMessage(i18nd("kscreenlocker_greet", "The user name or password is incorrect."), "dialog-error"); showMessage(i18nd("kscreenlocker_greet", "The user name or password is incorrect."), "dialog-error");
} authenticator.startAuthenticating();
function onBusyChanged() {
/*if(!authenticator.busy && !statusPage.visible) {
root.notification = "";
root.notificationIcon = "";
}*/
} }
function onInfoMessageChanged() { function onInfoMessageChanged() {
if (authenticator.infoMessage == "") {
return;
}
showMessage(authenticator.infoMessage, "dialog-information"); showMessage(authenticator.infoMessage, "dialog-information");
} }
function onErrorMessageChanged() { function onErrorMessageChanged() {
if (authenticator.errorMessage == "") {
return;
}
showMessage(authenticator.errorMessage, "dialog-error"); showMessage(authenticator.errorMessage, "dialog-error");
} }
function onPromptForSecretChanged() {
if(authenticator.promptForSecret && !authenticator.busy) {
authenticator.respond(password.text);
}
}
function onSucceeded() { function onSucceeded() {
keepActiveTimer.stop();
lockSuccess.play(); lockSuccess.play();
fadeExitDelay.start(); fadeExitDelay.start();
} }
@ -181,6 +178,14 @@ Item {
Component.onCompleted: { Component.onCompleted: {
executable.exec("kreadconfig6 --file ~/.config/kdeglobals --group Sounds --key Theme"); executable.exec("kreadconfig6 --file ~/.config/kdeglobals --group Sounds --key Theme");
root.resetFocus(); root.resetFocus();
keepActiveTimer.running = true;
}
Timer {
id: keepActiveTimer
repeat: true
interval: 1000
onTriggered: authenticator.startAuthenticating();
} }
Timer { Timer {
@ -352,7 +357,6 @@ Item {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
enabled: !authenticator.busy
onClicked: root.beginAuth(); onClicked: root.beginAuth();
} }
} }