aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/starwidget.cpp
AgeCommit message (Collapse)Author
2015-01-17Clean up the header filesGravatar Dirk Hohndel
Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-04Replace alpha value of gray star with lighter grayGravatar Robert C. Helling
It seems, on Linux qrgba does not work properly making stars with alpha red when selected. So the patch returns to just rgb without transparency but decreases the contrast to white by a factor of 5. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-03Make invisible stars stand out lessGravatar Robert C. Helling
As my wife kept pointing out for a long time, the greyed out stars were heavier as images than the yellow selected stars. This patch makes the grey stars semi-transparent. Signed-off-by: Robert C. Helling <helling@atdotde.de> Acked-by: Andrea Fischer-Helling <andrea@fraufischer.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Unify icon metricsGravatar Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18actually use defaultIconSize()Gravatar Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Dynamic StarWidget metricsGravatar Giuseppe Bilotta
The default IMG_SIZE and SPACING in the StarWidget are not appropriate for HiDPI displays. Replace them with StarMetrics which are auto-computed from the (default) font size (which Qt determines from the display DPI settings). Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Change the Star Widget to use QImage instead of QPixmapGravatar Tomaz Canabrava
Also, clean a few calls, this should make the widget a tiny bit faster. This patch also moves the grayImage function from the star widget to the global scope, so I can use it on the Calendar widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Whitespace and coding style updatesGravatar Dirk Hohndel
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-20Added Keyboard Navigation for the Star WidgetGravatar Tomaz Canabrava
Keys up and down to increase / decrease stars and also fixed focus policy for it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix uninitialised variable readGravatar Thiago Macieira
Found by Dr. Memory, run by Lubomir: Error #48: UNINITIALIZED READ: reading register al # 0 StarWidget::mouseReleaseEvent() [qt-ui/starwidget.cpp:29] Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22The never ending, futile fight for whitespace consistencyGravatar Dirk Hohndel
I just need to write a tool that does this... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-18Added option to edit the selected dive.Gravatar Tomaz Canabrava
Added option to edit the selected dive. Now the user can click on 'Edit', and a nice box will appear stating that the dive is in edit mode, and the user can edit all of the 'Notes' tab fields, including the rating. When the edition is finished, the user needs to click on 'edit' again to mark as accepted, or in reset to reset the fields to it's original state Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-27Added support for showing the Stars on the DiveTableGravatar Tomaz Canabrava
For the stars on the dive table I had to rework a bit my StarRating widget, because it used a pixmap for each widget that were created. Not it uses only 2 pixmaps: the active and inactive ones. A new file was created named modeldelegates(h, cpp) that should hold all delegates of the models. For the GTK / C folks, a 'Delegate' ia s way to bypass the default behavior of the view that's displaying the data. I also added the code to display the stars if no delegate is set ( good for debugging. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-23Use the star from the resource file instead of hardcoding it's patchGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-22Initial version of the Star Picker Widget.Gravatar Tomaz Canabrava
A very simple to use widget: StarWidget *stars = new StarWidget( windowParent); stars->setMaximumStars(10); stars->setCurrentStars( rand()%10); stars->show(); connect(stars, SIGNAL(valueChanged(int)), someObj, SLOT(starsChangedValue(int))); It currently uses a 'star.svg' file on the same folder as the binary. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>