Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
61360f9
fix: remove unused dependencies sentry-native and tracy from conanfile
ahmedhussein89 Jan 19, 2026
2e266ec
Refactor QtMainWindow and related classes into a new directory structure
ahmedhussein89 Jan 19, 2026
0953abd
feat: add MouseReleaseFilter and QtViewToggle classes for enhanced mo…
ahmedhussein89 Jan 19, 2026
84e01fb
feat: implement chat functionality with ChatView and QtChatView compo…
ahmedhussein89 Jan 21, 2026
3069353
feat: enhance chat functionality with message handling and UI updates
ahmedhussein89 Jan 21, 2026
ca6879c
feat: implement signal-slot connections for chat message handling in …
ahmedhussein89 Jan 21, 2026
2e0bd69
feat: enhance chat functionality with error handling and message disp…
ahmedhussein89 Jan 21, 2026
0879eb1
feat: add ILLMService interface and implementation for LLM service ab…
ahmedhussein89 Jan 23, 2026
4e92d49
feat: add ChatMessage class for representing chat messages
ahmedhussein89 Jan 23, 2026
54b81e8
feat: add ChatModel class for managing chat messages in a Qt model
ahmedhussein89 Jan 23, 2026
f1b5247
feat: update ChatView class with widget creation and refresh methods,…
ahmedhussein89 Jan 23, 2026
45f13d2
refactor: streamline Controller class by renaming member variable and…
ahmedhussein89 Jan 23, 2026
f87443a
feat: add MessageBubbleWidget for displaying chat messages with impro…
ahmedhussein89 Jan 23, 2026
d1c0812
feat: implement MessageBubbleWidget for displaying chat messages with…
ahmedhussein89 Jan 23, 2026
6d61716
feat: enhance ChatController with user message handling and LLM integ…
ahmedhussein89 Jan 23, 2026
02a5b25
feat: integrate ChatModel into ChatView creation in QtViewFactory
ahmedhussein89 Jan 23, 2026
8acb000
feat: refactor QtChatView to integrate ChatModel and enhance message …
ahmedhussein89 Jan 23, 2026
6d8a31f
feat: update createChatComponent to integrate ChatModel and ILLMServi…
ahmedhussein89 Jan 23, 2026
d3640e2
feat: enhance QtCodeView constructor and header for improved focus ha…
ahmedhussein89 Jan 23, 2026
79ccd41
feat: update header inclusions and improve member variable naming for…
ahmedhussein89 Jan 23, 2026
7f9a447
feat: remove createWidgetWrapper from ChatView and implement in QtCha…
ahmedhussein89 Jan 23, 2026
6742bd9
feat: update ComponentFactory to integrate LlmCoordinator and modify …
ahmedhussein89 Feb 24, 2026
5739893
feat: refactor ChatController to integrate LlmCoordinator and improve…
ahmedhussein89 Feb 24, 2026
c51efc3
fix: correct template usage in addMessage method for better error han…
ahmedhussein89 Feb 24, 2026
38bb4ea
feat: implement ILLMService interface and restructure CMakeLists for …
ahmedhussein89 Feb 24, 2026
0c44dc9
feat: add LlmCoordinator class to manage LLM service providers and us…
ahmedhussein89 Feb 24, 2026
8460e22
feat: add LlmContextBuilder and related structures for context manage…
ahmedhussein89 Feb 24, 2026
bfa899c
refactor: update ChatModel to use QStandardItemModel for message stor…
ahmedhussein89 Feb 24, 2026
6c55bb1
feat: add MessageBubbleDelegate for custom rendering of chat messages…
ahmedhussein89 Feb 24, 2026
4696622
feat: refactor QtChatView to use QListView for chat message display a…
ahmedhussein89 Feb 24, 2026
5f31c4f
feat: integrate ChatModel and LlmCoordinator into chat component crea…
ahmedhussein89 Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add MouseReleaseFilter and QtViewToggle classes for enhanced mo…
…use event handling
  • Loading branch information
ahmedhussein89 committed Jan 19, 2026
commit 0953abd66067c0351e4f851ae1c82f876af2682b
6 changes: 6 additions & 0 deletions src/lib_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,14 @@ add_files(
qt/window/QtKnownProgressDialog.h
qt/window/QtLicenseWindow.cpp
qt/window/QtLicenseWindow.h
# {
qt/window/MainWindow/MouseReleaseFilter.cpp
qt/window/MainWindow/MouseReleaseFilter.hpp
qt/window/MainWindow/QtMainWindow.cpp
qt/window/MainWindow/QtMainWindow.h
qt/window/MainWindow/QtViewToggle.cpp
qt/window/MainWindow/QtViewToggle.hpp
# }
qt/window/QtPathListDialog.cpp
qt/window/QtPathListDialog.h
qt/window/QtPreferencesWindow.cpp
Expand Down
29 changes: 29 additions & 0 deletions src/lib_gui/qt/window/MainWindow/MouseReleaseFilter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "MouseReleaseFilter.hpp"

#include <QMouseEvent>

#include "IApplicationSettings.hpp"
#include "type/history/MessageHistoryRedo.h"
#include "type/history/MessageHistoryUndo.h"


MouseReleaseFilter::MouseReleaseFilter(QObject* parent)
: QObject(parent)
, m_backButton(static_cast<std::size_t>(IApplicationSettings::getInstanceRaw()->getControlsMouseBackButton()))
, m_forwardButton(static_cast<std::size_t>(IApplicationSettings::getInstanceRaw()->getControlsMouseForwardButton())) {}

bool MouseReleaseFilter::eventFilter(QObject* obj, QEvent* event) {
if(event->type() == QEvent::MouseButtonRelease) {
if(const auto* mouseEvent = dynamic_cast<QMouseEvent*>(event); mouseEvent != nullptr) {
if(mouseEvent->button() == m_backButton) {
MessageHistoryUndo{}.dispatch();
return true;
} else if(mouseEvent->button() == m_forwardButton) {
MessageHistoryRedo{}.dispatch();
return true;
}
}
}

return QObject::eventFilter(obj, event);
}
16 changes: 16 additions & 0 deletions src/lib_gui/qt/window/MainWindow/MouseReleaseFilter.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <QObject>

class MouseReleaseFilter : public QObject {
Q_OBJECT

public:
explicit MouseReleaseFilter(QObject* parent);

protected:
bool eventFilter(QObject* obj, QEvent* event) override;

private:
size_t m_backButton;
size_t m_forwardButton;
};
51 changes: 5 additions & 46 deletions src/lib_gui/qt/window/MainWindow/QtMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
#include "Application.h"
#include "Bookmark.h"
#include "CompositeView.h"
#include "FilePath.h"
#include "FileSystem.h"
#include "globalStrings.h"
#include "IApplicationSettings.hpp"
#include "logging.h"
#include "MouseReleaseFilter.hpp"
#include "QtAbout.h"
#include "QtContextMenu.h"
#include "QtFileDialog.h"
Expand All @@ -31,6 +33,7 @@
#include "QtPreferencesWindow.h"
#include "QtProjectWizard.h"
#include "QtStartScreen.hpp"
#include "QtViewToggle.hpp"
#include "QtViewWidgetWrapper.h"
#include "ResourcePaths.h"
#include "TabbedView.h"
Expand Down Expand Up @@ -64,50 +67,6 @@
#include "utilityString.h"
#include "View.h"

QtViewToggle::QtViewToggle(View* view, QWidget* parent) : QWidget(parent), m_view(view) {}

void QtViewToggle::clear() {
m_view = nullptr;
}

void QtViewToggle::toggledByAction() {
if(m_view != nullptr) {
if(auto* window = dynamic_cast<QtMainWindow*>(parent()); window != nullptr) {
window->toggleView(m_view, true);
}
}
}

void QtViewToggle::toggledByUI() {
if(m_view != nullptr) {
if(auto* window = dynamic_cast<QtMainWindow*>(parent()); window != nullptr) {
window->toggleView(m_view, false);
}
}
}


MouseReleaseFilter::MouseReleaseFilter(QObject* parent) : QObject(parent) {
m_backButton = static_cast<std::size_t>(IApplicationSettings::getInstanceRaw()->getControlsMouseBackButton());
m_forwardButton = static_cast<std::size_t>(IApplicationSettings::getInstanceRaw()->getControlsMouseForwardButton());
}

bool MouseReleaseFilter::eventFilter(QObject* obj, QEvent* event) {
if(event->type() == QEvent::MouseButtonRelease) {
if(const auto* mouseEvent = dynamic_cast<QMouseEvent*>(event); mouseEvent != nullptr) {
if(mouseEvent->button() == m_backButton) {
MessageHistoryUndo().dispatch();
return true;
} else if(mouseEvent->button() == m_forwardButton) {
MessageHistoryRedo().dispatch();
return true;
}
}
}

return QObject::eventFilter(obj, event);
}


QtMainWindow::QtMainWindow() : m_windowStack(this) {
setObjectName(QStringLiteral("QtMainWindow"));
Expand All @@ -118,11 +77,11 @@ QtMainWindow::QtMainWindow() : m_windowStack(this) {
setWindowFlags(Qt::Widget);

if(auto* app = dynamic_cast<QApplication*>(QCoreApplication::instance()); app != nullptr) {
app->installEventFilter(new MouseReleaseFilter(this));
app->installEventFilter(new MouseReleaseFilter{this});

refreshStyle();

if(utility::getOsType() != OsType::Mac) {
if constexpr(utility::getOsType() != OsType::Mac) {
// can only be done once, because resetting the style on the QCoreApplication causes crash
app->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiDirectoryPath().concatenate(L"main/scrollbar.css")).c_str());
}
Expand Down
59 changes: 17 additions & 42 deletions src/lib_gui/qt/window/MainWindow/QtMainWindow.h
Original file line number Diff line number Diff line change
@@ -1,54 +1,29 @@
#pragma once
#include <memory>
#include <utility>
#include <vector>

#include <QMainWindow>

#include "FilePath.h"
#include <qtclasshelpermacros.h>

#include "QtWindowStack.h"


class Bookmark;
class MessageBase;
class QDockWidget;
class View;
class QtViewToggle;
class FilePath;

class QtViewToggle : public QWidget {
Q_OBJECT

public:
explicit QtViewToggle(View* view, QWidget* parent = nullptr);
void clear();

public slots:
void toggledByAction();
void toggledByUI();

private:
View* m_view;
};


class MouseReleaseFilter : public QObject {
class QtMainWindow final : public QMainWindow {
Q_OBJECT

public:
explicit MouseReleaseFilter(QObject* parent);

protected:
bool eventFilter(QObject* obj, QEvent* event) override;

private:
size_t m_backButton;
size_t m_forwardButton;
};

QtMainWindow();

class QtMainWindow : public QMainWindow {
Q_OBJECT
Q_DISABLE_COPY_MOVE(QtMainWindow)

public:
QtMainWindow();
~QtMainWindow() override;

void addView(View* view);
Expand Down Expand Up @@ -156,11 +131,11 @@ private slots:
void activateBookmarkAction();

private:
struct DockWidget {
QDockWidget* widget;
View* view;
QAction* action;
QtViewToggle* toggle;
struct DockWidget final {
QDockWidget* widget = nullptr;
View* view = nullptr;
QAction* action = nullptr;
QtViewToggle* toggle = nullptr;
};

void setupEditMenu();
Expand All @@ -179,18 +154,18 @@ private slots:

std::vector<DockWidget> m_dockWidgets;

QMenu* m_viewMenu;
QAction* m_viewSeparator;
QMenu* m_viewMenu = nullptr;
QAction* m_viewSeparator = nullptr;

QMenu* m_historyMenu = nullptr;
std::vector<std::shared_ptr<MessageBase>> m_history;

QMenu* m_bookmarksMenu = nullptr;
std::vector<std::shared_ptr<Bookmark>> m_bookmarks;

QMenu* m_recentProjectsMenu;
QMenu* m_recentProjectsMenu = nullptr;

QAction* m_showTitleBarsAction;
QAction* m_showTitleBarsAction = nullptr;

bool m_showDockWidgetTitleBars = true;

Expand Down
26 changes: 26 additions & 0 deletions src/lib_gui/qt/window/MainWindow/QtViewToggle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "QtViewToggle.hpp"

#include "QtMainWindow.h"
#include "View.h"

QtViewToggle::QtViewToggle(View* view, QWidget* parent) : QWidget(parent), m_view(view) {}

void QtViewToggle::clear() {
m_view = nullptr;
}

void QtViewToggle::toggledByAction() {
if(m_view != nullptr) {
if(auto* window = dynamic_cast<QtMainWindow*>(parent()); window != nullptr) {
window->toggleView(m_view, true);
}
}
}

void QtViewToggle::toggledByUI() {
if(m_view != nullptr) {
if(auto* window = dynamic_cast<QtMainWindow*>(parent()); window != nullptr) {
window->toggleView(m_view, false);
}
}
}
19 changes: 19 additions & 0 deletions src/lib_gui/qt/window/MainWindow/QtViewToggle.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once
#include <QWidget>

class View;

class QtViewToggle : public QWidget {
Q_OBJECT

public:
explicit QtViewToggle(View* view, QWidget* parent = nullptr);
void clear();

public slots:
void toggledByAction();
void toggledByUI();

private:
View* m_view;
};