Add descriptive class comments

This commit is contained in:
lupoDharkael
2017-05-10 23:45:31 +02:00
parent c4d9210c35
commit eed067bf32
8 changed files with 25 additions and 2 deletions

View File

@@ -4,6 +4,9 @@
#include <QToolTip>
#include <QSettings>
// Button represents a single button of the capture widget, it can enable
// multiple functionality.
namespace {
const int BUTTON_SIZE = 30;
}

View File

@@ -1,6 +1,9 @@
#include "buttonhandler.h"
#include <QPoint>
// ButtonHandler is a habdler for every active button. It makes easier to
// manipulate the buttons as a unit.
namespace {
const int SEPARATION = 6;
}

View File

@@ -2,6 +2,9 @@
#include <QSettings>
#include <QColor>
// CaptureModification is a single modification in the screenshot drawn
// by the user.
CaptureModification::CaptureModification(
const Button::Type t, QPoint p) : m_type(t) {
m_coords.append(p);

View File

@@ -38,6 +38,9 @@
#include <QDebug>
// CaptureWidget is the main component used to capture the screen. It contains an
// are of selection with its respective buttons.
namespace {
const int HANDLE_SIZE = 9;
}

View File

@@ -11,7 +11,8 @@
#include <QFileDialog>
#include <QPainter>
// ADD MODIFICATIONS
// Screenshot is an extension of QPixmap which lets you manage specific tasks
Screenshot::Screenshot(const QPixmap &p) : m_screenshot(p) {
}

View File

@@ -7,6 +7,8 @@
#include <QVBoxLayout>
#include <QLabel>
// ConfigWindow contains the menus where you can configure the application
ConfigWindow::ConfigWindow(QWidget *parent) : QWidget(parent){
setAttribute(Qt::WA_DeleteOnClose);
setWindowIcon(QIcon(":img/flameshot.svg"));

View File

@@ -7,6 +7,8 @@
#include <QMenu>
#include <QSystemTrayIcon>
// Controller is the core component of Flameshot, creates the trayIcon and
// launches the capture widget
Controller::Controller(QObject *parent) : QObject(parent) {
createActions();
@@ -21,6 +23,7 @@ Controller::Controller(QObject *parent) : QObject(parent) {
qApp->setQuitOnLastWindowClosed(false);
}
// creates the items of the trayIcon
void Controller::createActions() {
m_configAction = new QAction(tr("&Configuration"), this);
connect(m_configAction, &QAction::triggered, this, &Controller::openConfigWindow);
@@ -32,6 +35,7 @@ void Controller::createActions() {
connect(m_quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
}
// creates the trayIcon
void Controller::createTrayIcon() {
// requires a widget as parent but it should be used the whole app live period
m_trayIconMenu = new QMenu();
@@ -46,18 +50,21 @@ void Controller::createTrayIcon() {
m_trayIcon->setIcon(QIcon(":img/flameshot.svg"));
}
// creation of a new capture
void Controller::slotPrintHotkey() {
if (!m_captureWindow) {
m_captureWindow = new CaptureWidget();
}
}
// creation of the configuration window
void Controller::openConfigWindow() {
if (!m_configWindow) {
m_configWindow = new ConfigWindow();
}
}
// creation of the window of information
void Controller::openInfoWindow() {
if (!m_infoWindow) {
m_infoWindow = new InfoWindow();

View File

@@ -1,7 +1,8 @@
#include "infowindow.h"
#include <QIcon>
// InfoWindow show basic information about the usage of Flameshot
InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) {
setAttribute(Qt::WA_DeleteOnClose);
setWindowIcon(QIcon(":img/flameshot.svg"));