Skip to content

Commit

Permalink
fix: [UI] Add a semi transparent background effect to the sidebar
Browse files Browse the repository at this point in the history
  Add a semi transparent background effect to the sidebar

Log: [UI] Add a semi transparent background effect to the sidebar
Bug: https://pms.uniontech.com/bug-view-265267.html
  • Loading branch information
starhcq committed Aug 20, 2024
1 parent 5a6a094 commit 9456654
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ int main(int argc, char *argv[])
qputenv("XDG_CURRENT_DESKTOP", "Deepin");
}

//qputenv("QML_DISABLE_DISK_CACHE", "1");
qputenv("D_POPUP_MODE", "embed");
// 注意:请不要管理 QGuiApplication 对象的生命周期!
DApplication *app = new DApplication(argc, argv);
Expand Down
7 changes: 5 additions & 2 deletions src/qml/AlbumTitle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,12 @@ TitleBar {
width: spaceWidth > normalSearchEditWidth ? normalSearchEditWidth : spaceWidth
x: {
var centerX = 0
if (GStatus.sideBarX === 0)
if (GStatus.sideBarX === 0) {
centerX = (title.width - 200 - searchEdit.width) / 2 + 200
else

if (centerX + searchEdit.width > operLayout.x)
centerX = centerX - (centerX + searchEdit.width - operLayout.x)
} else
centerX = (title.width - searchEdit.width) / 2
if (centerX <= leftPos || searchEdit.width < normalSearchEditWidth) {
return leftPos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Item {
signal sigListViewPressed(int x, int y)
signal sigListViewReleased(int x, int y)

property var importedGridViewCount: 0
property var selectedPaths: []
property int filterComboOffsetY: 5
property int spaceCtrlHeight: filterCombo.y + filterComboOffsetY
Expand Down Expand Up @@ -138,10 +137,6 @@ Item {

}

Component.onCompleted: {
importedGridViewCount = importedGridView.count();
}

Connections {
target: vbar
onTopDelegateIndexChanged: {
Expand Down Expand Up @@ -509,7 +504,6 @@ Item {
}

Component.onCompleted: {
importedGridViewCount = importedGridView.count
importedGridView.flushView()
importedGridView.selectUrls(theModel.selectedPathObjs[index].paths)
}
Expand Down
15 changes: 8 additions & 7 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,29 @@ ApplicationWindow {
signal sigMoveCenter(int x, int y, int w, int h)
// 设置 dtk 风格窗口
DWindow.enabled: true
//DWindow.alphaBufferSize: 8
DWindow.alphaBufferSize: 8
title: ""
header: AlbumTitle {id: titleAlubmRect}

background: FadeInoutAnimation {
background: Rectangle {
anchors.fill: parent
show: GStatus.stackControlCurrent === 0 ? true : false
visible: GStatus.stackControlCurrent === 0 ? true : false
color: "transparent"
Row {
anchors.fill: parent
Rectangle {
BehindWindowBlur {
id: leftBgArea
width: GStatus.sideBarWidth
height: parent.height
anchors.top: parent.top
color: DTK.themeType === ApplicationHelper.LightType ? Qt.rgba(1, 1, 1, 0.9)
: Qt.rgba(16.0/255.0, 16.0/255.0, 16.0/255.0, 0.85)
blendColor: DTK.themeType === ApplicationHelper.LightType ? "#eaf7f7f7"
: "#ee252525"
Rectangle {
width: 1
height: parent.height
anchors.right: parent.right
color: DTK.themeType === ApplicationHelper.LightType ? "#eee7e7e7"
: "#ee252525"
: "#11a2a2a2"
}
}
Rectangle {
Expand Down

0 comments on commit 9456654

Please sign in to comment.