11#include "compositor.h"
16#include <QAbstractItemModel>
28 , m_allDesktops(false)
31 m_selectedIndexConnection = connect(tabBox, &TabBoxHandler::selectedIndexChanged,
this, [
this] {
36 connect(
workspace(), &Workspace::outputsChanged,
this, &SwitcherItem::screenGeometryChanged);
37 connect(Compositor::self(), &Compositor::compositingToggled,
this, &SwitcherItem::compositingChanged);
40SwitcherItem::~SwitcherItem()
42 disconnect(m_selectedIndexConnection);
45void SwitcherItem::setItem(QObject *item)
54void SwitcherItem::setModel(QAbstractItemModel *model)
57 Q_EMIT modelChanged();
60void SwitcherItem::setVisible(
bool visible)
62 if (m_visible == visible) {
66 Q_EMIT screenGeometryChanged();
69 Q_EMIT visibleChanged();
72QRect SwitcherItem::screenGeometry()
const
77void SwitcherItem::setCurrentIndex(
int index)
79 if (m_currentIndex == index) {
82 m_currentIndex = index;
86 Q_EMIT currentIndexChanged(m_currentIndex);
89void SwitcherItem::setAllDesktops(
bool all)
91 if (m_allDesktops == all) {
95 Q_EMIT allDesktopsChanged();
98void SwitcherItem::setNoModifierGrab(
bool set)
100 if (m_noModifierGrab == set) {
103 m_noModifierGrab = set;
104 Q_EMIT noModifierGrabChanged();
107bool SwitcherItem::automaticallyHide()
const
109 return m_automaticallyHide;
112void SwitcherItem::setAutomaticallyHide(
bool value)
114 if (m_automaticallyHide == value) {
117 m_automaticallyHide = value;
118 Q_EMIT automaticallyHideChanged();
121bool SwitcherItem::compositing()
123 return Compositor::compositing();
129#include "moc_switcheritem.cpp"
SwitcherItem(QObject *parent=nullptr)
const QModelIndex & currentIndex() const
void setCurrentIndex(const QModelIndex &index)
Output * activeOutput() const