mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile-widget: set printmode but allow events for ssrf-mobile
Reactivate printMode true for ssrf-mobile to avoid font problems, do not discard events if ssrf-mobile (even though printMode is true) Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
a658f80e27
commit
86ab5a91f7
2 changed files with 8 additions and 1 deletions
|
@ -15,7 +15,7 @@ QMLProfile::QMLProfile(QQuickItem *parent) :
|
||||||
setAntialiasing(true);
|
setAntialiasing(true);
|
||||||
m_profileWidget = new ProfileWidget2(0);
|
m_profileWidget = new ProfileWidget2(0);
|
||||||
m_profileWidget->setProfileState();
|
m_profileWidget->setProfileState();
|
||||||
m_profileWidget->setPrintMode(false);
|
m_profileWidget->setPrintMode(true);
|
||||||
m_profileWidget->setFontPrintScale(0.8);
|
m_profileWidget->setFontPrintScale(0.8);
|
||||||
connect(QMLManager::instance(), &QMLManager::sendScreenChanged, this, &QMLProfile::screenChanged);
|
connect(QMLManager::instance(), &QMLManager::sendScreenChanged, this, &QMLProfile::screenChanged);
|
||||||
setDevicePixelRatio(QMLManager::instance()->lastDevicePixelRatio());
|
setDevicePixelRatio(QMLManager::instance()->lastDevicePixelRatio());
|
||||||
|
|
|
@ -738,7 +738,9 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
|
||||||
struct event *event = currentdc->events;
|
struct event *event = currentdc->events;
|
||||||
struct event *ev;
|
struct event *ev;
|
||||||
struct gasmix lastgasmix = *get_gasmix(&displayed_dive, current_dc, 1, &ev, NULL);
|
struct gasmix lastgasmix = *get_gasmix(&displayed_dive, current_dc, 1, &ev, NULL);
|
||||||
|
|
||||||
while (event) {
|
while (event) {
|
||||||
|
#ifndef SUBSURFACE_MOBILE
|
||||||
// if print mode is selected only draw headings, SP change, gas events or bookmark event
|
// if print mode is selected only draw headings, SP change, gas events or bookmark event
|
||||||
if (printMode) {
|
if (printMode) {
|
||||||
if (empty_string(event->name) ||
|
if (empty_string(event->name) ||
|
||||||
|
@ -750,6 +752,10 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// printMode is always selected for SUBSURFACE_MOBILE due to font problems
|
||||||
|
// BUT events are wanted.
|
||||||
|
#endif
|
||||||
DiveEventItem *item = new DiveEventItem();
|
DiveEventItem *item = new DiveEventItem();
|
||||||
item->setHorizontalAxis(timeAxis);
|
item->setHorizontalAxis(timeAxis);
|
||||||
item->setVerticalAxis(profileYAxis);
|
item->setVerticalAxis(profileYAxis);
|
||||||
|
@ -760,6 +766,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
|
||||||
eventItems.push_back(item);
|
eventItems.push_back(item);
|
||||||
event = event->next;
|
event = event->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only set visible the events that should be visible
|
// Only set visible the events that should be visible
|
||||||
Q_FOREACH (DiveEventItem *event, eventItems) {
|
Q_FOREACH (DiveEventItem *event, eventItems) {
|
||||||
event->setVisible(!event->shouldBeHidden());
|
event->setVisible(!event->shouldBeHidden());
|
||||||
|
|
Loading…
Add table
Reference in a new issue