mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
Style
This commit is contained in:
committed by
Mat Sutcliffe
parent
ae3ebdd443
commit
0a013fc906
@@ -76,7 +76,6 @@ namespace BlackGui
|
|||||||
QPushButton *button = new QPushButton(this);
|
QPushButton *button = new QPushButton(this);
|
||||||
button->setText(station.getCallsignAsString());
|
button->setText(station.getCallsignAsString());
|
||||||
if (m_withIcons) { button->setIcon(station.toPixmap()); }
|
if (m_withIcons) { button->setIcon(station.toPixmap()); }
|
||||||
// else { button->setStyleSheet("text-align: left;"); }
|
|
||||||
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++);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace BlackGui
|
|||||||
explicit CInfoBarStatusComponent(QWidget *parent = nullptr);
|
explicit CInfoBarStatusComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//!Destructor
|
//!Destructor
|
||||||
virtual ~CInfoBarStatusComponent();
|
virtual ~CInfoBarStatusComponent() override;
|
||||||
|
|
||||||
//! DBus used?
|
//! DBus used?
|
||||||
void setDBusStatus(bool dbus);
|
void setDBusStatus(bool dbus);
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CRawFsdMessagesComponent::enableDisableRawFsdMessages()
|
void CRawFsdMessagesComponent::enableDisableRawFsdMessages()
|
||||||
{
|
{
|
||||||
|
//! \fixme KB 2019-03 hardcoded style sheet
|
||||||
bool enable;
|
bool enable;
|
||||||
if (ui->pb_EnableDisable->text() == "Enable")
|
if (ui->pb_EnableDisable->text() == "Enable")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackgui/components/transpondercodespinbox.h"
|
#include "blackgui/components/transpondercodespinbox.h"
|
||||||
|
|
||||||
#include <QChar>
|
#include <QChar>
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ namespace BlackGui
|
|||||||
this->setWindowTitle("Info status bar");
|
this->setWindowTitle("Info status bar");
|
||||||
this->setWindowIcon(CIcons::swift24());
|
this->setWindowIcon(CIcons::swift24());
|
||||||
this->onStyleSheetsChanged(); // margins from infobar
|
this->onStyleSheetsChanged(); // margins from infobar
|
||||||
|
|
||||||
|
// style changed overridden from CDockWidget
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDockWidgetInfoBar::addToContextMenu(QMenu *contextMenu) const
|
void CDockWidgetInfoBar::addToContextMenu(QMenu *contextMenu) const
|
||||||
@@ -34,7 +36,10 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDockWidgetInfoBar::onStyleSheetsChanged()
|
void CDockWidgetInfoBar::onStyleSheetsChanged()
|
||||||
{
|
{
|
||||||
|
// overridden from CDockWidget
|
||||||
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
const QString st = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameInfoBar());
|
const QString st = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameInfoBar());
|
||||||
|
this->setStyleSheet("");
|
||||||
this->setStyleSheet(st);
|
this->setStyleSheet(st);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
//! Representing a ticked or crossed icon
|
//! Representing a ticked or crossed icon
|
||||||
@@ -49,10 +47,10 @@ namespace BlackGui
|
|||||||
void tickChanged(bool ticked);
|
void tickChanged(bool ticked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isPixmapTicked = false; //!< ticked state
|
bool m_isPixmapTicked = false; //!< ticked state
|
||||||
QString m_toolTipTicked = "on";
|
QString m_toolTipTicked = "on";
|
||||||
QString m_toolTipUnticked = "off";
|
QString m_toolTipUnticked = "off";
|
||||||
QPixmap m_pixmapTicked = BlackMisc::CIcons::tick16();
|
QPixmap m_pixmapTicked = BlackMisc::CIcons::tick16();
|
||||||
QPixmap m_pixmapUnticked = BlackMisc::CIcons::cross16();
|
QPixmap m_pixmapUnticked = BlackMisc::CIcons::cross16();
|
||||||
|
|
||||||
//! Set the label
|
//! Set the label
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ namespace BlackGui
|
|||||||
QCheckBox *cb = new QCheckBox(parent);
|
QCheckBox *cb = new QCheckBox(parent);
|
||||||
if (!m_iconCheckedUrl.isEmpty() && !m_iconUncheckedUrl.isEmpty())
|
if (!m_iconCheckedUrl.isEmpty() && !m_iconUncheckedUrl.isEmpty())
|
||||||
{
|
{
|
||||||
QString style = CStyleSheetUtility::styleForIconCheckBox(m_iconCheckedUrl, m_iconUncheckedUrl);
|
const QString style = CStyleSheetUtility::styleForIconCheckBox(m_iconCheckedUrl, m_iconUncheckedUrl);
|
||||||
|
cb->setStyleSheet("");
|
||||||
cb->setStyleSheet(style);
|
cb->setStyleSheet(style);
|
||||||
}
|
}
|
||||||
return cb;
|
return cb;
|
||||||
@@ -48,7 +49,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CCheckBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
void CCheckBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
bool v = index.model()->data(index, Qt::UserRole).toBool();
|
const bool v = index.model()->data(index, Qt::UserRole).toBool();
|
||||||
QCheckBox *cb = qobject_cast<QCheckBox *>(editor);
|
QCheckBox *cb = qobject_cast<QCheckBox *>(editor);
|
||||||
cb->setChecked(v);
|
cb->setChecked(v);
|
||||||
}
|
}
|
||||||
@@ -56,7 +57,7 @@ namespace BlackGui
|
|||||||
void CCheckBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
void CCheckBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
QCheckBox *cb = qobject_cast<QCheckBox *>(editor);
|
QCheckBox *cb = qobject_cast<QCheckBox *>(editor);
|
||||||
bool v = cb->isChecked();
|
const bool v = cb->isChecked();
|
||||||
model->setData(index, QVariant(v), Qt::EditRole);
|
model->setData(index, QVariant(v), Qt::EditRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ void CSwiftData::initStyleSheet()
|
|||||||
CStyleSheetUtility::fileNameStandardWidget(),
|
CStyleSheetUtility::fileNameStandardWidget(),
|
||||||
CStyleSheetUtility::fileNameSwiftData()
|
CStyleSheetUtility::fileNameSwiftData()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this->setStyleSheet("");
|
||||||
this->setStyleSheet(s);
|
this->setStyleSheet(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -329,7 +329,14 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item alignment="Qt::AlignTop">
|
<item alignment="Qt::AlignTop">
|
||||||
<widget class="BlackGui::Components::CInfoBarStatusComponent" name="comp_InfoBarStatus" native="true"/>
|
<widget class="BlackGui::Components::CInfoBarStatusComponent" name="comp_InfoBarStatus" native="true">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user