3snowp7im / urn

Split tracker / timer with GTK+ frontend
GNU General Public License v3.0
126 stars 36 forks source link

Best Delta #10

Open Stewmath opened 9 years ago

Stewmath commented 9 years ago

Simple enough request, a Best Delta at the bottom to go next to Previous Segment.

And, I'm not very familiar with json and css, but as far as I can tell the layout isn't terribly customizable? Some kind of component system like the other major split programs would be ideal, assuming it's not hidden in plain sight already.

deffi420 commented 9 years ago

We can customize the fonts and colors of the graphical interface using CSS. However, the order of components and which components are used etc cannot be customized yet. I agree that a rudimentary component system is the next big thing on our TODO list since it would also greatly simplify the code in urn-gtk.c. I'm interested in working on this, but I won't have time anytime soon, so contributions are welcome :)

Regarding the best delta... We already show deltas for each split, which is good enough for most people. Thus, I think that we should implement the best delta as a component after we have the component system in place.

deffi420 commented 9 years ago

I started refactoring the code into components using an object-oriented approach. Initial version of the component system is available in the branch 'refactor'. There is still a lot of testing and polishing to do before merging the new code to master, but the core architecture has been implemented. I'd appreciate any feedback if someone has the time to review the code.

Basically, I have stripped the timer components out of the urn-gtk.c file and implemented them as distinct objects in source files ./components/*.c. The available components are specified in an urn_components array defined in ./components/urn-component.c, which also determines the layout (i.e, which components are created and in which order). In the future, we probably want to use GtkBuilder and XML for layout definition without recompiling.

Anyhow, the new component system makes writing new components and maintaining old ones much easier. Furthermore, the length of urn-gtk.c reduces from 1331 LoC to 811 LoC, which is obviously a good thing. And most importantly, we can finally do silly things like multiple timers and title bars:

silly