Window icon
This commit is contained in:
parent
9a14fa541b
commit
dede872fac
11 changed files with 34 additions and 11 deletions
|
@ -66,7 +66,7 @@ QRect DesktopView::screenAvailableRect()
|
|||
|
||||
void DesktopView::onGeometryChanged()
|
||||
{
|
||||
m_screenRect = qApp->primaryScreen()->geometry();
|
||||
m_screenRect = qApp->primaryScreen()->geometry().adjusted(0, 0, 1, 1);
|
||||
setGeometry(m_screenRect);
|
||||
emit screenRectChanged();
|
||||
}
|
||||
|
|
4
main.cpp
4
main.cpp
|
@ -41,10 +41,12 @@
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
app.setOrganizationName("cutefishos");
|
||||
app.setWindowIcon(QIcon::fromTheme("file-manager"));
|
||||
|
||||
// Translations
|
||||
QLocale locale;
|
||||
|
|
|
@ -135,11 +135,13 @@ QHash<int, QByteArray> FolderModel::staticRoleNames()
|
|||
roleNames[SelectedRole] = "selected";
|
||||
roleNames[IsDirRole] = "isDir";
|
||||
roleNames[UrlRole] = "url";
|
||||
roleNames[DisplayNameRole] = "displayName";
|
||||
roleNames[FileNameRole] = "fileName";
|
||||
roleNames[FileSizeRole] = "fileSize";
|
||||
roleNames[IconNameRole] = "iconName";
|
||||
roleNames[ThumbnailRole] = "thumbnail";
|
||||
roleNames[ModifiedRole] = "modified";
|
||||
roleNames[IsDesktopFileRole] = "desktopFile";
|
||||
return roleNames;
|
||||
}
|
||||
|
||||
|
@ -157,9 +159,18 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const
|
|||
return m_selectionModel->isSelected(index);
|
||||
case UrlRole:
|
||||
return item.url();
|
||||
case DisplayNameRole: {
|
||||
if (item.isDesktopFile())
|
||||
return "";
|
||||
|
||||
return item.url().fileName();
|
||||
}
|
||||
case FileNameRole: {
|
||||
return item.url().fileName();
|
||||
}
|
||||
case IsDesktopFileRole: {
|
||||
return item.isDesktopFile();
|
||||
}
|
||||
case FileSizeRole: {
|
||||
if (item.isDir()) {
|
||||
QDir dir(item.url().toLocalFile());
|
||||
|
|
|
@ -61,11 +61,13 @@ public:
|
|||
SelectedRole,
|
||||
IsDirRole,
|
||||
UrlRole,
|
||||
DisplayNameRole,
|
||||
FileNameRole,
|
||||
FileSizeRole,
|
||||
IconNameRole,
|
||||
ThumbnailRole,
|
||||
ModifiedRole
|
||||
ModifiedRole,
|
||||
IsDesktopFileRole
|
||||
};
|
||||
|
||||
enum FilterMode {
|
||||
|
|
|
@ -49,6 +49,7 @@ Item {
|
|||
height: width
|
||||
sourceSize: Qt.size(width, height)
|
||||
smooth: false
|
||||
antialiasing: true
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
|
|
@ -41,6 +41,7 @@ Item {
|
|||
Loader {
|
||||
id: backgroundLoader
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
sourceComponent: settings.backgroundType === 0 ? wallpaper : background
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ Item {
|
|||
source: "image://icontheme/" + model.iconName
|
||||
visible: !_image.visible
|
||||
smooth: false
|
||||
antialiasing: true
|
||||
|
||||
ColorOverlay {
|
||||
anchors.fill: _icon
|
||||
|
@ -123,12 +124,12 @@ Item {
|
|||
visible: status === Image.Ready
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
sourceSize: Qt.size(width, height)
|
||||
source: model.thumbnail ? model.thumbnail : ""
|
||||
asynchronous: true
|
||||
cache: false
|
||||
smooth: false
|
||||
antialiasing: true
|
||||
|
||||
// Because of the effect of OpacityMask.
|
||||
ColorOverlay {
|
||||
|
|
|
@ -127,6 +127,7 @@ Item {
|
|||
text: model.fileName
|
||||
Layout.fillWidth: true
|
||||
color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
|
||||
textFormat: Text.PlainText
|
||||
elide: Qt.ElideMiddle
|
||||
}
|
||||
|
||||
|
@ -134,12 +135,14 @@ Item {
|
|||
id: _label2
|
||||
text: model.fileSize
|
||||
color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.disabledTextColor
|
||||
textFormat: Text.PlainText
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: model.modified
|
||||
textFormat: Text.PlainText
|
||||
color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.disabledTextColor
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,11 +209,11 @@ Item {
|
|||
height: statusBarHeight
|
||||
z: 999
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: FishUI.Theme.backgroundColor
|
||||
opacity: 0.7
|
||||
}
|
||||
// Rectangle {
|
||||
// anchors.fill: parent
|
||||
// color: FishUI.Theme.backgroundColor
|
||||
// opacity: 0.7
|
||||
// }
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -105,12 +105,14 @@ ListView {
|
|||
source: "qrc:/images/" + (FishUI.Theme.darkMode || _item.checked ? "dark/" : "light/") + model.iconPath
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
smooth: false
|
||||
antialiasing: true
|
||||
}
|
||||
|
||||
Label {
|
||||
id: _label
|
||||
text: model.name
|
||||
color: checked ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ FishUI.Window {
|
|||
title: qsTr("File Manager")
|
||||
|
||||
header.height: 36 + FishUI.Units.largeSpacing
|
||||
background.opacity: 0.95
|
||||
background.opacity: 0.9
|
||||
|
||||
FishUI.WindowBlur {
|
||||
view: root
|
||||
|
|
Loading…
Reference in a new issue