mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T438, allow to collapse "Message to" button area and disable icons
This commit is contained in:
@@ -75,7 +75,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
QPushButton *button = new QPushButton(this);
|
QPushButton *button = new QPushButton(this);
|
||||||
button->setText(station.getCallsignAsString());
|
button->setText(station.getCallsignAsString());
|
||||||
button->setIcon(station.toPixmap());
|
if (m_withIcons) { button->setIcon(station.toPixmap()); }
|
||||||
QObject::connect(button, &QPushButton::released, this, &CAtcButtonComponent::onButtonClicked);
|
QObject::connect(button, &QPushButton::released, this, &CAtcButtonComponent::onButtonClicked);
|
||||||
const CVariant atcv = CVariant::fromValue(station);
|
const CVariant atcv = CVariant::fromValue(station);
|
||||||
layout->addWidget(button, row, col++);
|
layout->addWidget(button, row, col++);
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ namespace BlackGui
|
|||||||
//! Max.number
|
//! Max.number
|
||||||
void setMaxNumber(int number) { m_maxNumber = number; }
|
void setMaxNumber(int number) { m_maxNumber = number; }
|
||||||
|
|
||||||
|
//! With icons
|
||||||
|
void setWithIcons(bool withIcons) { m_withIcons = withIcons; }
|
||||||
|
|
||||||
//! Max.number
|
//! Max.number
|
||||||
int getMaxNumber() const { return m_maxNumber; }
|
int getMaxNumber() const { return m_maxNumber; }
|
||||||
|
|
||||||
@@ -66,6 +69,7 @@ namespace BlackGui
|
|||||||
void onButtonClicked();
|
void onButtonClicked();
|
||||||
|
|
||||||
QScopedPointer<Ui::CAtcButtonComponent> ui;
|
QScopedPointer<Ui::CAtcButtonComponent> ui;
|
||||||
|
bool m_withIcons = true;
|
||||||
bool m_ignoreNonAtc = true;
|
bool m_ignoreNonAtc = true;
|
||||||
bool m_backgroundUpdates = true;
|
bool m_backgroundUpdates = true;
|
||||||
int m_maxNumber = 8;
|
int m_maxNumber = 8;
|
||||||
|
|||||||
@@ -67,12 +67,16 @@ namespace BlackGui
|
|||||||
ui->tw_TextMessages->setCurrentIndex(0);
|
ui->tw_TextMessages->setCurrentIndex(0);
|
||||||
ui->lep_textMessages->setVisible(false);
|
ui->lep_textMessages->setVisible(false);
|
||||||
ui->tvp_TextMessagesAll->setResizeMode(CTextMessageView::ResizingAuto);
|
ui->tvp_TextMessagesAll->setResizeMode(CTextMessageView::ResizingAuto);
|
||||||
|
ui->comp_AtcStations->setWithIcons(false);
|
||||||
|
|
||||||
// lep_textMessages is the own line edit
|
// lep_textMessages is the own line edit
|
||||||
bool c = connect(ui->lep_textMessages, &CLineEditHistory::returnPressed, this, &CTextMessageComponent::textMessageEntered);
|
bool c = connect(ui->lep_textMessages, &CLineEditHistory::returnPressed, this, &CTextMessageComponent::textMessageEntered);
|
||||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
c = connect(ui->gb_Settings, &QGroupBox::toggled, this, &CTextMessageComponent::onSettingsChecked);
|
c = connect(ui->gb_Settings, &QGroupBox::toggled, this, &CTextMessageComponent::onSettingsChecked);
|
||||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
c = connect(ui->gb_MessageTo, &QGroupBox::toggled, this, &CTextMessageComponent::onMessageToChecked);
|
||||||
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
|
||||||
c = connect(ui->comp_AtcStations, &CAtcButtonComponent::requestAtcStation, this, &CTextMessageComponent::onAtcButtonClicked);
|
c = connect(ui->comp_AtcStations, &CAtcButtonComponent::requestAtcStation, this, &CTextMessageComponent::onAtcButtonClicked);
|
||||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
Q_ASSERT_X(c, Q_FUNC_INFO, "Missing connect");
|
||||||
|
|
||||||
@@ -237,6 +241,12 @@ namespace BlackGui
|
|||||||
ui->gb_Settings->setFlat(!checked);
|
ui->gb_Settings->setFlat(!checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CTextMessageComponent::onMessageToChecked(bool checked)
|
||||||
|
{
|
||||||
|
ui->comp_AtcStations->setVisible(checked);
|
||||||
|
ui->gb_MessageTo->setFlat(!checked);
|
||||||
|
}
|
||||||
|
|
||||||
void CTextMessageComponent::onSettingsChanged()
|
void CTextMessageComponent::onSettingsChanged()
|
||||||
{
|
{
|
||||||
QList<CTextMessageTextEdit *> textEdits = this->findAllTextEdit();
|
QList<CTextMessageTextEdit *> textEdits = this->findAllTextEdit();
|
||||||
|
|||||||
@@ -166,6 +166,9 @@ namespace BlackGui
|
|||||||
//! Settings have been checked (group box visible/invisible)
|
//! Settings have been checked (group box visible/invisible)
|
||||||
void onSettingsChecked(bool checked);
|
void onSettingsChecked(bool checked);
|
||||||
|
|
||||||
|
//! Message group box has been checked (group box visible/invisible)
|
||||||
|
void onMessageToChecked(bool checked);
|
||||||
|
|
||||||
//! Settings have been changed
|
//! Settings have been changed
|
||||||
void onSettingsChanged();
|
void onSettingsChanged();
|
||||||
|
|
||||||
|
|||||||
@@ -222,13 +222,43 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CAtcButtonComponent" name="comp_AtcStations">
|
<widget class="QGroupBox" name="gb_MessageTo">
|
||||||
<property name="frameShape">
|
<property name="title">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<string>Message to</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="checkable">
|
||||||
<enum>QFrame::Raised</enum>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="hl_MessageTo">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CAtcButtonComponent" name="comp_AtcStations">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user