Skip to content

Commit

Permalink
Fix checked state on SidebarCompactItem
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoStanojevic12 committed Nov 7, 2024
1 parent 5da0dd1 commit df99cde
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions MMaterial/Sidebar/SidebarCompactItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ Checkable {

function selectItem(subindex) : void {
if (ListView.view) {
if(typeof index !== "undefined")
ListView.view.currentIndex = index;
else if(typeof ObjectModel.index !== "undefined")
ListView.view.currentIndex = ObjectModel.index;

_root.sidebarData.currentIndex = index;

if (subindex >= 0)
Expand Down Expand Up @@ -137,7 +132,7 @@ Checkable {
id: _contextMenu

x: _root.width + Size.pixel6
currentIndex: _root.checked ? _root.sidebarData.currentSubIndex : -1
currentIndex: _root.sidebarData.currentSubIndex
closePolicy: Popup.CloseOnPressOutsideParent

background: Rectangle {
Expand Down Expand Up @@ -175,6 +170,7 @@ Checkable {

text: modelItem.text
width: _listView.width
selected: index == _root.sidebarData.currentSubIndex && _root.checked

onClicked: {
_root.selectItem(index);
Expand Down

0 comments on commit df99cde

Please sign in to comment.