mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Show/Hide Sidebar toolbar button
This commit is contained in:
@@ -198,6 +198,7 @@ MainWindow::MainWindow(const QDir &home) :
|
||||
toolbar = new GcToolBar(this);
|
||||
|
||||
QWidget *lspacer = new QWidget(this);
|
||||
QHBoxLayout *lspacerLayout = new QHBoxLayout(lspacer);
|
||||
lspacer->setFixedWidth(100);
|
||||
lspacer->setContentsMargins(0,0,0,0);
|
||||
lspacer->setFocusPolicy(Qt::NoFocus);
|
||||
@@ -205,6 +206,19 @@ MainWindow::MainWindow(const QDir &home) :
|
||||
lspacer->setStyleSheet("background-color: rgba( 255, 255, 255, 0% ); border: 0px;");
|
||||
toolbar->addWidget(lspacer);
|
||||
|
||||
// show hide sidbar
|
||||
QIcon rewIcon(":images/toolbar/main/tick.png");
|
||||
QPushButton *side = new QPushButton(rewIcon, "", this);
|
||||
side->setFocusPolicy(Qt::NoFocus);
|
||||
side->setIconSize(QSize(18,18));
|
||||
side->setAutoFillBackground(false);
|
||||
side->setAutoDefault(false);
|
||||
side->setFlat(true);
|
||||
side->setStyleSheet("background-color: rgba( 255, 255, 255, 0% ); border: 0px;");
|
||||
lspacerLayout->addWidget(side);
|
||||
lspacerLayout->addStretch();
|
||||
connect(side, SIGNAL(clicked()), this, SLOT(toggleSidebar()));
|
||||
|
||||
trainTool = new TrainTool(this, home);
|
||||
trainTool->hide();
|
||||
toolbar->addWidget(trainTool->getToolbarButtons());
|
||||
@@ -613,6 +627,12 @@ MainWindow::showDock()
|
||||
dock->toggleViewAction()->activate(QAction::Trigger);
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::toggleSidebar()
|
||||
{
|
||||
showSidebar(!toolBox->isVisible());
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::showSidebar(bool want)
|
||||
{
|
||||
|
||||
@@ -240,6 +240,7 @@ class MainWindow : public QMainWindow
|
||||
bool saveRideExitDialog(); // save dirty rides on exit dialog
|
||||
void showOptions();
|
||||
void showTools();
|
||||
void toggleSidebar();
|
||||
void showSidebar(bool want);
|
||||
void showToolbar(bool want);
|
||||
void showWorkoutWizard();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user