Filesystem Explorer: Add a minimum width and height

This prevents to reduce the window to a minimum of 1px (default), where
it gets hard to expand the window again. As a drive-by improve the
visualization of highlighted files.

Fixes: QTBUG-119785
Change-Id: Ib4a7f37fa4886589bad4cce534a9d73c352dd4ee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit eaaa8647da)
This commit is contained in:
Dennis Oberst 2024-01-15 14:38:36 +01:00
parent 8e45afd0fa
commit c3c98748eb
2 changed files with 14 additions and 3 deletions

View File

@ -16,6 +16,8 @@ ApplicationWindow {
width: 1100
height: 600
minimumWidth: 200
minimumHeight: 100
visible: true
color: Colors.background
flags: Qt.Window | Qt.FramelessWindowHint

View File

@ -78,11 +78,20 @@ Rectangle {
anchors.fill: directoryIcon
source: directoryIcon
colorizationColor: (treeDelegate.expanded && treeDelegate.hasChildren)
? Colors.color2 : Colors.folder
colorization: 1.0
brightness: 1.0
colorizationColor: {
const isFile = treeDelegate.index === fileSystemTreeView.lastIndex
&& !treeDelegate.hasChildren;
if (isFile)
return Qt.lighter(Colors.folder, 3)
const isExpandedFolder = treeDelegate.expanded && treeDelegate.hasChildren;
if (isExpandedFolder)
return Colors.color2
else
return Colors.folder
}
}
HoverHandler {