3 Commits

4 changed files with 34 additions and 16 deletions

View File

@@ -1,3 +1,6 @@
[build] [build]
rustflags = [ "-C", "link-arg=-fuse-ld=lld", ] rustflags = [ "-C", "link-arg=-fuse-ld=lld", ]
[env]
QMAKE="/opt/Qt/6.7.3/gcc_64/bin/qmake6"
LD_LIBRARY_PATH="/opt/Qt/6.7.3/gcc_64/lib"

View File

@@ -19,13 +19,14 @@ And of course, [Rust](https://www.rust-lang.org/tools/install).
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
``` ```
This project requires at least Qt 6.7. To check your Qt version This project requires at least Qt 6.7.3 To check your Qt version
```bash ```bash
qmake6 -query QT_VERSION qmake6 -query QT_VERSION
``` ```
Use the [Qt Installer](https://www.qt.io/development/download) to download and install the Qt version of your choice. Use the [Qt Installer](https://www.qt.io/development/download) to download and install the Qt version of your choice.
If the installer is run with `sudo`, the default install location is `/opt/Qt`, otherwise Qt will be installed into your home directory.
**You must set the QMAKE variable before building clide**. This should be a path to `qmake6` binary installed on your system. **You must set the QMAKE variable before building clide**. This should be a path to `qmake6` binary installed on your system.
The following export is the default installation path for Qt 6.7 on Ubuntu 24.04 The following export is the default installation path for Qt 6.7 on Ubuntu 24.04
@@ -35,6 +36,14 @@ export QMAKE=$HOME/Qt/6.7.3/gcc_64/bin/qmake6
export LD_LIBRARY_PATH=$HOME/Qt/6.7.3/gcc_64/lib export LD_LIBRARY_PATH=$HOME/Qt/6.7.3/gcc_64/lib
``` ```
Though environment variables set using `export` will take precedence, these can also be set in [.cargo/config.toml](./.cargo/config.toml) for conveinence
```toml
[env]
QMAKE="/opt/Qt/6.7.3/gcc_64/bin/qmake6"
LD_LIBRARY_PATH="/opt/Qt/6.7.3/gcc_64/lib"
```
## Usage ## Usage
To install and run clide To install and run clide

View File

@@ -57,14 +57,8 @@ TreeView {
indentation: 12 indentation: 12
background: Rectangle { background: Rectangle {
color: "transparent" color: current ? RustColors.explorer_text_selected : "transparent"
radius: 2.5 radius: 2.5
Behavior on color {
ColorAnimation {
duration: 300
}
}
} }
contentItem: Text { contentItem: Text {
color: RustColors.explorer_text color: RustColors.explorer_text
@@ -105,7 +99,6 @@ TreeView {
const isFile = !treeDelegate.hasChildren; const isFile = !treeDelegate.hasChildren;
if (isFile) if (isFile)
return Qt.lighter(RustColors.explorer_folder, 2); return Qt.lighter(RustColors.explorer_folder, 2);
const isExpandedFolder = treeDelegate.expanded && treeDelegate.hasChildren; const isExpandedFolder = treeDelegate.expanded && treeDelegate.hasChildren;
if (isExpandedFolder) if (isExpandedFolder)
return Qt.darker(RustColors.explorer_folder, 2); return Qt.darker(RustColors.explorer_folder, 2);
@@ -125,12 +118,14 @@ TreeView {
onSingleTapped: (eventPoint, button) => { onSingleTapped: (eventPoint, button) => {
switch (button) { switch (button) {
case Qt.LeftButton: case Qt.LeftButton:
fileSystemTreeView.toggleExpanded(treeDelegate.row); if (treeDelegate.hasChildren) {
fileSystemTreeView.lastIndex = treeDelegate.index fileSystemTreeView.toggleExpanded(treeDelegate.row);
// If this model item doesn't have children, it means it's // fileSystemTreeView.lastIndex = treeDelegate.index
// representing a file. } else {
if (!treeDelegate.hasChildren) // If this model item doesn't have children, it means it's
// representing a file.
fileSystemTreeView.fileClicked(treeDelegate.filePath); fileSystemTreeView.fileClicked(treeDelegate.filePath);
}
break; break;
case Qt.RightButton: case Qt.RightButton:
contextMenu.popup(); contextMenu.popup();
@@ -160,4 +155,6 @@ TreeView {
} }
} }
} }
selectionModel: ItemSelectionModel {
}
} }

View File

@@ -8,6 +8,8 @@ import QtQuick.Controls
import clide.module 1.0 import clide.module 1.0
Rectangle { Rectangle {
id: root
readonly property color currentColor: { readonly property color currentColor: {
if (pressed) { if (pressed) {
return RustColors.pressed; return RustColors.pressed;
@@ -24,11 +26,18 @@ Rectangle {
color: currentColor color: currentColor
implicitHeight: 8 implicitHeight: 8
radius: 2.5 radius: 2.5
opacity: root.hovered ? 1.0 : 0.0
// Execute these behaviors when the color is changed. // Execute these behaviors when the color is changed.
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {
duration: 400 duration: 500
}
}
Behavior on opacity {
OpacityAnimator {
duration: 500
} }
} }
} }