@@ -66,18 +66,17 @@ void ekg::ui::event(
6666 ekg::input_info_t &input {ekg::p_core->handler_input .input };
6767 ekg::flags_t resize_over_dock {};
6868
69- /* ekg::io::trigger(
69+ ekg_action (
70+ frame.actions ,
71+ ekg::action::hover,
7072 (
7173 input.has_motion
7274 &&
7375 property.states .is_hovering
7476 &&
75- (ekg::timing_t::second > ekg::tweaks.task_latency)
76- ),
77- ekg::action::motion,
78- frame.actions,
79- this->properties
80- );*/
77+ (ekg::timing_t ::second && ekg::gui.ui .frequency )
78+ )
79+ );
8180
8281 if (
8382 input.was_pressed
@@ -135,38 +134,35 @@ void ekg::ui::event(
135134
136135 property.states .is_absolute = property.states .is_active ;
137136
138- /* ekg::io::trigger(
139- true,
140- ekg::action::press,
137+ ekg_action (
141138 frame.actions ,
142- this->properties
143- );*/
139+ ekg::action::press,
140+ true
141+ );
144142 } else if (input.has_motion && property.states .is_active ) {
145143 ekg::rect_t <float > new_rect {rect};
146144 ekg::vec2_t <float > interact {static_cast <ekg::vec2_t <float >>(input.interact )};
147145
148146 resize_over_dock = frame.widget .target_dock_resize ;
149147
150148 if (frame.widget .target_dock_drag != ekg::dock::none && frame.widget .target_dock_resize == ekg::dock::none) {
151- /* ekg::io::trigger(
152- ekg::timing_t::second > ekg::tweaks.task_latency,
153- ekg::action::drag,
149+ ekg_action (
154150 frame.actions ,
155- this->properties
156- );*/
151+ ekg::action::drag,
152+ ekg::timing_t ::second > ekg::gui.ui .frequency
153+ );
157154
158155 new_rect.x = interact.x - frame.widget .rect_delta .x ;
159156 new_rect.y = interact.y - frame.widget .rect_delta .y ;
160157 ekg::p_core->p_platform_base ->system_cursor = ekg::system_cursor::size_all;
161158 }
162159
163160 if (frame.widget .target_dock_resize != ekg::dock::none) {
164- /* ekg::io::trigger(
165- ekg::timing_t::second > ekg::tweaks.task_latency,
166- ekg::action::resize,
161+ ekg_action (
167162 frame.actions ,
168- this->properties
169- );*/
163+ ekg::action::resize,
164+ ekg::timing_t ::second > ekg::gui.ui .frequency
165+ );
170166
171167 if (ekg::has (frame.widget .target_dock_resize , ekg::dock::left)) {
172168 interact.x = ekg::clamp_min<float >(interact.x , frame.widget .rect_delta .x );
@@ -262,14 +258,11 @@ void ekg::ui::event(
262258
263259 if (input.was_released ) {
264260 if (property.states .is_active ) {
265- property.states .is_absolute = false ;
266-
267- /* ekg::io::trigger(
268- property.states.is_hovering,
269- ekg::action::release,
261+ ekg_action (
270262 frame.actions ,
271- this->properties
272- );*/
263+ ekg::action::release,
264+ property.states .is_hovering
265+ );
273266 }
274267
275268 frame.widget .target_dock_resize = ekg::dock::none;
@@ -315,19 +308,30 @@ void ekg::ui::buffering(
315308 property.parent_at != ekg::at_t ::not_found
316309 );
317310
311+ /* *
312+ * This allows scrolling and dragging behavior possible,
313+ * every child from this frame will be spaced always
314+ * ahead of margin.
315+ **/
316+ float margin_bound {frame.color_scheme .margin * 2 .0f };
317+ property.widget .rect_scissor .x += frame.color_scheme .margin ;
318+ property.widget .rect_scissor .y += frame.color_scheme .margin ;
319+ property.widget .rect_scissor .w -= margin_bound;
320+ property.widget .rect_scissor .h -= margin_bound;
321+
318322 ekg::draw::rect (
319323 rect,
320324 property.states .is_focused ? frame.color_scheme .focused_background : frame.color_scheme .background ,
321325 ekg::draw::mode::fill,
322- ekg::at_t ::not_found
326+ frame. layers [ ekg::layer::bg]
323327 );
324328
325329 if (property.states .is_active ) {
326330 ekg::draw::rect (
327331 rect,
328332 frame.color_scheme .highlight ,
329333 ekg::draw::mode::fill,
330- ekg::at_t ::not_found
334+ frame. layers [ ekg::layer::active_bg]
331335 );
332336 }
333337
@@ -336,23 +340,23 @@ void ekg::ui::buffering(
336340 rect,
337341 frame.color_scheme .highlight ,
338342 ekg::draw::mode::fill,
339- ekg::at_t ::not_found
343+ frame. layers [ ekg::layer::highlight_bg]
340344 );
341345 }
342346
343347 ekg::draw::rect (
344348 rect,
345349 property.states .is_focused ? frame.color_scheme .focused_outline : frame.color_scheme .outline ,
346350 ekg::draw::mode::outline,
347- ekg::at_t ::not_found
351+ frame. layers [ ekg::layer::outline]
348352 );
349353
350354 if (property.states .is_warning ) {
351355 ekg::draw::rect (
352356 rect,
353357 frame.color_scheme .warning_outline ,
354358 ekg::draw::mode::outline,
355- ekg::at_t ::not_found
359+ frame. layers [ ekg::layer::warning_outline]
356360 );
357361 }
358362
0 commit comments