aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/tableview.cpp
AgeCommit message (Collapse)Author
2015-05-29Fewer rebuilds triggered by changes in models.hGravatar Tomaz Canabrava
Models.h now is quite minimal, I'll keep it like that for now, until it grows huge again. I've also cleaned a bit the headers that are using it so only the ones that actually need the stuff that I've left behind will actually include this file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-19TableView - improving the column width calculationGravatar Marcos CARDINOT
Even that most (or all) tables have the remove button at the section 0, the method defaultColumnWidth should not assume that it will always be true. This patch will consider the title width of each section, instead of using a static width (which cause problems when the language is not en). Signed-off-by: Marcos Cardinot <mcardinot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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-12-29Remove duplicate tool-tip settingGravatar Anton Lundin
We set the real tool-tips with setBtnToolTip from maintab.cpp, so this is just duplicate and miss-leading. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19TableView: fix button sizingGravatar Giuseppe Bilotta
Ensure that there is no (clipped) overflowfrom the header. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19Fix tableview marginsGravatar Giuseppe Bilotta
The previous hard-coded solution for GTK+ didn't work on HiDPI, and a comment hinted that even on Mac OS X it might need tuning. Find a more generic solution that should work regardless of platform and style, based purely on the geometries reported by the style itself. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-19Resolution-independent trash iconGravatar Giuseppe Bilotta
Also, generate the corresponding pixmap only once, and distribute it to all models that need it. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Fix plus icon position based on the themeGravatar Tomaz Canabrava
I hope this time I got it right. basically, the old code tried to guess where the plus icon should be with a fairly bad set of defauults. This one patch asks for the Qt style where everything is and uses that knowledge to make it be in a more sane position. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Giuseppe Bilotta <giuseppe.bilota@gmail.com> 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-18Make TableView resolution independentGravatar Giuseppe Bilotta
Don't hard-code column widths or icon sizes/positions. Instead, compute them from the fonts used. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-26TableWidgets: change default column width and don't save unchanged widthsGravatar Dirk Hohndel
Similar change to the dive list. The idea is to not save things that are the default. This way Subsurface will do the right thing when defaults change. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Misc UI capitalisation consitencies and other text changesGravatar Tim Wootton
Capitalisation consitencies A typo correction A readability improvement (IMHO) Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> 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-16Fix some memory leaks.Gravatar Boris Barbulovski
Memory leaks were caused by broken parent/child relations. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> 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-12Fix TableWidget ( equipment ones ) on dark scheme.Gravatar Tomaz Canabrava
This patch uses the class created by the previous patch to get rid of the CSS and be really desktop native. it fixes a lot of stuff in non-blue-styles and throws a lot of code away. <3 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-22Fixes the correct sizes of the tables when first open.Gravatar Tomaz Canabrava
This patch fixes the correct sizes of the tables when first opened. It was defaulting to 'resizeToContents', but most of the cases when first opened we got no content, and this was bad. Now I'm defaulting to 30 when on the 'REMOVE' column and 80 on other columns. Fixes #189 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Refactoring of the configuration handling.Gravatar Patrick Valsecchi
Before, when clicking the OK button on the preferences GUI, we were updating in-memory preferences from the GUI, saving them to the configuration file from the GUI, reloading from the file to the in-memory preferences. Then, to add to the ducplication, when the application was exiting, some fields were saved again. Basically the first step and the last step were useless appart from the fact the the other steps where missing a few fields here and there. This patch removes the first step and fixes the missing fields. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> ACKed-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-13Partially revert d72c69db7a49f and fix its errorsGravatar Tomaz Canabrava
In the offending commit a QWidget was changed to QTableView, but only in the header - and thus making avaliable all method calls, but the initialization of the widgets was still a QWidget, and nothing of QTableView was used besides an incorrect call to setColumnHidden. This commit fixes that by using the view() method provided by the TableView implementation which returns the true QTableView that should be used for specific nitpicking, like hidding columns. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-12Add depth colum to cylinder modelGravatar Dirk Hohndel
To make the planner work this adds a new column to the Cylinder widget (depth - for the depth at which we want to change to a certain gas during deco). This also tries to hide that column in the equipment view and hide the start/end pressure columns in the planner view. Oddly that fails :-( Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
This means we don't have to new/delete them, which is a waste of overhead. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
This means we can also remove the forward declarations. This is the first step in removing the memory allocation for the ui sub-classes. Without the second step, this commit is just making the compilation time increase for no good reason :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-01Fix weight adding in the Qt UI & fix the header height for tablesGravatar Patrick Valsecchi
Fixes #203 Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-26Fix the positioning of the `add` button when on Gtk styleGravatar Tomaz Canabrava
Fix the positioning of the `add` button when on Gtk style, in my XFCE install (and thus, may differ a bit from the Gnome3 one ) the Plus button to add cylinders and weigths got really strange placements, this seems to fix this, I also tested on Oxygen and nothing broke there. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-03Missing Files.Gravatar Tomaz Canabrava
This should have been in the last commit - sorry. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>