Quick mode

This commit is contained in:
ArsenArsen 2017-05-13 19:19:56 +02:00
parent a4d17949dc
commit e47b69a9c5
4 changed files with 34 additions and 3 deletions

View File

@ -142,7 +142,8 @@ void CropScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
drawingSelection = drawingSelectionMaker();
if (drawingSelection)
if (!drawingSelection->init(this)) setDrawingSelection("None", [] { return nullptr; });
}
} else if (settings::settings().value("quickMode", false).toBool())
done();
prevButtons = Qt::NoButton;
}

View File

@ -3,8 +3,10 @@
#include "screenshotutil.hpp"
#include "ui_mainwindow.h"
#include <QAction>
#include <QCheckBox>
#include <QCloseEvent>
#include <QCoreApplication>
#include <QDesktopServices>
#include <QDoubleSpinBox>
#include <QInputDialog>
#include <QListWidgetItem>
@ -80,6 +82,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
addHotkeyItem("Fullscreen image", "fullscreen", new std::function<void()>([] { screenshotter::fullscreen(); }));
addHotkeyItem("Area image", "area", new std::function<void()>([] { screenshotter::area(); }));
ui->quickMode->setChecked(settings::settings().value("quickMode", false).toBool());
}
MainWindow::~MainWindow() {
@ -158,3 +162,11 @@ void MainWindow::on_hotkeys_doubleClicked(const QModelIndex &) {
if (ok && hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), *fncs.value(str));
}
}
void MainWindow::on_settingsButton_clicked() {
QDesktopServices::openUrl(QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/KShare"));
}
void MainWindow::on_quickMode_clicked(bool checked) {
settings::settings().setValue("quickMode", checked);
}

View File

@ -30,6 +30,10 @@ class MainWindow : public QMainWindow {
void on_hotkeys_doubleClicked(const QModelIndex &index);
void on_settingsButton_clicked();
void on_quickMode_clicked(bool checked);
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>512</width>
<height>304</height>
<height>337</height>
</rect>
</property>
<property name="windowTitle">
@ -25,7 +25,7 @@
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="6" column="0" colspan="2">
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;a href=&quot;https://github.com/ArsenArsen/KShare&quot;&gt;Source code available free for everyone. Forever.&lt;/a&gt;
@ -91,6 +91,20 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="quickMode">
<property name="text">
<string>Quick mode (mouse release screenshots)</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QPushButton" name="settingsButton">
<property name="text">
<string>Open settings directory</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">