TerminalStripBridge color can be edited.

This commit is contained in:
joshua
2022-01-18 11:24:07 +01:00
parent 7d33b48b3a
commit 683095173e
9 changed files with 193 additions and 9 deletions

View File

@@ -23,6 +23,30 @@ TerminalStripBridge::TerminalStripBridge(TerminalStrip *parent_strip) :
m_strip(parent_strip)
{}
/**
* @brief TerminalStripBridge::sharedRef
* @return a QSharedPointer of this
*/
QSharedPointer<TerminalStripBridge> TerminalStripBridge::sharedRef()
{
QSharedPointer<TerminalStripBridge> this_shared(this->weakRef());
if (this_shared.isNull())
{
this_shared = QSharedPointer<TerminalStripBridge>(this);
m_this_weak = this_shared.toWeakRef();
}
return this_shared;
}
/**
* @brief TerminalStripBridge::weakRef
* @return a QWeakPointer of this, weak pointer can be null
*/
QWeakPointer<TerminalStripBridge> TerminalStripBridge::weakRef() {
return m_this_weak;
}
/**
* @brief TerminalStripBridge::color
* @return The color of this bridge
@@ -31,6 +55,13 @@ QColor TerminalStripBridge::color() const {
return m_color;
}
void TerminalStripBridge::setColor(const QColor &color) {
m_color = color;
if (m_strip) {
m_strip->bridgeColorChanged(sharedRef());
}
}
/**
* @brief TerminalStripBridge::realTerminals
* @return the real terminals who are bridged by this bridge