Add arrow to show expanded folder.
This commit is contained in:
@@ -10,7 +10,6 @@ import clide.module 1.0
|
|||||||
MenuBar {
|
MenuBar {
|
||||||
// Background for this MenuBar.
|
// Background for this MenuBar.
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
border.color: RustColors.explorer_background
|
|
||||||
color: RustColors.menubar
|
color: RustColors.menubar
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,6 +168,7 @@ MenuBar {
|
|||||||
component ClideMenu: Menu {
|
component ClideMenu: Menu {
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: RustColors.explorer_background
|
color: RustColors.explorer_background
|
||||||
|
border.color: Qt.darker(RustColors.menubar, 2)
|
||||||
implicitWidth: 100
|
implicitWidth: 100
|
||||||
radius: 2
|
radius: 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,10 +57,12 @@ TreeView {
|
|||||||
indentation: 12
|
indentation: 12
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: current ? RustColors.explorer_text_selected : "transparent"
|
color: current ? RustColors.explorer_folder_open : "transparent"
|
||||||
radius: 2.5
|
radius: 2.5
|
||||||
}
|
}
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
|
anchors.left: directoryIcon.right
|
||||||
|
anchors.leftMargin: 5
|
||||||
color: RustColors.explorer_text
|
color: RustColors.explorer_text
|
||||||
text: treeDelegate.fileName
|
text: treeDelegate.fileName
|
||||||
}
|
}
|
||||||
@@ -86,9 +88,18 @@ TreeView {
|
|||||||
source: setSourceImage()
|
source: setSourceImage()
|
||||||
sourceSize.height: 15
|
sourceSize.height: 15
|
||||||
sourceSize.width: 15
|
sourceSize.width: 15
|
||||||
x: treeDelegate.leftMargin + (treeDelegate.depth * treeDelegate.indentation)
|
x: treeDelegate.leftMargin + (treeDelegate.depth * treeDelegate.indentation) + (indicator.visible ? indicator.width : 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: indicator
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
font.pixelSize: 10
|
||||||
|
text: expanded ? "⮟" : "⮞"
|
||||||
|
visible: isTreeNode && hasChildren
|
||||||
|
x: padding + (depth * indentation)
|
||||||
|
}
|
||||||
MultiEffect {
|
MultiEffect {
|
||||||
id: iconOverlay
|
id: iconOverlay
|
||||||
|
|
||||||
@@ -120,10 +131,8 @@ TreeView {
|
|||||||
case Qt.LeftButton:
|
case Qt.LeftButton:
|
||||||
if (treeDelegate.hasChildren) {
|
if (treeDelegate.hasChildren) {
|
||||||
fileSystemTreeView.toggleExpanded(treeDelegate.row);
|
fileSystemTreeView.toggleExpanded(treeDelegate.row);
|
||||||
// fileSystemTreeView.lastIndex = treeDelegate.index
|
|
||||||
} else {
|
} else {
|
||||||
// If this model item doesn't have children, it means it's
|
// If this model item doesn't have children, it means it's representing a file.
|
||||||
// representing a file.
|
|
||||||
fileSystemTreeView.fileClicked(treeDelegate.filePath);
|
fileSystemTreeView.fileClicked(treeDelegate.filePath);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ impl Default for RustColorsImpl {
|
|||||||
explorer_text_selected: QColor::try_from("#262626").unwrap(),
|
explorer_text_selected: QColor::try_from("#262626").unwrap(),
|
||||||
explorer_background: QColor::try_from("#1E1F22").unwrap(),
|
explorer_background: QColor::try_from("#1E1F22").unwrap(),
|
||||||
explorer_folder: QColor::try_from("#54585b").unwrap(),
|
explorer_folder: QColor::try_from("#54585b").unwrap(),
|
||||||
explorer_folder_open: QColor::try_from("#2b2b2b").unwrap(),
|
explorer_folder_open: QColor::try_from("#393B40").unwrap(),
|
||||||
terminal_background: QColor::try_from("#111111").unwrap(),
|
terminal_background: QColor::try_from("#111111").unwrap(),
|
||||||
info_log: QColor::try_from("#C4FFFF").unwrap(),
|
info_log: QColor::try_from("#C4FFFF").unwrap(),
|
||||||
debug_log: QColor::try_from("#9148AF").unwrap(),
|
debug_log: QColor::try_from("#9148AF").unwrap(),
|
||||||
|
|||||||
Reference in New Issue
Block a user