Skip to content

Commit

Permalink
Update again after new rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Nov 1, 2023
1 parent 8ea5e47 commit a365321
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,82 +19,66 @@ public interface SelectableColumnKeybindings {

public val KeyEvent.isMultiSelectionKeyPressed: Boolean

val PointerKeyboardModifiers.isMultiSelectionKeyPressed: Boolean
public val PointerKeyboardModifiers.isMultiSelectionKeyPressed: Boolean

/**
* Select First Node
*/
val KeyEvent.isSelectFirstItem: Boolean
/** Select First Node */
public val KeyEvent.isSelectFirstItem: Boolean

/**
* Extend Selection to First Node inherited from Move Caret to Text Start with Selection
* Extend Selection to First Node inherited from Move Caret to Text Start
* with Selection
*/
val KeyEvent.isExtendSelectionToFirstItem: Boolean
public val KeyEvent.isExtendSelectionToFirstItem: Boolean

/**
* Select Last Node inherited from Move Caret to Text End
*/
val KeyEvent.isSelectLastItem: Boolean
/** Select Last Node inherited from Move Caret to Text End */
public val KeyEvent.isSelectLastItem: Boolean

/**
* Extend Selection to Last Node inherited from Move Caret to Text End with Selection
* Extend Selection to Last Node inherited from Move Caret to Text End with
* Selection
*/
val KeyEvent.isExtendSelectionToLastItem: Boolean
public val KeyEvent.isExtendSelectionToLastItem: Boolean

/**
* Select Previous Node inherited from Up
*/
val KeyEvent.isSelectPreviousItem: Boolean
/** Select Previous Node inherited from Up */
public val KeyEvent.isSelectPreviousItem: Boolean

/**
* Extend Selection with Previous Node inherited from Up with Selection
*/
val KeyEvent.isExtendSelectionWithPreviousItem: Boolean
/** Extend Selection with Previous Node inherited from Up with Selection */
public val KeyEvent.isExtendSelectionWithPreviousItem: Boolean

/**
* Select Next Node inherited from Down
*/
val KeyEvent.isSelectNextItem: Boolean
/** Select Next Node inherited from Down */
public val KeyEvent.isSelectNextItem: Boolean

/**
* Extend Selection with Next Node inherited from Down with Selection
*/
val KeyEvent.isExtendSelectionWithNextItem: Boolean
/** Extend Selection with Next Node inherited from Down with Selection */
public val KeyEvent.isExtendSelectionWithNextItem: Boolean

/**
* Scroll Page Up and Select Node inherited from Page Up
*/
val KeyEvent.isScrollPageUpAndSelectItem: Boolean
/** Scroll Page Up and Select Node inherited from Page Up */
public val KeyEvent.isScrollPageUpAndSelectItem: Boolean

/**
* Scroll Page Up and Extend Selection inherited from Page Up with Selection
* Scroll Page Up and Extend Selection inherited from Page Up with
* Selection
*/
val KeyEvent.isScrollPageUpAndExtendSelection: Boolean
public val KeyEvent.isScrollPageUpAndExtendSelection: Boolean

/**
* Scroll Page Down and Select Node inherited from Page Down
*/
val KeyEvent.isScrollPageDownAndSelectItem: Boolean
/** Scroll Page Down and Select Node inherited from Page Down */
public val KeyEvent.isScrollPageDownAndSelectItem: Boolean

/**
* Scroll Page Down and Extend Selection inherited from Page Down with Selection
* Scroll Page Down and Extend Selection inherited from Page Down with
* Selection
*/
val KeyEvent.isScrollPageDownAndExtendSelection: Boolean
public val KeyEvent.isScrollPageDownAndExtendSelection: Boolean

/**
* Edit item
*/
val KeyEvent.isEdit: Boolean
/** Edit item */
public val KeyEvent.isEdit: Boolean

/**
* SelectAll
*/
val KeyEvent.isSelectAll: Boolean
/** SelectAll */
public val KeyEvent.isSelectAll: Boolean
}

open class DefaultMacOsSelectableColumnKeybindings : DefaultSelectableColumnKeybindings() {
public open class DefaultMacOsSelectableColumnKeybindings : DefaultSelectableColumnKeybindings() {

companion object : DefaultMacOsSelectableColumnKeybindings()
public companion object : DefaultMacOsSelectableColumnKeybindings()

override val KeyEvent.isMultiSelectionKeyPressed: Boolean
get() = isMetaPressed
Expand All @@ -103,7 +87,9 @@ open class DefaultMacOsSelectableColumnKeybindings : DefaultSelectableColumnKeyb
get() = isMetaPressed
}

open class DefaultSelectableColumnKeybindings : SelectableColumnKeybindings {
public open class DefaultSelectableColumnKeybindings : SelectableColumnKeybindings {

public companion object : DefaultSelectableColumnKeybindings()

override val KeyEvent.isContiguousSelectionKeyPressed: Boolean
get() = isShiftPressed
Expand All @@ -117,45 +103,43 @@ open class DefaultSelectableColumnKeybindings : SelectableColumnKeybindings {
override val PointerKeyboardModifiers.isMultiSelectionKeyPressed: Boolean
get() = isCtrlPressed

companion object : DefaultSelectableColumnKeybindings()

override val KeyEvent.isSelectFirstItem
override val KeyEvent.isSelectFirstItem: Boolean
get() = key == Key.Home && !isContiguousSelectionKeyPressed

override val KeyEvent.isExtendSelectionToFirstItem
override val KeyEvent.isExtendSelectionToFirstItem: Boolean
get() = key == Key.Home && isContiguousSelectionKeyPressed

override val KeyEvent.isSelectLastItem
override val KeyEvent.isSelectLastItem: Boolean
get() = key == Key.MoveEnd && !isContiguousSelectionKeyPressed

override val KeyEvent.isExtendSelectionToLastItem
override val KeyEvent.isExtendSelectionToLastItem: Boolean
get() = key == Key.MoveEnd && isContiguousSelectionKeyPressed

override val KeyEvent.isSelectPreviousItem
override val KeyEvent.isSelectPreviousItem: Boolean
get() = key == Key.DirectionUp && !isContiguousSelectionKeyPressed

override val KeyEvent.isExtendSelectionWithPreviousItem
override val KeyEvent.isExtendSelectionWithPreviousItem: Boolean
get() = key == Key.DirectionUp && isContiguousSelectionKeyPressed

override val KeyEvent.isSelectNextItem
override val KeyEvent.isSelectNextItem: Boolean
get() = key == Key.DirectionDown && !isContiguousSelectionKeyPressed

override val KeyEvent.isExtendSelectionWithNextItem
override val KeyEvent.isExtendSelectionWithNextItem: Boolean
get() = key == Key.DirectionDown && isContiguousSelectionKeyPressed

override val KeyEvent.isScrollPageUpAndSelectItem
override val KeyEvent.isScrollPageUpAndSelectItem: Boolean
get() = key == Key.PageUp && !isContiguousSelectionKeyPressed

override val KeyEvent.isScrollPageUpAndExtendSelection
override val KeyEvent.isScrollPageUpAndExtendSelection: Boolean
get() = key == Key.PageUp && isContiguousSelectionKeyPressed

override val KeyEvent.isScrollPageDownAndSelectItem
override val KeyEvent.isScrollPageDownAndSelectItem: Boolean
get() = key == Key.PageDown && !isContiguousSelectionKeyPressed

override val KeyEvent.isScrollPageDownAndExtendSelection
override val KeyEvent.isScrollPageDownAndExtendSelection: Boolean
get() = key == Key.PageDown && isContiguousSelectionKeyPressed

override val KeyEvent.isEdit
override val KeyEvent.isEdit: Boolean
get() = false

override val KeyEvent.isSelectAll: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@ public open class DefaultTreeViewKeybindings : DefaultSelectableColumnKeybinding

public companion object : DefaultTreeViewKeybindings()

override val KeyEvent.isSelectParent
override val KeyEvent.isSelectParent: Boolean
get() = key == Key.DirectionLeft && !isContiguousSelectionKeyPressed

override val KeyEvent.isExtendSelectionToParent
override val KeyEvent.isExtendSelectionToParent: Boolean
get() = key == Key.DirectionLeft && isContiguousSelectionKeyPressed

override val KeyEvent.isSelectChild
override val KeyEvent.isSelectChild: Boolean
get() = key == Key.DirectionRight && !isContiguousSelectionKeyPressed

override val KeyEvent.isExtendSelectionToChild
override val KeyEvent.isExtendSelectionToChild: Boolean
get() = key == Key.DirectionRight && isContiguousSelectionKeyPressed

override val KeyEvent.isSelectNextSibling
override val KeyEvent.isSelectNextSibling: Boolean
get() = false

override val KeyEvent.isSelectPreviousSibling
override val KeyEvent.isSelectPreviousSibling: Boolean
get() = false

override val KeyEvent.isEdit get() = key == Key.F2 && !isContiguousSelectionKeyPressed
override val KeyEvent.isEdit: Boolean
get() = key == Key.F2 && !isContiguousSelectionKeyPressed
}

public interface TreeViewKeybindings : SelectableColumnKeybindings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ public interface PointerEventActions {
key: Any,
)

fun toggleKeySelection(
public fun toggleKeySelection(
key: Any,
allKeys: List<SelectableLazyListKey>,
selectableLazyListState: SelectableLazyListState,
)

fun onExtendSelectionToKey(
public fun onExtendSelectionToKey(
key: Any,
allKeys: List<SelectableLazyListKey>,
state: SelectableLazyListState,
selectionMode: SelectionMode,
)
}

open class DefaultSelectableLazyColumnEventAction : PointerEventActions {
public open class DefaultSelectableLazyColumnEventAction : PointerEventActions {

override fun handlePointerEventPress(
pointerEvent: PointerEvent,
Expand Down Expand Up @@ -251,7 +251,7 @@ public open class DefaultSelectableLazyColumnKeyActions(
override val actions: SelectableColumnOnKeyEvent = DefaultSelectableOnKeyEvent(keybindings),
) : KeyActions {

companion object : DefaultSelectableLazyColumnKeyActions(
public companion object : DefaultSelectableLazyColumnKeyActions(
when {
hostOs.isMacOS -> DefaultMacOsSelectableColumnKeybindings
else -> DefaultSelectableColumnKeybindings
Expand Down Expand Up @@ -292,7 +292,8 @@ public open class DefaultSelectableLazyColumnKeyActions(
isScrollPageUpAndExtendSelection -> onScrollPageUpAndExtendSelection(keys, state)
isScrollPageUpAndSelectItem -> onScrollPageUpAndSelectItem(keys, state)
isSelectAll -> onSelectAll(keys, state)
else -> return false}
else -> return false
}
}
return true
}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import org.jetbrains.jewel.ui.component.styling.TooltipStyle

@Stable
@GenerateDataFunctions
class DefaultComponentStyling(
public class DefaultComponentStyling(
public val checkboxStyle: CheckboxStyle,
public val chipStyle: ChipStyle,
public val circularProgressStyle: CircularProgressStyle,
Expand Down
Empty file.
Empty file.

0 comments on commit a365321

Please sign in to comment.