What is the problem with DateTime widget ?
Datetime is an SWT widget that shows DATE/TIME/CALENDAR, so overall very useful widget!
In current version of SWT it looks like this:
So as you might have guessed DateTime is a Composite of Text, Button with Arrow Up and Button with Arrow Down. All this elements are separate widgets that are brought together to work synchronously at the time when widget is created. The problem is that creating a separate widget for every element and making all these widgets work together takes a lot of resources.
Also, If I use some weird GTK+ theme (Gnome-Cuepertino in screenshot) my Arrows on the buttons become invisible:
Finally, if we take a look at other widget with similar functionality (Spinner photo below) we may see that it has different buttons, so there is no consistency between widgets in SWT.
Is there an alternative solution ?
One of the possible solutions that we (Red Hat Eclipse Team) have proposed is to use Spinner widget as a back-end for DateTime widget.
Why to use Spinner ?
1. It has 2 buttons and a Text area, and all this works together by single widget. (Less resources required)
2. Spinner buttons are part of the Spinner itself, so they won’t disappear if you change to some weird theme3. Spinner and DateTime will have similar look, which will create consistency
So the next question would be:
What was being done on this front ?
I have been working on migrating the DateTime widget to Spinner couple of months ago, but due a lot of other work that was supposed to be done and long review time, this work was put into a shelf. However recently, when most of the crucial work on GTK+ 3 was done, I have decided to come back to it, and some significant progress was achieved.
So here is the first look of how DateTime may look when running on top of Spinner:
Theme Adwaita (GTK+ 2):
As you might see it still has Text area and Buttons, but they act as a single widget this time. (less resources needed)
So if I try to look at the same widget using some weird GTK+ theme (again Gnome-Cuepertino), you still can see buttons:
Finally if we take a look at the Spinner widget next to DateTime widget:
You can see the consistency :)
I will continue working on it, and hopefully soon it will take its place in the SWT family.
I will keep you updated!