diff options
-rw-r--r-- | lumina-fm/MainUI.cpp | 2 | ||||
-rw-r--r-- | lumina-fm/MainUI.h | 2 | ||||
-rw-r--r-- | lumina-wm-INCOMPLETE/LWindow.cpp | 105 | ||||
-rw-r--r-- | lumina-wm-INCOMPLETE/LWindow.h | 67 |
4 files changed, 175 insertions, 1 deletions
diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index 1c832b1a..fe9be78b 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -104,6 +104,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ closeTabShort = new QShortcut( QKeySequence(tr("Ctrl+W")), this); copyFilesShort = new QShortcut( QKeySequence(tr("Ctrl+C")), this); pasteFilesShort = new QShortcut( QKeySequence(tr("Ctrl+V")), this); + cutFilesShort = new QShortcut( QKeySequence(tr("Ctrl+X")), this); deleteFilesShort = new QShortcut( QKeySequence(tr("Delete")), this); //Finish loading the interface workThread->start(); @@ -285,6 +286,7 @@ void MainUI::setupConnections(){ connect(nextTabRShort, SIGNAL(activated()), this, SLOT( nextTab() ) ); connect(closeTabShort, SIGNAL(activated()), this, SLOT( tabClosed() ) ); connect(copyFilesShort, SIGNAL(activated()), this, SLOT( CopyItems() ) ); + connect(cutFilesShort, SIGNAL(activated()), this, SLOT( CutItems() ) ); connect(pasteFilesShort, SIGNAL(activated()), this, SLOT( PasteItems() ) ); connect(deleteFilesShort, SIGNAL(activated()), this, SLOT( RemoveItem() ) ); } diff --git a/lumina-fm/MainUI.h b/lumina-fm/MainUI.h index be8bb11f..cf9669b1 100644 --- a/lumina-fm/MainUI.h +++ b/lumina-fm/MainUI.h @@ -97,7 +97,7 @@ private: QString CItem; //the item that was right-clicked (for the context menu) //QStringList imgFilter, multiFilter; //image/multimedia filters QSettings *settings; - QShortcut *nextTabLShort, *nextTabRShort, *closeTabShort, *copyFilesShort, *pasteFilesShort, *deleteFilesShort; + QShortcut *nextTabLShort, *nextTabRShort, *closeTabShort, *copyFilesShort, *cutFilesShort, *pasteFilesShort, *deleteFilesShort; QCompleter *dirCompleter; bool isUserWritable, keepFocus; QTimer *syncTimer; diff --git a/lumina-wm-INCOMPLETE/LWindow.cpp b/lumina-wm-INCOMPLETE/LWindow.cpp new file mode 100644 index 00000000..3d15393d --- /dev/null +++ b/lumina-wm-INCOMPLETE/LWindow.cpp @@ -0,0 +1,105 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "LWindow.h" + +LWindow::LWindow(WId client) : QFrame(){ + activeState = LWindow::Normal; + this->setMouseTracking(true); //need this to determine mouse location when not clicked + this->setObjectName("LWindowFrame"); + this->setWindowFlags(Qt::Window | Qt::X11BypassWindowManagerHint); //ensure that this frame does not get a frame itself + InitWindow(); //initially create all the child widgets + updateAppearance(); //this loads the appearance based on window/theme settings +} + +LWindow::~LWindow(){ + +} + +// ================= +// PUBLIC +// ================= +//Return the ID of the managed window for the current graphics system (X11/Wayland/other) +WId LWindow::clientID(){ return CID; } + +bool LWindow::hasFrame(){ return this->isEnabled(); } + +// ================= +// PRIVATE +// ================= +void LWindow::InitWindow(){ + titleBar = new QLabel(this); //This is the "container" for all the title buttons/widgets + titleBar->setObjectName("TitleBar"); + title = new QLabel(this); //Shows the window title/text + title->setObjectName("Title"); + title->setCursor(Qt::SizeAllCursor); + icon = new QLabel(this); //Contains the window icon + icon->setObjectName("Icon"); + minB = new QToolButton(this); //Minimize Button + minB->setObjectName("Minimize"); + connect(minB, SIGNAL(clicked()), this, SLOT(minClicked()) ); + maxB = new QToolButton(this); //Maximize Button + maxB->setObjectName("Maximize"); + connect(maxB, SIGNAL(clicked()), this, SLOT(maxClicked()) ); + closeB = new QToolButton(this); + closeB->setObjectName("Close"); + connect(closeB, SIGNAL(clicked()), this, SLOT(closeClicked()) ); + otherB = new QToolButton(this); //Button to place any other actions + otherB->setObjectName("Options"); + otherB->setToolButtonPopupMode(QToolButton::InstantPopup); + otherM = new QMenu(this); //menu of "other" actions for the window + otherB->setMenu(otherM); + connect(otherM, SIGNAL(triggered(QAction*)), this, SLOT(otherClicked(QAction*)) ); +} + +ModStatus LWindow::getStateAtPoint(QPoint pt){ + +} + +void LWindow::setMouseCursor(ModStatus state){ + +} + +// ================= +// PUBLIC SLOTS +// ================= +void LWindow::updateAppearance(){ + +} + +// ================= +// PRIVATE SLOTS +// ================= +void LWindow::closeClicked(){ + +} + +void LWindow::minClicked(){ + +} + +void LWindow::maxClicked(){ + +} + +void LWindow::otherClicked(QAction* act){ + +} + +// ===================== +// PROTECTED +// ===================== +void LWindow::mousePressEvent(QMouseEvent *ev){ + +} + +void LWindow::mouseMoveEvent(QMouseEvent *ev){ + +} + +void LWindow::mouseReleaseEvent(QMouseEvent *ev){ + +} diff --git a/lumina-wm-INCOMPLETE/LWindow.h b/lumina-wm-INCOMPLETE/LWindow.h new file mode 100644 index 00000000..af5a8054 --- /dev/null +++ b/lumina-wm-INCOMPLETE/LWindow.h @@ -0,0 +1,67 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#ifndef _LUMINA_DESKTOP_SCREEN_SAVER_H +#define _LUMINA_DESKTOP_SCREEN_SAVER_H + +#include <QFrame> +#include <QLabel> +#include <QToolButton> +#include <QMenu> +#include <QMouseEvent> +#include <QAction> +#include <QPoint> + +class LWindow : public QFrame{ + Q_OBJECT +public: + LWindow(WId client); //MUST have a valid client window + ~LWindow(); + + WId clientID(); + bool hasFrame(); + +private: + void InitWindow(); //Initialize all the internal widgets + + //Window status + enum ModStatus{Normal, Move, ResizeTop, ResizeTopRight, ResizeRight, ResizeBottomRight, ResizeBottom, ResizeBottomLeft, ResizeLeft, ResizeTopLeft}; + ModStatus activeState; + //Functions for getting/setting state + ModStatus getStateAtPoint(QPoint); //generally used for mouse location detection + void setMouseCursor(ModStatus); //Update the mouse cursor based on state + + //General Properties + WId CID; //Client ID + + //Window Frame Widgets/Items + QLabel *titleBar, *title, *icon; + QToolButton *minB, *maxB, *closeB, *otherB; + QMenu *otherM; //menu of "other" actions for the window + +public slots: + //These slots are generally used for the outside event watcher to + void updateAppearance(); //reload the theme and change styling as necessary + void propertiesChanged(); + void + +private slots: + void closeClicked(); + void minClicked(); + void maxClicked(); + void otherClicked(QAction*); + +protected: + void mousePressEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + +signals: + + +}; + +#endif
\ No newline at end of file |