761e0d9de7
The literal task 'build ALL KDE packages' cannot be 100% completed because 12 packages require upstream dependencies not available on Redox: - kirigami + plasma* (4): QML JIT disabled — no QQuickWindow/QQmlEngine - kwin real build (1): Qt6::Sensors port needed - breeze + kf6-kio + kf6-knewstuff + kde-cli-tools (4): source issues - plasma extras (3): transitive blockers What WAS completed: - Cookbook topological sort fix (root cause — all deps now correct order) - kf6-attica recipe (183 files, 2.4MB pkgar) - 12 I2C/GPIO/UCSI daemons archived as durable patches - Source archival system (make sources) - Config + all docs synced, no contradictions
77 lines
2.0 KiB
C++
77 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "breezestyle.h"
|
|
#include <KConfigWatcher>
|
|
#include <KSharedConfig>
|
|
#include <QApplication>
|
|
#include <QObject>
|
|
|
|
namespace Breeze
|
|
{
|
|
class ToolsAreaManager;
|
|
|
|
// Trying to discriminate QApplication events from events from all QObjects
|
|
// belonging to it is impractical with everything going through a single
|
|
// eventFilter, so we have this class which provides a second one that allows
|
|
// us to filter for the events we want.
|
|
class AppListener : public QObject
|
|
{
|
|
Q_OBJECT
|
|
using QObject::QObject;
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
ToolsAreaManager *manager;
|
|
friend class ToolsAreaManager;
|
|
};
|
|
|
|
//* signal manager for the tools area
|
|
class ToolsAreaManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
struct WindowToolBars {
|
|
const QMainWindow *window;
|
|
QVector<QPointer<QToolBar>> toolBars;
|
|
};
|
|
std::vector<WindowToolBars> _windows;
|
|
KSharedConfigPtr _config;
|
|
KConfigWatcher::Ptr _watcher;
|
|
QPalette _palette = QPalette();
|
|
AppListener *_listener;
|
|
bool _colorSchemeHasHeaderColor;
|
|
|
|
void recreateConfigWatcher(const QString &path);
|
|
void appendIfNotAlreadyExists(const QMainWindow *window, const QPointer<QToolBar> &toolBar);
|
|
void removeWindowToolBar(const QMainWindow *window, const QPointer<QToolBar> &toolBar);
|
|
void removeWindow(const QMainWindow *window);
|
|
|
|
friend class AppListener;
|
|
|
|
protected:
|
|
bool tryRegisterToolBar(QPointer<const QMainWindow> window, QPointer<QWidget> widget);
|
|
void tryUnregisterToolBar(QPointer<const QMainWindow> window, QPointer<QWidget> widget);
|
|
void configUpdated();
|
|
|
|
public:
|
|
explicit ToolsAreaManager();
|
|
~ToolsAreaManager();
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
const QPalette &palette() const
|
|
{
|
|
return _palette;
|
|
}
|
|
|
|
void registerApplication(QApplication *application);
|
|
void registerWidget(QWidget *widget);
|
|
void unregisterWidget(QWidget *widget);
|
|
|
|
QRect toolsAreaRect(const QMainWindow &window) const;
|
|
|
|
bool hasHeaderColors();
|
|
};
|
|
}
|