WIP: multi selection property dialog

This commit is contained in:
Matthias Koefferlein 2022-10-08 00:44:18 +02:00
parent 187aae2649
commit fb5df27310
3 changed files with 14 additions and 8 deletions

View File

@ -457,12 +457,12 @@ PolygonPropertiesPage::description (size_t entry) const
size_t npts = count_polygon_points (sh);
if (sh.holes () == 0 && npts > 4) {
return ShapePropertiesPage::description () + " " + tl::sprintf (tl::to_string (tr ("Polygon(%d points)")), npts);
return ShapePropertiesPage::description (entry) + " " + tl::sprintf (tl::to_string (tr ("Polygon(%d points)")), npts);
} else if (sh.holes () > 0) {
return ShapePropertiesPage::description () + " " + tl::sprintf (tl::to_string (tr ("Polygon(%d points, %d holes)")), npts, sh.holes ());
return ShapePropertiesPage::description (entry) + " " + tl::sprintf (tl::to_string (tr ("Polygon(%d points, %d holes)")), npts, sh.holes ());
} else {
db::CplxTrans dbu_trans (dbu (entry));
return ShapePropertiesPage::description () + " " + tl::sprintf (tl::to_string (tr ("Polygon(%s)")), (dbu_trans * sh.polygon ()).to_string ());
return ShapePropertiesPage::description (entry) + " " + tl::sprintf (tl::to_string (tr ("Polygon(%s)")), (dbu_trans * sh.polygon ()).to_string ());
}
}
@ -639,7 +639,7 @@ BoxPropertiesPage::description (size_t entry) const
{
const db::Shape &sh = shape (entry);
db::CplxTrans dbu_trans (dbu (entry));
return ShapePropertiesPage::description () + " " + tl::sprintf (tl::to_string (tr ("Box(%s)")), (dbu_trans * sh.box ()).to_string ());
return ShapePropertiesPage::description (entry) + " " + tl::sprintf (tl::to_string (tr ("Box%s")), (dbu_trans * sh.box ()).to_string ());
}
void
@ -878,7 +878,7 @@ TextPropertiesPage::description (size_t entry) const
{
const db::Shape &sh = shape (entry);
db::CplxTrans dbu_trans (dbu (entry));
return ShapePropertiesPage::description () + " " + tl::sprintf (tl::to_string (tr ("Text(%s)")), (dbu_trans * sh.text ()).to_string ());
return ShapePropertiesPage::description (entry) + " " + tl::sprintf (tl::to_string (tr ("Text(%s)")), (dbu_trans * sh.text ()).to_string ());
}
void
@ -1028,7 +1028,7 @@ static std::string path_description (const db::Shape &sh, double dbu)
std::string
PathPropertiesPage::description (size_t entry) const
{
return ShapePropertiesPage::description () + " " + path_description (shape (entry), dbu (entry));
return ShapePropertiesPage::description (entry) + " " + path_description (shape (entry), dbu (entry));
}
void
@ -1132,7 +1132,7 @@ EditablePathPropertiesPage::text_changed ()
std::string
EditablePathPropertiesPage::description (size_t entry) const
{
return ShapePropertiesPage::description () + " " + path_description (shape (entry), dbu (entry));
return ShapePropertiesPage::description (entry) + " " + path_description (shape (entry), dbu (entry));
}
void

View File

@ -26,6 +26,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>12</height>
</size>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>

View File

@ -66,7 +66,7 @@ public:
if (index.internalId () < mp_dialog->properties_pages ().size ()) {
icon = mp_dialog->properties_pages () [index.internalId ()]->icon (index.row (), m_icon_width, m_icon_height);
} else {
icon = mp_dialog->properties_pages () [index.internalId ()]->icon (m_icon_width, m_icon_height);
icon = mp_dialog->properties_pages () [index.row ()]->icon (m_icon_width, m_icon_height);
}
if (! icon.isNull ()) {
return QVariant (icon);