Skip to content

Commit

Permalink
fix: Fixed sidebar issues
Browse files Browse the repository at this point in the history
Fixed sidebar issues

Bug: https://pms.uniontech.com/bug-view-297145.html
Log: Fixed sidebar issues
  • Loading branch information
pengfeixx authored and deepin-bot[bot] committed Dec 26, 2024
1 parent 8339808 commit 65f2163
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 12 additions & 2 deletions src/gui/mainwindow/FolderListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Item {
id: root

property int currentDropIndex: -1
property bool isCountShow: true
property int itemHeight: 30
property int lastDropIndex: -1
property int listHeight: 700
Expand Down Expand Up @@ -215,6 +214,7 @@ Item {
property bool isHovered: false
property bool isRename: false
property var startMove: [-1, -1]
property bool tooltipVisible: false

color: index === folderListView.currentIndex ? (root.activeFocus ? "#1F6DE4" : DTK.themeType === ApplicationHelper.LightType ? "#33000000" : "#33FFFFFF") : (isHovered ? (DTK.themeType === ApplicationHelper.LightType ? "#1A000000" : "#1AFFFFFF") : "transparent")
enabled: folderListView.enabled
Expand Down Expand Up @@ -247,6 +247,13 @@ Item {
renameLine.forceActiveFocus();
}

ToolTip {
id: folderItemTip

text: model.name
visible: tooltipVisible
}

RowLayout {
id: rowlayout

Expand Down Expand Up @@ -353,7 +360,7 @@ Item {
horizontalAlignment: Text.AlignRight
text: model.count
verticalAlignment: Text.AlignVCenter
visible: !rootItem.isRename && isCountShow
visible: !rootItem.isRename
width: 30
}
}
Expand All @@ -371,6 +378,7 @@ Item {

onClicked: {
root.forceActiveFocus();
tooltipVisible = false;
if (folderListView.itemAtIndex(folderListView.lastCurrentIndex)) {
folderListView.itemAtIndex(folderListView.lastCurrentIndex).isRename = false;
}
Expand All @@ -386,12 +394,14 @@ Item {
folderListView.itemAtIndex(folderListView.currentIndex).isRename = true;
}
onEntered: {
tooltipVisible = true;
if (folderListView.currentIndex == index) {
return;
}
parent.isHovered = true;
}
onExited: {
tooltipVisible = false;
if (folderListView.currentIndex == index) {
return;
}
Expand Down
10 changes: 3 additions & 7 deletions src/gui/mainwindow/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ ApplicationWindow {
property int createFolderBtnHeight: 40
property bool isRecording: webEngineView.isRecording
property int leftAreaMaxWidth: 300
property int leftAreaMinWidth: 100
property int leftAreaMinWidth: 125
property int leftViewWidth: 220
property int middleAreaMinWidth: 190
property int middleAreaMinWidth: 175
property int middleViewWidth: 260
property bool needHideSearch: false
property int rightAreaMinWidth: 390
property int rightAreaMinWidth: 380
property int tmpLeftAreaWidth: 220
property int tmpWebViewWidth: 0
property int tmprightDragX: 0
Expand Down Expand Up @@ -423,10 +423,6 @@ ApplicationWindow {
onPositionChanged: {
if (drag.active) {
var newWidth = leftDragHandle.x;
if (newWidth > 115)
folderListView.isCountShow = true;
else
folderListView.isCountShow = false;
if (newWidth >= leftBgArea.width) {
var shrinkWidth = newWidth - leftBgArea.width;
if ((middleBgArea.width + rightDragHandle.width) > middleAreaMinWidth) {
Expand Down

0 comments on commit 65f2163

Please sign in to comment.