Changeset - e246af74222f
[Not reviewed]
default
0 3 0
Hasan Yavuz ÖZDERYA - 9 years ago 2017-04-01 13:27:44
hy@ozderya.net
show tabs when focusing on command panel
3 files changed with 12 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/hidabletabwidget.cpp
Show inline comments
 
/*
 
  Copyright © 2015 Hasan Yavuz Özderya
 
  Copyright © 2017 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
  serialplot is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
@@ -74,6 +74,11 @@ void HidableTabWidget::connectSignals()
 
    }
 
    else // shown
 
    {
 
        connect(this, SIGNAL(tabBarDoubleClicked(int)), this, SLOT(onTabBarDoubleClicked()));
 
    }
 
}
 

	
 
void HidableTabWidget::showTabs()
 
{
 
    hideAction.setChecked(false);
 
}
src/hidabletabwidget.h
Show inline comments
 
/*
 
  Copyright © 2015 Hasan Yavuz Özderya
 
  Copyright © 2017 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
  serialplot is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
@@ -27,12 +27,15 @@ class HidableTabWidget : public QTabWidg
 
{
 
    Q_OBJECT
 
public:
 
    explicit HidableTabWidget(QWidget *parent = 0);
 
    QAction hideAction;
 

	
 
public slots:
 
    void showTabs();
 

	
 
private slots:
 
    void onHideAction(bool checked);
 
    void onTabBarClicked();
 
    void onTabBarDoubleClicked();
 

	
 
    void connectSignals();
src/mainwindow.cpp
Show inline comments
 
@@ -83,12 +83,13 @@ MainWindow::MainWindow(QWidget *parent) 
 
    ui->menuBar->insertMenu(ui->menuHelp->menuAction(), snapshotMan.menu());
 
    ui->menuBar->insertMenu(ui->menuHelp->menuAction(), commandPanel.menu());
 

	
 
    connect(&commandPanel, &CommandPanel::focusRequested, [this]()
 
            {
 
                this->ui->tabWidget->setCurrentWidget(&commandPanel);
 
                this->ui->tabWidget->showTabs();
 
            });
 

	
 
    tbPortControl->setObjectName("tbPortControl");
 
    ui->plotToolBar->setObjectName("tbPlot");
 

	
 
    setupAboutDialog();
 
@@ -250,12 +251,13 @@ MainWindow::MainWindow(QWidget *parent) 
 
    // Important: This should be after newCommandAction is triggered
 
    // (above) we don't want user to be greeted with command panel on
 
    // the very first run.
 
    connect(commandPanel.newCommandAction(), &QAction::triggered, [this]()
 
            {
 
                this->ui->tabWidget->setCurrentWidget(&commandPanel);
 
                this->ui->tabWidget->showTabs();
 
            });
 
}
 

	
 
MainWindow::~MainWindow()
 
{
 
    if (serialPort.isOpen())
0 comments (0 inline, 0 general)