Mercurial > molko
comparison examples/example-label.c @ 150:9733d379be89
ui: add a standalone align() function
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 15 Oct 2020 13:13:38 +0200 |
parents | a43e79d489ea |
children | aa6e70e330a1 |
comparison
equal
deleted
inserted
replaced
149:a43e79d489ea | 150:9733d379be89 |
---|---|
56 .x = 0, | 56 .x = 0, |
57 .y = 0, | 57 .y = 0, |
58 .w = W, | 58 .w = W, |
59 .h = H, | 59 .h = H, |
60 .text = "Top left", | 60 .text = "Top left", |
61 .align = LABEL_ALIGN_TOP_LEFT | 61 .align = ALIGN_TOP_LEFT |
62 }, | 62 }, |
63 { | 63 { |
64 .x = 0, | 64 .x = 0, |
65 .y = 0, | 65 .y = 0, |
66 .w = W, | 66 .w = W, |
67 .h = H, | 67 .h = H, |
68 .text = "Top", | 68 .text = "Top", |
69 .align = LABEL_ALIGN_TOP | 69 .align = ALIGN_TOP |
70 }, | 70 }, |
71 { | 71 { |
72 .x = 0, | 72 .x = 0, |
73 .y = 0, | 73 .y = 0, |
74 .w = W, | 74 .w = W, |
75 .h = H, | 75 .h = H, |
76 .text = "Top right", | 76 .text = "Top right", |
77 .align = LABEL_ALIGN_TOP_RIGHT | 77 .align = ALIGN_TOP_RIGHT |
78 }, | 78 }, |
79 { | 79 { |
80 .x = 0, | 80 .x = 0, |
81 .y = 0, | 81 .y = 0, |
82 .w = W, | 82 .w = W, |
83 .h = H, | 83 .h = H, |
84 .text = "Right", | 84 .text = "Right", |
85 .align = LABEL_ALIGN_RIGHT | 85 .align = ALIGN_RIGHT |
86 }, | 86 }, |
87 { | 87 { |
88 .x = 0, | 88 .x = 0, |
89 .y = 0, | 89 .y = 0, |
90 .w = W, | 90 .w = W, |
91 .h = H, | 91 .h = H, |
92 .text = "Bottom right", | 92 .text = "Bottom right", |
93 .align = LABEL_ALIGN_BOTTOM_RIGHT | 93 .align = ALIGN_BOTTOM_RIGHT |
94 }, | 94 }, |
95 { | 95 { |
96 .x = 0, | 96 .x = 0, |
97 .y = 0, | 97 .y = 0, |
98 .w = W, | 98 .w = W, |
99 .h = H, | 99 .h = H, |
100 .text = "Bottom", | 100 .text = "Bottom", |
101 .align = LABEL_ALIGN_BOTTOM | 101 .align = ALIGN_BOTTOM |
102 }, | 102 }, |
103 { | 103 { |
104 .x = 0, | 104 .x = 0, |
105 .y = 0, | 105 .y = 0, |
106 .w = W, | 106 .w = W, |
107 .h = H, | 107 .h = H, |
108 .text = "Bottom left", | 108 .text = "Bottom left", |
109 .align = LABEL_ALIGN_BOTTOM_LEFT | 109 .align = ALIGN_BOTTOM_LEFT |
110 }, | 110 }, |
111 { | 111 { |
112 .x = 0, | 112 .x = 0, |
113 .y = 0, | 113 .y = 0, |
114 .w = W, | 114 .w = W, |
115 .h = H, | 115 .h = H, |
116 .text = "Left", | 116 .text = "Left", |
117 .align = LABEL_ALIGN_LEFT | 117 .align = ALIGN_LEFT |
118 }, | 118 }, |
119 { | 119 { |
120 .x = 0, | 120 .x = 0, |
121 .y = 0, | 121 .y = 0, |
122 .w = W, | 122 .w = W, |
123 .h = H, | 123 .h = H, |
124 .text = "The world is Malikania.", | 124 .text = "The world is Malikania.", |
125 .flags = LABEL_FLAGS_SHADOW, | 125 .flags = LABEL_FLAGS_SHADOW, |
126 .align = LABEL_ALIGN_CENTER | 126 .align = ALIGN_CENTER |
127 }, | 127 }, |
128 }; | 128 }; |
129 struct label mlabel = { | 129 struct label mlabel = { |
130 .text = "This one follows your mouse and is not aligned." | 130 .text = "This one follows your mouse and is not aligned." |
131 }; | 131 }; |