entrypushbutton: explicitly search for max icon size
Αυτή η υποβολή περιλαμβάνεται σε:
γονέας
4c4b5280b9
υποβολή
69cc2710c3
@ -22,7 +22,16 @@ EntryPushButton::EntryPushButton(const EntryConfig &config) : QPushButton()
|
|||||||
this->setIcon(config.icon);
|
this->setIcon(config.icon);
|
||||||
if(!config.icon.availableSizes().isEmpty())
|
if(!config.icon.availableSizes().isEmpty())
|
||||||
{
|
{
|
||||||
this->setIconSize(config.icon.availableSizes().first());
|
auto sizes = config.icon.availableSizes();
|
||||||
|
QSize maxSize = sizes.first();
|
||||||
|
for(QSize ¤t : sizes)
|
||||||
|
{
|
||||||
|
if(current.width() > maxSize.width())
|
||||||
|
{
|
||||||
|
maxSize = current;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this->setIconSize(maxSize);
|
||||||
}
|
}
|
||||||
this->config = config;
|
this->config = config;
|
||||||
connect(this, SIGNAL(clicked()), this, SLOT(emitOwnClicked()));
|
connect(this, SIGNAL(clicked()), this, SLOT(emitOwnClicked()));
|
||||||
|
Φόρτωση…
Αναφορά σε νέο ζήτημα
Block a user