Improve name selection area UI

This commit is contained in:
reionwong 2021-09-14 20:25:01 +08:00
parent ff1c006041
commit b8d2a0ef49
2 changed files with 8 additions and 5 deletions

View file

@ -19,6 +19,7 @@
#include "mimeappmanager.h" #include "mimeappmanager.h"
#include <QStandardPaths>
#include <QDirIterator> #include <QDirIterator>
#include <QUrl> #include <QUrl>
#include <QDir> #include <QDir>
@ -71,7 +72,9 @@ QStringList MimeAppManager::desktopPaths()
QString MimeAppManager::mimeAppsListFilePath() 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() void MimeAppManager::initApplications()
@ -328,7 +331,7 @@ bool MimeAppManager::setDefaultAppForFile(const QString &filePath, const QString
if (!settings.isWritable()) if (!settings.isWritable())
return false; return false;
settings.beginGroup("Default Applications"); // Added Associations settings.beginGroup(QStringLiteral("Default Applications")); // Added Associations
settings.setValue(mimeType.name(), value); settings.setValue(mimeType.name(), value);
settings.sync(); settings.sync();

View file

@ -206,10 +206,10 @@ Item {
Rectangle { Rectangle {
z: 1 z: 1
x: _label.x x: _label.x + (_label.width - _label.paintedWidth) / 2 - (FishUI.Units.smallSpacing / 2)
y: _label.y y: _label.y
width: _label.width width: _label.paintedWidth + FishUI.Units.smallSpacing
height: _label.height height: _label.paintedHeight
radius: 4 radius: 4
color: FishUI.Theme.highlightColor color: FishUI.Theme.highlightColor
opacity: control.selected ? 1.0 : 0 opacity: control.selected ? 1.0 : 0