diff --git a/capture/button.cpp b/capture/button.cpp index c34ad75e..a56407ed 100644 --- a/capture/button.cpp +++ b/capture/button.cpp @@ -4,6 +4,9 @@ #include #include +// Button represents a single button of the capture widget, it can enable +// multiple functionality. + namespace { const int BUTTON_SIZE = 30; } diff --git a/capture/buttonhandler.cpp b/capture/buttonhandler.cpp index f241109c..1bab2025 100644 --- a/capture/buttonhandler.cpp +++ b/capture/buttonhandler.cpp @@ -1,6 +1,9 @@ #include "buttonhandler.h" #include +// ButtonHandler is a habdler for every active button. It makes easier to +// manipulate the buttons as a unit. + namespace { const int SEPARATION = 6; } diff --git a/capture/capturemodification.cpp b/capture/capturemodification.cpp index ca30d456..89d94e36 100644 --- a/capture/capturemodification.cpp +++ b/capture/capturemodification.cpp @@ -2,6 +2,9 @@ #include #include +// 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); diff --git a/capture/capturewidget.cpp b/capture/capturewidget.cpp index 13222f24..53b2217a 100644 --- a/capture/capturewidget.cpp +++ b/capture/capturewidget.cpp @@ -38,6 +38,9 @@ #include +// 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; } diff --git a/capture/screenshot.cpp b/capture/screenshot.cpp index 309bce5d..98d8c212 100644 --- a/capture/screenshot.cpp +++ b/capture/screenshot.cpp @@ -11,7 +11,8 @@ #include #include -// ADD MODIFICATIONS +// Screenshot is an extension of QPixmap which lets you manage specific tasks + Screenshot::Screenshot(const QPixmap &p) : m_screenshot(p) { } diff --git a/configwindow.cpp b/configwindow.cpp index ba78f21a..60502b6b 100644 --- a/configwindow.cpp +++ b/configwindow.cpp @@ -7,6 +7,8 @@ #include #include +// 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")); diff --git a/controller.cpp b/controller.cpp index 4c00b5eb..7b2e4757 100644 --- a/controller.cpp +++ b/controller.cpp @@ -7,6 +7,8 @@ #include #include +// 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(); diff --git a/infowindow.cpp b/infowindow.cpp index 69eb2099..33aa10ed 100644 --- a/infowindow.cpp +++ b/infowindow.cpp @@ -1,7 +1,8 @@ #include "infowindow.h" - #include +// InfoWindow show basic information about the usage of Flameshot + InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) { setAttribute(Qt::WA_DeleteOnClose); setWindowIcon(QIcon(":img/flameshot.svg"));