HubTurbo / addressbook

A small app for training and experimentation
Other
1 stars 3 forks source link

Restructured ui #549

Closed damithc closed 7 years ago

damithc commented 8 years ago

Experimental restructuring of UI. Objectives:

image

Just wanted to see if this is viable. I think I broke a few tests in the process (had to move fast).

damithc commented 8 years ago

'Jump to nth card' shortcut triggers an NPE although the jump still happens.

m133225 commented 8 years ago

Would it be better if the Dialog contains the loading/configurations and handles a Controller? i.e. separate the restructured dialog into loader and controller.

damithc commented 8 years ago

Good point. That's the first design I tried i.e. each component had three parts.

[*UiPart]---->[*View] {this is the loader]
  |
  ----------->[*Controller]

But after implementing it (this was how I spent my entire Saturday!) I realized

Then I tried collapsing all three into one class and naming it *UiPart instead of *Controller but it turns out a controller cannot load itself. That's how I ended up with the separate loader.

m133225 commented 8 years ago

Instead of the UI part having reference to both objects, I was thinking more along this line:

[MainWindow] ---> [*Dialog] ----> [*Controller]

The dialog here thus:

This might be better, and we can abstract away methods such as setEscKeyToDismiss into the base class.

EDIT: Removed the UiPart since I misunderstood its purpose.