Skip to content

Commit

Permalink
Make the BufferList selection respect the number of visible elements
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBriza committed Sep 28, 2023
1 parent a353689 commit 05b6329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/Lith/Style/ItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ T.ItemDelegate {
background: Rectangle {
implicitWidth: 64
implicitHeight: 32
border.color: control.highlighted ? ColorUtils.mixColors(LithPalette.regular.text, LithPalette.regular.window, 0.5) : "transparent"
color: control.checked ? ColorUtils.mixColors(LithPalette.regular.highlight, LithPalette.regular.window, 0.7) :
control.highlighted ? ColorUtils.mixColors(LithPalette.regular.highlight, LithPalette.regular.window, 0.4) :
control.pressed ? ColorUtils.mixColors(LithPalette.regular.text, LithPalette.regular.window, 0.1) :
Expand Down
6 changes: 5 additions & 1 deletion modules/Lith/UI/BufferList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ Item {
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Up) {
bufferList.currentIndex--;
if (bufferList.currentIndex < -1)
bufferList.currentIndex = -1
event.accepted = true
}
if (event.key === Qt.Key_Down) {
bufferList.currentIndex++;
bufferList.currentIndex++
if (bufferList.currentIndex >= bufferList.count)
bufferList.currentIndex = bufferList.count - 1
event.accepted = true
}
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
Expand Down

0 comments on commit 05b6329

Please sign in to comment.