Autohidden chart settings framework

Setup code to enable revealed chart controls. When
in tabbed mode, if the cursor is towards the title
then the chart controls are revealed, as the cursor
moves away or off the chart the controls are hidden.

Each chart, that wants revealed controls must implement;

bool hasReveal() -- return true if controls are available
void reveal()    -- show controls (must be at top of chart and a single line)
void unrveal()   -- hide controls

Will now work through each chart adding the controls as needed.
Will also probably end up with a 'standard' flat stylesheet for
the controls, can implement this later.

See description for this feature here:
https://github.com/GoldenCheetah/GoldenCheetah/issues/31#issuecomment-12040318
This commit is contained in:
Mark Liversedge
2013-01-13 14:55:16 +00:00
parent b8e8101f79
commit 0fe044cc50
5 changed files with 51 additions and 12 deletions

View File

@@ -28,6 +28,8 @@
#include <X11/Xlib.h>
#endif
QApplication *application;
int
main(int argc, char *argv[])
{
@@ -35,12 +37,12 @@ main(int argc, char *argv[])
XInitThreads();
#endif
QApplication app(argc, argv);
application = new QApplication(argc, argv);
QFont font;
font.fromString(appsettings->value(NULL, GC_FONT_DEFAULT, QFont().toString()).toString());
font.setPointSize(appsettings->value(NULL, GC_FONT_DEFAULT_SIZE, 12).toInt());
app.setFont(font); // set default font
application->setFont(font); // set default font
//this is the path within the current directory where GC will look for
//files to allow USB stick support
@@ -99,7 +101,7 @@ main(int argc, char *argv[])
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
application->installTranslator(&qtTranslator);
// Language setting (default to system locale)
QVariant lang = appsettings->value(NULL, GC_LANG, QLocale::system().name());
@@ -107,7 +109,7 @@ main(int argc, char *argv[])
// Load specific translation
QTranslator gcTranslator;
gcTranslator.load(":translations/gc_" + lang.toString() + ".qm");
app.installTranslator(&gcTranslator);
application->installTranslator(&gcTranslator);
// Initialize metrics once the translator is installed
RideMetricFactory::instance().initialize();
@@ -118,7 +120,7 @@ main(int argc, char *argv[])
// initialise the trainDB
trainDB = new TrainDB(home);
QStringList args( app.arguments() );
QStringList args( application->arguments() );
QVariant lastOpened;
if( args.size() > 1 ){
@@ -157,5 +159,5 @@ main(int argc, char *argv[])
MainWindow *mainWindow = new MainWindow(home);
mainWindow->show();
}
return app.exec();
return application->exec();
}