Skip to content

Commit

Permalink
chore: applist leftMargin
Browse files Browse the repository at this point in the history
wrapper Item

Log:
  • Loading branch information
justforlxz authored and BLumia committed Apr 18, 2024
1 parent 4d0400d commit c41c8cb
Showing 1 changed file with 69 additions and 65 deletions.
134 changes: 69 additions & 65 deletions qml/windowed/AppListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,84 +75,88 @@ Item {
}
}

ToolButton {
id: headingBtn
Item {
width: parent.width
height: headingBtn.height
ToolButton {
id: headingBtn

enabled: true
ColorSelector.disabled: false
enabled: true
ColorSelector.disabled: false

focusPolicy: Qt.NoFocus
anchors.fill: parent
anchors.leftMargin: 5
anchors.rightMargin: 5
focusPolicy: Qt.NoFocus
anchors.fill: parent
anchors.leftMargin: 10
anchors.rightMargin: 10

text: {
if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.Alphabetary) {
return section.toUpperCase();
} else {
return getCategoryName(section)
text: {
if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.Alphabetary) {
return section.toUpperCase();
} else {
return getCategoryName(section)
}
}
}

contentItem: Item {
Row {
anchors.fill: parent
spacing: 3
QQC2.Label {
anchors.verticalCenter: parent.verticalCenter
text: headingBtn.text
font: LauncherController.adjustFontWeight(DTK.fontManager.t7, Font.Medium)
opacity: 0.6
contentItem: Item {
Row {
anchors.fill: parent
spacing: 3
QQC2.Label {
anchors.verticalCenter: parent.verticalCenter
text: headingBtn.text
font: LauncherController.adjustFontWeight(DTK.fontManager.t7, Font.Medium)
opacity: 0.6
}
}
}
}

MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton

onClicked: {
if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.Alphabetary) {
alphabetCategoryPopup.existingSections = CategorizedSortProxyModel.alphabetarySections()
var mousePos = mapToItem(listView, mouseX, mouseY)
var y = (mousePos.y + alphabetCategoryPopup.height) < listView.height ? mousePos.y : listView.height - alphabetCategoryPopup.height
alphabetCategoryPopup.y = y
alphabetCategoryPopup.x = 10
listView.opacity = 0.1
alphabetCategoryPopup.open()
} else if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.DDECategory) {
ddeCategoryMenu.existingSections = CategorizedSortProxyModel.DDECategorySections()
listView.opacity = 0.1
ddeCategoryMenu.open()
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton

onClicked: {
if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.Alphabetary) {
alphabetCategoryPopup.existingSections = CategorizedSortProxyModel.alphabetarySections()
var mousePos = mapToItem(listView, mouseX, mouseY)
var y = (mousePos.y + alphabetCategoryPopup.height) < listView.height ? mousePos.y : listView.height - alphabetCategoryPopup.height
alphabetCategoryPopup.y = y
alphabetCategoryPopup.x = 10
listView.opacity = 0.1
alphabetCategoryPopup.open()
} else if (CategorizedSortProxyModel.categoryType === CategorizedSortProxyModel.DDECategory) {
ddeCategoryMenu.existingSections = CategorizedSortProxyModel.DDECategorySections()
listView.opacity = 0.1
ddeCategoryMenu.open()
}
}
}

Menu {
id: ddeCategoryMenu
width: 150
modal: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent

property var existingSections: []
Repeater {
model: ddeCategoryMenu.existingSections
delegate: MenuItem {
id: menuItem
text: getCategoryName(modelData)
onTriggered: {
scrollToDDECategory(modelData)
}
contentItem: IconLabel {
alignment: Qt.AlignCenter
text: menuItem.text
color: parent.palette.windowText
Menu {
id: ddeCategoryMenu
width: 150
modal: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent

property var existingSections: []
Repeater {
model: ddeCategoryMenu.existingSections
delegate: MenuItem {
id: menuItem
text: getCategoryName(modelData)
onTriggered: {
scrollToDDECategory(modelData)
}
contentItem: IconLabel {
alignment: Qt.AlignCenter
text: menuItem.text
color: parent.palette.windowText
}
}
}
}

onVisibleChanged: {
if (!visible) {
listView.opacity = 1
onVisibleChanged: {
if (!visible) {
listView.opacity = 1
}
}
}
}
Expand Down

0 comments on commit c41c8cb

Please sign in to comment.