Commit graph

10 commits

Author SHA1 Message Date
Berthold Stoeger
8cd191c271 desktop: store pointer to parent in tab-widgets
Make it possible for the individual tab-widgets to access the
parent widget. In principle this could have been done by
downcasting the pointer returned by parent(), but this makes
it explicit.

The goal here is to store information on the selection,
current dive, etc. without repeating it in every subwidget.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-16 20:23:59 +02:00
Berthold Stoeger
cded7ef5fe selection: pass down selection to tab widgets
On selection change, pass down selection (including current
dive and dc) to the tab widgets. Ultimately, this should
remove access to global variables. A number of new accesses
are marked as TODO. They shall be removed in due course.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-16 20:23:59 +02:00
Berthold Stoeger
63664061eb cleanup: replace empty TabBase constructor by using directive
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-03-12 18:33:34 +01:00
Berthold Stoeger
a4dbe51aee cleanup: remove TabBase::enter/exitEditMode() functions
Since the edit mode was removed, these became unnecessary.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-03-12 18:33:34 +01:00
Berthold Stoeger
152016d293 cleanup: break out the dive-notes tab
There was always this weird asymmetry that the "maintab" widget
is one of the tabs itself, whereas the additional tabs were
treated as extra-widgets. Turn the first tab into explicit
source files to make the distinction between container and
content clear.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-03-12 18:33:32 +01:00
Dirk Hohndel
6201ac34b4 desktop: automatically pick a good theme title color
The preference setting seemed far too strange to do this. And not very user
friendly. So instead we figure out if this is a dark theme or not by looking at
text and background colors in the palette, and make sure we get notified if
that changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-04 14:47:10 -08:00
Dirk Hohndel
7d18a525f1 desktop: allow update of tab widget colors at run time
Adding a new virtual function to all of these classes may seem like overkill,
but of course the idea is that likely we'd allow similar changes to all of
them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03 23:08:39 -08:00
Dirk Hohndel
9021a44ccc Add SPDX header to desktop widgets
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Tomaz Canabrava
385816be2e Aparently, remove a QXB warning.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:25:53 -07:00
Tomaz Canabrava
1fc4fba69f Break down MainTab into smaller classes
Maintab is one of our most complex classes, and it's
something I'm not actually proud of. But it currently
works and the idea of splitting it was in my head for
quite a while.

This is the third or fourth tentative of splitting it,
and this time I let the most complex part of it untouched,
the Notes and Equipment tab are way too complex to untangle
right now on my limited time.

A new class 'TabBase' should be used for any new tab that
we may create, and added on the MainTab (see the new lines
on the MainTab constructor).

Also, Extra Info, Information, Photos and Statistics where
ported to this new way helping reduce the number of
lines and functions on the MainTab quite a bit.

Overall this is a step in the right direction for the future.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-06 18:23:25 -07:00