|
| 1 | +<style> |
| 2 | + body { |
| 3 | + padding: 0.4em; |
| 4 | + font-size: 15px; |
| 5 | + } |
| 6 | + |
| 7 | + window { |
| 8 | + padding: 0; |
| 9 | + } |
| 10 | + |
| 11 | + body > *, collapsing-header > * { |
| 12 | + margin: 0.3em; |
| 13 | + padding: 0.3em; |
| 14 | + } |
| 15 | + |
| 16 | + collapsing-header { |
| 17 | + padding: 0.4em; |
| 18 | + display: block; |
| 19 | + } |
| 20 | + |
| 21 | + arrow-button { |
| 22 | + display: inline-block; |
| 23 | + } |
| 24 | + |
| 25 | + plot-line { |
| 26 | + padding: 0.5em; |
| 27 | + } |
| 28 | + |
| 29 | +</style> |
| 30 | +<template> |
| 31 | + <window name="main" style="position: absolute; top: -1px; left: -1px; bottom: -1px; right: -1px" :flags="ImGuiWindowFlags_NoMove + ImGuiWindowFlags_NoResize + ImGuiWindowFlags_NoBackground + ImGuiWindowFlags_NoTitleBar"> |
| 32 | + <body style="background-color: rgba(0, 0, 0, 0.7)"> |
| 33 | + <span>Built-in elements showcase</span> |
| 34 | + <collapsing-header label="inputs" :flags="ImGuiTreeNodeFlags_SpanFullWidth"> |
| 35 | + <slider-angle v-rad="0.1">slider angle</slider-angle> |
| 36 | + <input-int v="10">input int 1</input-int> |
| 37 | + <input-int2 v="{1,2}">input int 2</input-int2> |
| 38 | + <input-int3 v="{1,2,3}">input int 3</input-int3> |
| 39 | + <input-double v="1.0">input double</input-double> |
| 40 | + <drag-int v="10">drag int 1</drag-int> |
| 41 | + <drag-int2 v="{1,2}">drag int 2</drag-int2> |
| 42 | + <drag-int4 v="{1,2,3,4}">drag int 4</drag-int4> |
| 43 | + <input-float v="10">input float 1</input-float> |
| 44 | + <input-float2 v="{1,2}">input float 2</input-float2> |
| 45 | + <input-float3 v="{1,2,3}">input float 3</input-float3> |
| 46 | + <input-float4 v="{1,2,3,4}">input float 4</input-float4> |
| 47 | + <input-text buf-size="1024">input text</input-text> |
| 48 | + <input-text-multiline buf-size="4086">Multiline text</input-text-multiline> |
| 49 | + </collapsing-header> |
| 50 | + <collapsing-header label="widgets"> |
| 51 | + <combo label="combo box" preview-value="select something"> |
| 52 | + <selectable>option 1</selectable> |
| 53 | + <selectable>option 2</selectable> |
| 54 | + </combo> |
| 55 | + <drag-float-range2 v-current-min="-10" v-current-max="10" v-speed="0.1">input float 4</drag-float-range2> |
| 56 | + <color-edit3 :col="{1, 1, 1}">color edit 3</color-edit3> |
| 57 | + <color-edit4 :col="{1, 1, 1, 1}">color edit 4</color-edit4> |
| 58 | + <radio-button v-on:click="self.option = 'option 1'" :active="self.option == 'option 1'">option 1</radio-button> |
| 59 | + <radio-button v-on:click="self.option = 'option 2'" :active="self.option == 'option 2'">option 2</radio-button> |
| 60 | + <radio-button v-on:click="self.option = 'option 3'" :active="self.option == 'option 3'">option 3</radio-button> |
| 61 | + <checkbox>checkbox</checkbox> |
| 62 | + </collapsing-header> |
| 63 | + <collapsing-header label="plots"> |
| 64 | + <plot-lines values="{1,2,3,4,5,6}" values-count="5" graph-size="0, 200"/> |
| 65 | + <plot-histogram values="{1,2,3,4,5,6}" values-count="5" graph-size="0, 200"/> |
| 66 | + </collapsing-header> |
| 67 | + <collapsing-header label="imgui layouts"> |
| 68 | + <!-- TODO: columns layout does not work, fix: disable layout for it --> |
| 69 | + <columns count="3" id="3 columns"/> |
| 70 | + <button>test1</button> |
| 71 | + <next-column/> |
| 72 | + <button>test2</button> |
| 73 | + <next-column/> |
| 74 | + <button>test3</button> |
| 75 | + <columns count="1"/> |
| 76 | + <button>next</button> |
| 77 | + <arrow-button dir="0" str-id="arrow1"/> |
| 78 | + <arrow-button dir="1" str-id="arrow1"/> |
| 79 | + <arrow-button dir="2" str-id="arrow1"/> |
| 80 | + <arrow-button dir="3" str-id="arrow1"/> |
| 81 | + </collapsing-header> |
| 82 | + </body> |
| 83 | + </window> |
| 84 | +</template> |
| 85 | + |
| 86 | +<script> |
| 87 | + return ImVue.new({ |
| 88 | + data = function() |
| 89 | + return { |
| 90 | + option = "option 2" |
| 91 | + } |
| 92 | + end |
| 93 | + }) |
| 94 | +</script> |
0 commit comments