Fix History dialog.

Cursor image missing.
This commit is contained in:
Roman Telezhynskyi 2024-01-27 15:29:06 +02:00
parent 4ec350693a
commit 1261708b06
3 changed files with 15 additions and 16 deletions

View file

@ -33,6 +33,7 @@
#include "../vgeometry/vellipticalarc.h"
#include "../vgeometry/vpointf.h"
#include "../vgeometry/vsplinepath.h"
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vtablesearch.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h"
@ -141,7 +142,7 @@ void DialogHistory::cellClicked(int row, int column)
item = ui->tableWidget->item(row, 0);
m_cursorRow = row;
item->setIcon(QIcon("://icon/32x32/put_after.png"));
item->setIcon(QIcon(VTheme::GetPixmapResource(QStringLiteral("icon"), QStringLiteral("32x32/put_after.png"))));
const auto id = qvariant_cast<quint32>(item->data(Qt::UserRole));
m_doc->blockSignals(true);
row == ui->tableWidget->rowCount() - 1 ? m_doc->setCursor(0) : m_doc->setCursor(id);
@ -176,7 +177,8 @@ void DialogHistory::ChangedCursor(quint32 id)
QTableWidgetItem *oldCursorItem = ui->tableWidget->item(m_cursorRow, 0);
oldCursorItem->setIcon(QIcon());
m_cursorRow = i;
item->setIcon(QIcon("://icon/32x32/put_after.png"));
item->setIcon(
QIcon(VTheme::GetPixmapResource(QStringLiteral("icon"), QStringLiteral("32x32/put_after.png"))));
}
}
}
@ -234,11 +236,12 @@ void DialogHistory::FillTable()
ui->tableWidget->setRowCount(count); // Real row count
if (count > 0)
{
ui->tableWidget->selectRow(0);
m_cursorRow = CursorRow();
QTableWidgetItem *item = ui->tableWidget->item(m_cursorRow, 0);
// cppcheck-suppress unknownMacro
SCASSERT(item != nullptr)
item->setIcon(QIcon("://icon/32x32/put_after.png"));
item->setIcon(QIcon(VTheme::GetPixmapResource(QStringLiteral("icon"), QStringLiteral("32x32/put_after.png"))));
}
ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->resizeRowsToContents();

View file

@ -41,8 +41,7 @@
<string notr="true"/>
</property>
<property name="icon">
<iconset theme="system-search">
<normaloff>.</normaloff>.</iconset>
<iconset theme="system-search"/>
</property>
<property name="shortcut">
<string>Alt+Down</string>
@ -94,7 +93,6 @@
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
@ -127,7 +125,6 @@
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -162,7 +159,6 @@
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -194,7 +190,6 @@
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -228,11 +223,10 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Find Previous &lt;span style=&quot; color:#888a85;&quot;&gt;%1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string notr="true"></string>
<string notr="true"/>
</property>
<property name="icon">
<iconset theme="go-up">
<normaloff>.</normaloff>.</iconset>
<iconset theme="go-up"/>
</property>
<property name="shortcut">
<string>Shift+F3</string>
@ -248,11 +242,10 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Find Next %1&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string notr="true"></string>
<string notr="true"/>
</property>
<property name="icon">
<iconset theme="go-down">
<normaloff>.</normaloff>.</iconset>
<iconset theme="go-down"/>
</property>
<property name="shortcut">
<string>F3</string>
@ -269,6 +262,9 @@
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>

View file

@ -527,7 +527,7 @@ auto VTheme::GetIconResource(const QString &root, const QString &iconName) -> QI
//---------------------------------------------------------------------------------------------------------------------
auto VTheme::GetPixmapResource(const QString &root, const QString &iconName) -> QPixmap
{
bool dark = (ColorSheme() == VColorSheme::Dark);
bool const dark = (ColorSheme() == VColorSheme::Dark);
return ::GetPixmapResource(root, iconName, dark);
}