From b8d2a0ef49736db262ddb316f344d32b32f3756b Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 14 Sep 2021 20:25:01 +0800 Subject: [PATCH] Improve name selection area UI --- mimetype/mimeappmanager.cpp | 7 +++++-- qml/FolderGridItem.qml | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mimetype/mimeappmanager.cpp b/mimetype/mimeappmanager.cpp index 0a46e7d..bf4a818 100644 --- a/mimetype/mimeappmanager.cpp +++ b/mimetype/mimeappmanager.cpp @@ -19,6 +19,7 @@ #include "mimeappmanager.h" +#include #include #include #include @@ -71,7 +72,9 @@ QStringList MimeAppManager::desktopPaths() QString MimeAppManager::mimeAppsListFilePath() { - return QString("%1/.config/mimeapps.list").arg(QDir::homePath()); + // return QString("%1/.config/mimeapps.list").arg(QDir::homePath()); + + return QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1String("/mimeapps.list"); } void MimeAppManager::initApplications() @@ -328,7 +331,7 @@ bool MimeAppManager::setDefaultAppForFile(const QString &filePath, const QString if (!settings.isWritable()) return false; - settings.beginGroup("Default Applications"); // Added Associations + settings.beginGroup(QStringLiteral("Default Applications")); // Added Associations settings.setValue(mimeType.name(), value); settings.sync(); diff --git a/qml/FolderGridItem.qml b/qml/FolderGridItem.qml index aa0e8b2..5337c37 100644 --- a/qml/FolderGridItem.qml +++ b/qml/FolderGridItem.qml @@ -206,10 +206,10 @@ Item { Rectangle { z: 1 - x: _label.x + x: _label.x + (_label.width - _label.paintedWidth) / 2 - (FishUI.Units.smallSpacing / 2) y: _label.y - width: _label.width - height: _label.height + width: _label.paintedWidth + FishUI.Units.smallSpacing + height: _label.paintedHeight radius: 4 color: FishUI.Theme.highlightColor opacity: control.selected ? 1.0 : 0