1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Make the graph tabs display configurable on Android

This commit is contained in:
Martin Tůma 2022-07-08 02:09:03 +02:00
parent 8b4daa43e3
commit 9ae771084b
3 changed files with 36 additions and 3 deletions

View File

@ -473,6 +473,13 @@ void GUI::createActions()
_showGraphSliderInfoAction->setCheckable(true); _showGraphSliderInfoAction->setCheckable(true);
connect(_showGraphSliderInfoAction, &QAction::triggered, this, connect(_showGraphSliderInfoAction, &QAction::triggered, this,
&GUI::showGraphSliderInfo); &GUI::showGraphSliderInfo);
#ifdef Q_OS_ANDROID
_showGraphTabsAction = new QAction(tr("Show tabs"), this);
_showGraphTabsAction->setMenuRole(QAction::NoRole);
_showGraphTabsAction->setCheckable(true);
connect(_showGraphTabsAction, &QAction::triggered, this,
&GUI::showGraphTabs);
#endif // Q_OS_ANDROID
// Settings actions // Settings actions
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
@ -631,6 +638,9 @@ void GUI::createMenus()
graphMenu->addSeparator(); graphMenu->addSeparator();
graphMenu->addAction(_showGraphGridAction); graphMenu->addAction(_showGraphGridAction);
graphMenu->addAction(_showGraphSliderInfoAction); graphMenu->addAction(_showGraphSliderInfoAction);
#ifdef Q_OS_ANDROID
graphMenu->addAction(_showGraphTabsAction);
#endif // Q_OS_ANDROID
graphMenu->addSeparator(); graphMenu->addSeparator();
graphMenu->addAction(_showGraphsAction); graphMenu->addAction(_showGraphsAction);
@ -1637,7 +1647,12 @@ void GUI::showGraphs(bool show)
_graphTabWidget->setHidden(!show); _graphTabWidget->setHidden(!show);
} }
#ifndef Q_OS_ANDROID #ifdef Q_OS_ANDROID
void GUI::showGraphTabs(bool show)
{
_graphTabWidget->tabBar()->setVisible(show);
}
#else // Q_OS_ANDROID
void GUI::showToolbars(bool show) void GUI::showToolbars(bool show)
{ {
if (show) { if (show) {
@ -2407,6 +2422,11 @@ void GUI::writeSettings()
!= SHOW_GRAPH_SLIDER_INFO_DEFAULT) != SHOW_GRAPH_SLIDER_INFO_DEFAULT)
settings.setValue(SHOW_GRAPH_SLIDER_INFO_SETTING, settings.setValue(SHOW_GRAPH_SLIDER_INFO_SETTING,
_showGraphSliderInfoAction->isChecked()); _showGraphSliderInfoAction->isChecked());
#ifdef Q_OS_ANDROID
if (_showGraphTabsAction->isChecked() != SHOW_GRAPH_TABS_DEFAULT)
settings.setValue(SHOW_GRAPH_TABS_SETTING,
_showGraphTabsAction->isChecked());
#endif // Q_OS_ANDROID
settings.endGroup(); settings.endGroup();
settings.beginGroup(POI_SETTINGS_GROUP); settings.beginGroup(POI_SETTINGS_GROUP);
@ -2746,6 +2766,13 @@ void GUI::readSettings(QString &activeMap, QStringList &disabledPOIs)
showGraphSliderInfo(false); showGraphSliderInfo(false);
else else
_showGraphSliderInfoAction->setChecked(true); _showGraphSliderInfoAction->setChecked(true);
#ifdef Q_OS_ANDROID
if (!settings.value(SHOW_GRAPH_TABS_SETTING, SHOW_GRAPH_TABS_DEFAULT)
.toBool())
showGraphTabs(false);
else
_showGraphTabsAction->setChecked(true);
#endif // Q_OS_ANDROID
settings.endGroup(); settings.endGroup();
settings.beginGroup(POI_SETTINGS_GROUP); settings.beginGroup(POI_SETTINGS_GROUP);

View File

@ -71,7 +71,9 @@ private slots:
void showGraphGrids(bool show); void showGraphGrids(bool show);
void showGraphSliderInfo(bool show); void showGraphSliderInfo(bool show);
void showPathMarkerInfo(QAction *action); void showPathMarkerInfo(QAction *action);
#ifndef Q_OS_ANDROID #ifdef Q_OS_ANDROID
void showGraphTabs(bool show);
#else // Q_OS_ANDROID
void showToolbars(bool show); void showToolbars(bool show);
void showFullscreen(bool show); void showFullscreen(bool show);
#endif // Q_OS_ANDROID #endif // Q_OS_ANDROID
@ -231,7 +233,9 @@ private:
QAction *_showGraphSliderInfoAction; QAction *_showGraphSliderInfoAction;
QAction *_distanceGraphAction; QAction *_distanceGraphAction;
QAction *_timeGraphAction; QAction *_timeGraphAction;
#ifndef Q_OS_ANDROID #ifdef Q_OS_ANDROID
QAction *_showGraphTabsAction;
#else // Q_OS_ANDROID
QAction *_keysAction; QAction *_keysAction;
QAction *_fullscreenAction; QAction *_fullscreenAction;
QAction *_showToolbarsAction; QAction *_showToolbarsAction;

View File

@ -32,6 +32,8 @@
#define SHOW_GRAPH_GRIDS_DEFAULT true #define SHOW_GRAPH_GRIDS_DEFAULT true
#define SHOW_GRAPH_SLIDER_INFO_SETTING "sliderInfo" #define SHOW_GRAPH_SLIDER_INFO_SETTING "sliderInfo"
#define SHOW_GRAPH_SLIDER_INFO_DEFAULT true #define SHOW_GRAPH_SLIDER_INFO_DEFAULT true
#define SHOW_GRAPH_TABS_SETTING "tabs"
#define SHOW_GRAPH_TABS_DEFAULT true
#define SHOW_TICKS_SETTING "pathTicks" #define SHOW_TICKS_SETTING "pathTicks"
#define SHOW_TICKS_DEFAULT false #define SHOW_TICKS_DEFAULT false