mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
GI improvements
* add tag information to GI configuration * change tag identification to avoid keys reorderding
This commit is contained in:
parent
a3e7a84b92
commit
f7a6b86cae
@ -312,14 +312,12 @@ QString AWKeys::parsePattern(QString pattern) const
|
|||||||
// bars
|
// bars
|
||||||
for (auto bar : m_foundBars) {
|
for (auto bar : m_foundBars) {
|
||||||
GraphicalItem *item = keyOperator->giByKey(bar);
|
GraphicalItem *item = keyOperator->giByKey(bar);
|
||||||
if (item->isCustom())
|
QString image
|
||||||
pattern.replace(
|
= item->isCustom()
|
||||||
QString("$%1").arg(bar),
|
? item->image(AWPatternFunctions::expandLambdas(
|
||||||
item->image(AWPatternFunctions::expandLambdas(
|
item->bar(), aggregator, values, item->usedKeys()))
|
||||||
item->bar(), aggregator, values, item->usedKeys())));
|
: item->image(values[item->bar()]);
|
||||||
else
|
pattern.replace(QString("$%1").arg(bar), image);
|
||||||
pattern.replace(QString("$%1").arg(bar),
|
|
||||||
item->image(values[item->bar()]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare strings
|
// prepare strings
|
||||||
|
@ -370,7 +370,13 @@ void GraphicalItem::setUsedKeys(const QStringList _usedKeys)
|
|||||||
qCDebug(LOG_LIB) << "Used keys" << _usedKeys;
|
qCDebug(LOG_LIB) << "Used keys" << _usedKeys;
|
||||||
|
|
||||||
// remove dubs
|
// remove dubs
|
||||||
m_usedKeys = QSet<QString>::fromList(_usedKeys).toList();
|
// HACK converting to set may break order
|
||||||
|
m_usedKeys.clear();
|
||||||
|
for (auto key : _usedKeys) {
|
||||||
|
if (m_usedKeys.contains(key))
|
||||||
|
continue;
|
||||||
|
m_usedKeys.append(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -447,6 +453,7 @@ int GraphicalItem::showConfiguration(const QVariant args)
|
|||||||
|
|
||||||
ui->lineEdit_name->setText(name());
|
ui->lineEdit_name->setText(name());
|
||||||
ui->lineEdit_comment->setText(comment());
|
ui->lineEdit_comment->setText(comment());
|
||||||
|
ui->label_numberValue->setText(QString("%1").arg(number()));
|
||||||
ui->checkBox_custom->setChecked(m_custom);
|
ui->checkBox_custom->setChecked(m_custom);
|
||||||
ui->comboBox_value->addItems(tags);
|
ui->comboBox_value->addItems(tags);
|
||||||
if (m_custom) {
|
if (m_custom) {
|
||||||
@ -620,7 +627,7 @@ void GraphicalItem::translate()
|
|||||||
{
|
{
|
||||||
ui->label_name->setText(i18n("Name"));
|
ui->label_name->setText(i18n("Name"));
|
||||||
ui->label_comment->setText(i18n("Comment"));
|
ui->label_comment->setText(i18n("Comment"));
|
||||||
ui->label_count->setText(i18n("Points count"));
|
ui->label_number->setText(i18n("Tag"));
|
||||||
ui->checkBox_custom->setText(i18n("Use custom formula"));
|
ui->checkBox_custom->setText(i18n("Use custom formula"));
|
||||||
ui->label_value->setText(i18n("Value"));
|
ui->label_value->setText(i18n("Value"));
|
||||||
ui->label_customValue->setText(i18n("Value"));
|
ui->label_customValue->setText(i18n("Value"));
|
||||||
@ -629,6 +636,7 @@ void GraphicalItem::translate()
|
|||||||
ui->label_activeImageType->setText(i18n("Active image type"));
|
ui->label_activeImageType->setText(i18n("Active image type"));
|
||||||
ui->label_inactiveImageType->setText(i18n("Inctive image type"));
|
ui->label_inactiveImageType->setText(i18n("Inctive image type"));
|
||||||
ui->label_type->setText(i18n("Type"));
|
ui->label_type->setText(i18n("Type"));
|
||||||
|
ui->label_count->setText(i18n("Points count"));
|
||||||
ui->label_direction->setText(i18n("Direction"));
|
ui->label_direction->setText(i18n("Direction"));
|
||||||
ui->label_height->setText(i18n("Height"));
|
ui->label_height->setText(i18n("Height"));
|
||||||
ui->label_width->setText(i18n("Width"));
|
ui->label_width->setText(i18n("Width"));
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>416</width>
|
<width>416</width>
|
||||||
<height>540</height>
|
<height>569</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -60,6 +60,27 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="layout_number">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_number">
|
||||||
|
<property name="text">
|
||||||
|
<string>Tag</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_numberValue">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_2">
|
<widget class="Line" name="line_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user