diff options
author | Ken Moore <ken@ixsystems.com> | 2017-01-17 10:39:23 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-01-17 10:39:23 -0500 |
commit | 3238afe3e7c27be176ab752d83bbacb39f3d61d4 (patch) | |
tree | 076041d75a1609ca3fc4692d1b0fe6bad7159069 /src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-3238afe3e7c27be176ab752d83bbacb39f3d61d4.tar.gz lumina-3238afe3e7c27be176ab752d83bbacb39f3d61d4.tar.bz2 lumina-3238afe3e7c27be176ab752d83bbacb39f3d61d4.zip |
Cleanup the lumina-screenshot interface again (with q5sys). This seems to be the best way to compress the UI elements without making it too cumbersome.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp index 96bc40d2..e15c2487 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp @@ -28,20 +28,29 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ scaleTimer = new QTimer(this); scaleTimer->setSingleShot(true); scaleTimer->setInterval(200); //~1/5 second - + tabbar = new QTabBar(this); + ui->tabLayout->insertWidget(0,tabbar); + tabbar->addTab(LXDG::findIcon("view-preview",""), tr("View")); + tabbar->addTab(LXDG::findIcon("preferences-other",""), tr("Settings")); + ui->stackedWidget->setCurrentWidget(ui->page_current); + //Add a spacer in the Toolbar + QWidget *spacer = new QWidget(this); + spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); + ui->toolBar->insertWidget(ui->actionClose, spacer); //Setup the connections - connect(ui->tool_save, SIGNAL(clicked()), this, SLOT(saveScreenshot()) ); + //connect(ui->tool_save, SIGNAL(clicked()), this, SLOT(saveScreenshot()) ); connect(ui->actionSave_As, SIGNAL(triggered()), this, SLOT(saveScreenshot()) ); connect(ui->tool_quicksave, SIGNAL(clicked()), this, SLOT(quicksave()) ); connect(ui->actionQuick_Save, SIGNAL(triggered()), this, SLOT(quicksave()) ); connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(closeApplication()) ); - connect(ui->push_snap, SIGNAL(clicked()), this, SLOT(startScreenshot()) ); + //connect(ui->push_snap, SIGNAL(clicked()), this, SLOT(startScreenshot()) ); connect(ui->actionTake_Screenshot, SIGNAL(triggered()), this, SLOT(startScreenshot()) ); connect(ui->tool_crop, SIGNAL(clicked()), IMG, SLOT(cropImage()) ); connect(IMG, SIGNAL(selectionChanged(bool)), this, SLOT(imgselchanged(bool)) ); connect(IMG, SIGNAL(scaleFactorChanged(int)), this, SLOT(imgScalingChanged(int)) ); connect(ui->slider_zoom, SIGNAL(valueChanged(int)), this, SLOT(sliderChanged()) ); connect(scaleTimer, SIGNAL(timeout()), this, SLOT(imgScalingChanged()) ); + connect(tabbar, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)) ); settings = new QSettings("lumina-desktop", "lumina-screenshot",this); if(settings->value("screenshot-target", "window").toString() == "window") { @@ -63,16 +72,17 @@ MainUI::~MainUI(){} void MainUI::setupIcons(){ //Setup the icons - ui->tool_save->setIcon( LXDG::findIcon("document-save","") ); + //ui->tool_save->setIcon( LXDG::findIcon("document-save","") ); ui->tool_quicksave->setIcon( LXDG::findIcon("document-edit","") ); ui->actionSave_As->setIcon( LXDG::findIcon("document-save-as","") ); ui->actionQuick_Save->setIcon( LXDG::findIcon("document-save","") ); ui->actionClose->setIcon( LXDG::findIcon("application-exit","") ); - ui->push_snap->setIcon( LXDG::findIcon("camera-web","") ); + //ui->push_snap->setIcon( LXDG::findIcon("camera-web","") ); ui->actionTake_Screenshot->setIcon( LXDG::findIcon("camera-web","") ); ui->tool_crop->setIcon( LXDG::findIcon("transform-crop","") ); ui->tool_resize->setIcon( LXDG::findIcon("transform-scale","") ); //ui->actionEdit->setIcon( LXDG::findIcon("applications-graphics","") ); + this->setWindowIcon( LXDG::findIcon("camera-web","") ); } void MainUI::showSaveError(QString path){ @@ -136,6 +146,12 @@ void MainUI::sliderChanged(){ scaleTimer->start(); } +void MainUI::tabChanged(int tab){ + if(tab==0){ ui->stackedWidget->setCurrentWidget(ui->page_current); } + else{ ui->stackedWidget->setCurrentWidget(ui->page_settings); } + ui->frame_modify->setVisible(tab==0); +} + bool MainUI::getWindow(){ //Use this function to set cwin cwin = 0; |