diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-02-23 00:50:13 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-02-23 00:50:13 +0100 |
commit | e293776ef7d13b880217b3ba07188f3ca01408ab (patch) | |
tree | a7d6b11fa0c0ce4a158b3baea4058d625fadf0d0 | |
parent | ba5caaf6a24b01971db928ea39995952a929a714 (diff) | |
download | kvision-e293776ef7d13b880217b3ba07188f3ca01408ab.tar.gz kvision-e293776ef7d13b880217b3ba07188f3ca01408ab.tar.bz2 kvision-e293776ef7d13b880217b3ba07188f3ca01408ab.zip |
Support for "cursor" CSS property (#135)
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/core/Css.kt | 41 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt | 7 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Css.kt b/src/main/kotlin/pl/treksoft/kvision/core/Css.kt index 51ed1382..66a0db36 100644 --- a/src/main/kotlin/pl/treksoft/kvision/core/Css.kt +++ b/src/main/kotlin/pl/treksoft/kvision/core/Css.kt @@ -515,6 +515,47 @@ enum class LineBreak(internal val lineBreak: String) { ANYWHERE("anywhere") } +enum class Cursor(internal val cursor: String) { + DEFAULT("default"), + AUTO("auto"), + NONE("none"), + ALIAS("alias"), + ALLSCROLL("all-scroll"), + CELL("cell"), + CONTEXTMENU("context-menu"), + COLRESIZE("col-resize"), + COPY("copy"), + CROSSHAIR("crosshair"), + ERESIZE("e-resize"), + EWRESIZE("ew-resize"), + GRAB("grab"), + GRABBING("grabbing"), + HELP("help"), + MOVE("move"), + NRESIZE("n-resize"), + NERESIZE("ne-resize"), + NESWRESIZE("nesw-resize"), + NSRESIZE("ns-resize"), + NWRESIZE("nw-resize"), + NWSERESIZE("nwse-resize"), + NODROP("no-drop"), + NOTALLOWED("not-allowed"), + POINTER("pointer"), + PROGRESS("progress"), + ROWRESIZE("row-resize"), + SRESIZE("s-resize"), + SERESIZE("se-resize"), + SWRESIZE("sw-resize"), + TEXT("text"), + VERTICALTEXT("vertical-text"), + WRESIZE("w-resize"), + WAIT("wait"), + ZOOMIN("zoom-in"), + ZOOMOUT("zoom-out"), + INITIAL("initial"), + INHERIT("inherit") +} + /** * Type-safe definition of CSS border. * @param width width of the border diff --git a/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt b/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt index bf25f1af..80a2b0c4 100644 --- a/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt +++ b/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt @@ -284,6 +284,10 @@ abstract class StyledComponent { * CSS line break of the current component. */ open var lineBreak: LineBreak? by refreshOnUpdate() + /** + * CSS cursor shape over the current component. + */ + open var cursor: Cursor? by refreshOnUpdate() private var snStyleCache: List<StringPair>? = null @@ -483,6 +487,9 @@ abstract class StyledComponent { lineBreak?.let { snstyle.add("line-break" to it.lineBreak) } + cursor?.let { + snstyle.add("cursor" to it.cursor) + } globalStyleCache[cacheKey] = snstyle return snstyle } |