Skip to content

Commit

Permalink
fix: use more lighter background for item
Browse files Browse the repository at this point in the history
  • Loading branch information
wineee committed Apr 18, 2024
1 parent a3ef606 commit 4167557
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
7 changes: 3 additions & 4 deletions qml/windowed/AppListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Item {
}
}

background: ItemBackground { }

MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
Expand Down Expand Up @@ -205,10 +207,7 @@ Item {
}
}

background: BoxPanel {
visible: ColorSelector.controlState === DTK.HoveredState
outsideBorderColor: null
}
background: ItemBackground { }
}
}
}
Expand Down
1 change: 1 addition & 0 deletions qml/windowed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ qt_add_qml_module(launcher-qml-windowed
RecentlyInstalledView.qml
FrequentlyUsedView.qml
SearchResultView.qml
ItemBackground.qml
)
5 changes: 2 additions & 3 deletions qml/windowed/FreeSortListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import QtQuick 2.15
import QtQml.Models 2.15
import QtQuick.Controls 2.15 as QQC2
import org.deepin.dtk 1.0
import org.deepin.dtk.style 1.0 as DS

import org.deepin.launchpad 1.0
import org.deepin.launchpad.models 1.0
Expand Down Expand Up @@ -147,10 +148,8 @@ Item {
"text/x-dde-launcher-dnd-desktopId": model.desktopId
}

background: BoxPanel {
background: ItemBackground {
id: bg
visible: ColorSelector.controlState === DTK.HoveredState
outsideBorderColor: null
}

MouseArea {
Expand Down
16 changes: 15 additions & 1 deletion qml/windowed/IconItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,22 @@ Control {
ToolTip.visible: hovered
background: ButtonPanel {
button: parent
outsideBorderColor: null
radius: 8
insideBorderColor: null
outsideBorderColor: null
property Palette background: Palette {
normal {
crystal: Qt.rgba(0, 0, 0, 0.1)
}
normalDark {
crystal: Qt.rgba(1, 1, 1, 0.1)
}
hovered {
crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1)
}
}
color1: background
color2: background
}

onClicked: {
Expand Down
25 changes: 25 additions & 0 deletions qml/windowed/ItemBackground.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import QtQuick 2.15
import org.deepin.dtk 1.0 as D
import org.deepin.dtk.style 1.0 as DS

D.BoxPanel {
visible: D.ColorSelector.controlState === D.DTK.HoveredState
outsideBorderColor: null
insideBorderColor: null
implicitWidth: DS.Style.toolButton.width
implicitHeight: DS.Style.toolButton.height

property D.Palette background: D.Palette {
normal {
crystal: Qt.rgba(0, 0, 0, 0.1)
}
normalDark {
crystal: Qt.rgba(1, 1, 1, 0.1)
}
hovered {
crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.1)
}
}
color1: background
color2: background
}
8 changes: 8 additions & 0 deletions qml/windowed/SideBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.deepin.launchpad 1.0
import org.deepin.launchpad.models 1.0

ColumnLayout {
id: root
spacing: 10

property bool isFreeSort: CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.FreeCategory
Expand Down Expand Up @@ -114,6 +115,8 @@ ColumnLayout {
}
}

background: ItemBackground { }

onClicked: {
const menu = categorizedCom.createObject(this);
menu.popup(this, Qt.point(title.x, title.y));
Expand All @@ -137,6 +140,7 @@ ColumnLayout {
onClicked: {
DesktopIntegration.showUrl("computer:///")
}
background: ItemBackground { }
}

D.ToolButton {
Expand All @@ -152,6 +156,7 @@ ColumnLayout {
onClicked: {
DesktopIntegration.showFolder(StandardPaths.PicturesLocation)
}
background: ItemBackground { }
}

D.ToolButton {
Expand All @@ -167,6 +172,7 @@ ColumnLayout {
onClicked: {
DesktopIntegration.showFolder(StandardPaths.DocumentsLocation)
}
background: ItemBackground { }
}

D.ToolButton {
Expand All @@ -182,6 +188,7 @@ ColumnLayout {
onClicked: {
DesktopIntegration.showFolder(StandardPaths.DesktopLocation)
}
background: ItemBackground { }
}

D.ToolButton {
Expand All @@ -197,6 +204,7 @@ ColumnLayout {
onClicked: {
DesktopIntegration.openSystemSettings();
}
background: ItemBackground { }
}

Item {
Expand Down

0 comments on commit 4167557

Please sign in to comment.