vlang / ui

A cross-platform UI library written in V
MIT License
2.33k stars 153 forks source link

Refactor filenames #416

Closed ghost closed 2 years ago

ghost commented 2 years ago

Since the number of files and functions have increased considerably, I decided that it would be a good to refactor the code at this point.

I have not added, removed, or changed any features.

In order to make the whole thing easier to grasp

1) Modified the file names.

2) Moved related methods from one file to another based on receiver, as possible, but not all.

Added) Ah! I made a mistake in git mv. There's something wrong with focusable.v, layout.v, and widget.v, but there's nothing wrong with the content.

ghost commented 2 years ago

This is a bug of v fmt.

範囲を選択_037

This works

        if widget.id !in em.receivers[evt_type].map(it.id) {
            em.receivers[events.on_mouse_down] << widget
            $if evt_mngr ? {
                println('add receiver $widget.id for $evt_type')
            }
        }

But v fmt inserts . before events.on_mouse_down like .events.on_mouse_down.

        if widget.id !in em.receivers[evt_type].map(it.id) {
            em.receivers[.events.on_mouse_down] << widget
            $if evt_mngr ? {
                println('add receiver $widget.id for $evt_type')
            }
        }