mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 08:59:55 +00:00
UI Nits: Sidebar remember their state
Rather than relying on the parent to maintain the splitter sizes and states, the GcSplitter remembers its own state and sizing. This includes remembering if the children have been hidden via the icon bar at the bottom of the splitter.
This commit is contained in:
@@ -667,12 +667,7 @@ MainWindow::MainWindow(const QDir &home) :
|
||||
analSidebar = new GcSplitter(Qt::Vertical);
|
||||
analSidebar->addWidget(analItem);
|
||||
analSidebar->addWidget(intervalItem);
|
||||
|
||||
QVariant analSplitterSizes = appsettings->cvalue(cyclist, GC_SETTINGS_INTERVALSPLITTER_SIZES);
|
||||
if (analSplitterSizes != QVariant()) {
|
||||
analSidebar->restoreState(analSplitterSizes.toByteArray());
|
||||
analSidebar->setOpaqueResize(true); // redraw when released, snappier UI
|
||||
}
|
||||
analSidebar->prepare(cyclist, "analysis");
|
||||
|
||||
QTreeWidgetItem *last = NULL;
|
||||
QStringListIterator i(RideFileFactory::instance().listRideFiles(home));
|
||||
@@ -994,7 +989,6 @@ MainWindow::MainWindow(const QDir &home) :
|
||||
connect(intervalWidget,SIGNAL(itemSelectionChanged()), this, SLOT(intervalTreeWidgetSelectionChanged()));
|
||||
connect(intervalWidget,SIGNAL(itemChanged(QTreeWidgetItem *,int)), this, SLOT(intervalEdited(QTreeWidgetItem*, int)));
|
||||
connect(splitter,SIGNAL(splitterMoved(int,int)), this, SLOT(splitterMoved(int,int)));
|
||||
connect(analSidebar,SIGNAL(splitterMoved(int,int)), this, SLOT(analSidebarMoved(int,int)));
|
||||
|
||||
connect(this, SIGNAL(rideDirty()), this, SLOT(enableSaveButton()));
|
||||
connect(this, SIGNAL(rideClean()), this, SLOT(enableSaveButton()));
|
||||
@@ -1386,12 +1380,6 @@ MainWindow::resizeEvent(QResizeEvent*)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::analSidebarMoved(int /* pos */, int /*index*/)
|
||||
{
|
||||
appsettings->setCValue(cyclist, GC_SETTINGS_INTERVALSPLITTER_SIZES, analSidebar->saveState());
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::splitterMoved(int pos, int /*index*/)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user