mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-05 01:45:53 +00:00
Rename some properties in GI.
Actually properties height and width are QDialog ones, just rename them to ones with `item` prefix. No configuration keys were changed. Update translations as well.
This commit is contained in:
@ -30,8 +30,8 @@ public:
|
||||
explicit AWAbstractFormatter(QWidget *parent = nullptr,
|
||||
const QString filePath = QString());
|
||||
virtual ~AWAbstractFormatter();
|
||||
void copyDefaults(AbstractExtItem *_other) const;
|
||||
virtual QString convert(const QVariant &_value) const = 0;
|
||||
void copyDefaults(AbstractExtItem *_other) const;
|
||||
QString uniq() const;
|
||||
// properties
|
||||
QString type() const;
|
||||
|
@ -77,13 +77,13 @@ GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
|
||||
item->setCount(m_count);
|
||||
item->setCustom(m_custom);
|
||||
item->setDirection(m_direction);
|
||||
item->setHeight(m_height);
|
||||
item->setItemHeight(m_height);
|
||||
item->setInactiveColor(m_inactiveColor);
|
||||
item->setMaxValue(m_maxValue);
|
||||
item->setMinValue(m_minValue);
|
||||
item->setNumber(_number);
|
||||
item->setType(m_type);
|
||||
item->setWidth(m_width);
|
||||
item->setItemWidth(m_width);
|
||||
|
||||
return item;
|
||||
}
|
||||
@ -152,24 +152,36 @@ QString GraphicalItem::activeColor() const
|
||||
}
|
||||
|
||||
|
||||
QString GraphicalItem::inactiveColor() const
|
||||
{
|
||||
return m_inactiveColor;
|
||||
}
|
||||
|
||||
|
||||
int GraphicalItem::count() const
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
|
||||
QString GraphicalItem::inactiveColor() const
|
||||
{
|
||||
return m_inactiveColor;
|
||||
}
|
||||
|
||||
|
||||
bool GraphicalItem::isCustom() const
|
||||
{
|
||||
return m_custom;
|
||||
}
|
||||
|
||||
|
||||
int GraphicalItem::itemHeight() const
|
||||
{
|
||||
return m_height;
|
||||
}
|
||||
|
||||
|
||||
int GraphicalItem::itemWidth() const
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
|
||||
|
||||
float GraphicalItem::maxValue() const
|
||||
{
|
||||
return m_maxValue;
|
||||
@ -235,24 +247,12 @@ QString GraphicalItem::strDirection() const
|
||||
}
|
||||
|
||||
|
||||
int GraphicalItem::height() const
|
||||
{
|
||||
return m_height;
|
||||
}
|
||||
|
||||
|
||||
QStringList GraphicalItem::usedKeys() const
|
||||
{
|
||||
return m_usedKeys;
|
||||
}
|
||||
|
||||
|
||||
int GraphicalItem::width() const
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
|
||||
|
||||
QString GraphicalItem::uniq() const
|
||||
{
|
||||
return m_bar;
|
||||
@ -301,6 +301,26 @@ void GraphicalItem::setInactiveColor(const QString _color)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setItemHeight(const int _height)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Height" << _height;
|
||||
if (_height <= 0)
|
||||
return;
|
||||
|
||||
m_height = _height;
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setItemWidth(const int _width)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Width" << _width;
|
||||
if (_width <= 0)
|
||||
return;
|
||||
|
||||
m_width = _width;
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setMaxValue(const float _value)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Max value" << _value;
|
||||
@ -361,16 +381,6 @@ void GraphicalItem::setStrDirection(const QString _direction)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setHeight(const int _height)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Height" << _height;
|
||||
if (_height <= 0)
|
||||
return;
|
||||
|
||||
m_height = _height;
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setUsedKeys(const QStringList _usedKeys)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Used keys" << _usedKeys;
|
||||
@ -386,16 +396,6 @@ void GraphicalItem::setUsedKeys(const QStringList _usedKeys)
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::setWidth(const int _width)
|
||||
{
|
||||
qCDebug(LOG_LIB) << "Width" << _width;
|
||||
if (_width <= 0)
|
||||
return;
|
||||
|
||||
m_width = _width;
|
||||
}
|
||||
|
||||
|
||||
void GraphicalItem::readConfiguration()
|
||||
{
|
||||
AbstractExtItem::readConfiguration();
|
||||
@ -416,8 +416,8 @@ void GraphicalItem::readConfiguration()
|
||||
setStrType(settings.value(QString("X-AW-Type"), strType()).toString());
|
||||
setStrDirection(
|
||||
settings.value(QString("X-AW-Direction"), strDirection()).toString());
|
||||
setHeight(settings.value(QString("X-AW-Height"), m_height).toInt());
|
||||
setWidth(settings.value(QString("X-AW-Width"), m_width).toInt());
|
||||
setItemHeight(settings.value(QString("X-AW-Height"), m_height).toInt());
|
||||
setItemWidth(settings.value(QString("X-AW-Width"), m_width).toInt());
|
||||
// api == 5
|
||||
if (apiVersion() < 5) {
|
||||
QString prefix;
|
||||
@ -490,8 +490,8 @@ int GraphicalItem::showConfiguration(const QVariant args)
|
||||
setInactiveColor(ui->lineEdit_inactiveColor->text());
|
||||
setStrType(ui->comboBox_type->currentText());
|
||||
setStrDirection(ui->comboBox_direction->currentText());
|
||||
setHeight(ui->spinBox_height->value());
|
||||
setWidth(ui->spinBox_width->value());
|
||||
setItemHeight(ui->spinBox_height->value());
|
||||
setItemWidth(ui->spinBox_width->value());
|
||||
|
||||
writeConfiguration();
|
||||
return ret;
|
||||
|
@ -40,13 +40,13 @@ class GraphicalItem : public AbstractExtItem
|
||||
Q_PROPERTY(int count READ count WRITE setCount)
|
||||
Q_PROPERTY(bool custom READ isCustom WRITE setCustom)
|
||||
Q_PROPERTY(QString inactiveColor READ inactiveColor WRITE setInactiveColor)
|
||||
Q_PROPERTY(int itemHeight READ itemHeight WRITE setItemHeight)
|
||||
Q_PROPERTY(int itemWidth READ itemWidth WRITE setItemWidth)
|
||||
Q_PROPERTY(Type type READ type WRITE setType)
|
||||
Q_PROPERTY(Direction direction READ direction WRITE setDirection)
|
||||
Q_PROPERTY(int height READ height WRITE setHeight)
|
||||
Q_PROPERTY(float maxValue READ maxValue WRITE setMaxValue)
|
||||
Q_PROPERTY(float minValue READ minValue WRITE setMinValue)
|
||||
Q_PROPERTY(QStringList usedKeys READ usedKeys WRITE setUsedKeys)
|
||||
Q_PROPERTY(int width READ width WRITE setWidth)
|
||||
|
||||
public:
|
||||
enum class Direction { LeftToRight = 0, RightToLeft = 1 };
|
||||
@ -60,18 +60,18 @@ public:
|
||||
// get methods
|
||||
QString bar() const;
|
||||
QString activeColor() const;
|
||||
QString inactiveColor() const;
|
||||
int count() const;
|
||||
QString inactiveColor() const;
|
||||
bool isCustom() const;
|
||||
int itemHeight() const;
|
||||
int itemWidth() const;
|
||||
float minValue() const;
|
||||
float maxValue() const;
|
||||
Type type() const;
|
||||
QString strType() const;
|
||||
Direction direction() const;
|
||||
QString strDirection() const;
|
||||
int height() const;
|
||||
QStringList usedKeys() const;
|
||||
int width() const;
|
||||
QString uniq() const;
|
||||
// set methods
|
||||
void setBar(const QString _bar = QString("cpu"));
|
||||
@ -80,15 +80,15 @@ public:
|
||||
void setCustom(const bool _custom = false);
|
||||
void setInactiveColor(const QString _color
|
||||
= QString("color://255,255,255,130"));
|
||||
void setItemHeight(const int _height = 100);
|
||||
void setItemWidth(const int _width = 100);
|
||||
void setMinValue(const float _value = 0.0);
|
||||
void setMaxValue(const float _value = 100.0);
|
||||
void setType(const Type _type = Type::Horizontal);
|
||||
void setStrType(const QString _type = QString("Horizontal"));
|
||||
void setDirection(const Direction _direction = Direction::LeftToRight);
|
||||
void setStrDirection(const QString _direction = QString("LeftToRight"));
|
||||
void setHeight(const int _height = 100);
|
||||
void setUsedKeys(const QStringList _usedKeys = QStringList());
|
||||
void setWidth(const int _width = 100);
|
||||
|
||||
public slots:
|
||||
void readConfiguration();
|
||||
|
Reference in New Issue
Block a user