Quick mode
This commit is contained in:
parent
a4d17949dc
commit
e47b69a9c5
@ -142,7 +142,8 @@ void CropScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
|
|||||||
drawingSelection = drawingSelectionMaker();
|
drawingSelection = drawingSelectionMaker();
|
||||||
if (drawingSelection)
|
if (drawingSelection)
|
||||||
if (!drawingSelection->init(this)) setDrawingSelection("None", [] { return nullptr; });
|
if (!drawingSelection->init(this)) setDrawingSelection("None", [] { return nullptr; });
|
||||||
}
|
} else if (settings::settings().value("quickMode", false).toBool())
|
||||||
|
done();
|
||||||
prevButtons = Qt::NoButton;
|
prevButtons = Qt::NoButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,10 @@
|
|||||||
#include "screenshotutil.hpp"
|
#include "screenshotutil.hpp"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QListWidgetItem>
|
#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("Fullscreen image", "fullscreen", new std::function<void()>([] { screenshotter::fullscreen(); }));
|
||||||
addHotkeyItem("Area image", "area", new std::function<void()>([] { screenshotter::area(); }));
|
addHotkeyItem("Area image", "area", new std::function<void()>([] { screenshotter::area(); }));
|
||||||
|
|
||||||
|
ui->quickMode->setChecked(settings::settings().value("quickMode", false).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() {
|
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));
|
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);
|
||||||
|
}
|
||||||
|
@ -30,6 +30,10 @@ class MainWindow : public QMainWindow {
|
|||||||
|
|
||||||
void on_hotkeys_doubleClicked(const QModelIndex &index);
|
void on_hotkeys_doubleClicked(const QModelIndex &index);
|
||||||
|
|
||||||
|
void on_settingsButton_clicked();
|
||||||
|
|
||||||
|
void on_quickMode_clicked(bool checked);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = 0);
|
explicit MainWindow(QWidget *parent = 0);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>512</width>
|
<width>512</width>
|
||||||
<height>304</height>
|
<height>337</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -25,7 +25,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<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">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><a href="https://github.com/ArsenArsen/KShare">Source code available free for everyone. Forever.</a>
|
<string><a href="https://github.com/ArsenArsen/KShare">Source code available free for everyone. Forever.</a>
|
||||||
@ -91,6 +91,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menuBar">
|
<widget class="QMenuBar" name="menuBar">
|
||||||
|
Loading…
Reference in New Issue
Block a user