Closed houqp closed 11 years ago
It's a good idea. And the filenames of readerui.lua and ui.lua is confusing. Each time when I want to add a widget controller I have a good chance to open the wrong file. Should we rename ui.lua to uimanager.lua so that the function of this module can be easily identified?
I think that's a very good approach. When I started the new branch, I thought of something like this, a bit Java-style...
+1 to this, too. The ui.lua file started as a kind of pool, when the structure wasn't clear yet.
yeah also +1 for uimanager.lua.
OK, #782 is sent to handle this. Changes included:
frontend/ui/widget
dirdbg.lua
for debug class and functionswidget.lua
is split into:
frontend/ui/widget/base.lua
frontend/ui/widget/span.lua
frontend/ui/widget/container.lua
frontend/ui/widget/text.lua
frontend/ui/widget/progress.lua
frontend/ui/widget/group.lua
ui.lua
to uimanager.lua
Currently, I think files inside
frontend
directory is a little bit messy.The main problem is that all the files are put into
ui
folder.We now have ui widgets like
menu.lua
,config.lua
,botton.lua
, etc. We also have core ui modules likescreen.lua
,device.lua
,event.lua
,inputevent.lua
andgesturedetector.lua
. Besides these two main categories, we have helper modules likegeometry.lua
andtime.lua
. All of these modules are put into one folder which is not developer friendly. I myself sometime find it hard to find a specific file that I need to edit.Therefore, I suggest we create a
widget
subfolder insideui
folder and put all the widget files into it. So when some one needs a button widget, they can use `require "ui/widget/button" to include it.As for other files in
ui
folder, maybe we can leave them as is for now.We might also need a
frontend\data
folder which holds data modules that are related to UIs. For instance, all the reader options currently defined inside different document modules.I am interested in how other people think about this. Feel free to comments :)