Merge with 'Beep6581/dev'

This commit is contained in:
Pandagrapher
2023-08-12 18:03:41 +02:00
132 changed files with 8909 additions and 3413 deletions

View File

@@ -136,6 +136,21 @@ bool PopUpCommon::insertEntryImpl(int position, const Glib::ustring& iconName, c
return true;
}
void PopUpCommon::setEmptyImage(const Glib::ustring &fileName)
{
emptyImageFilename = fileName;
if (getEntryCount()) {
return;
}
if (fileName.empty()) {
buttonImage->hide();
} else {
changeImage(emptyImageFilename, Glib::RefPtr<const Gio::Icon>());
buttonImage->show();
}
}
void PopUpCommon::removeEntry(int position)
{
if (position < 0 || position >= getEntryCount()) {
@@ -147,8 +162,13 @@ void PopUpCommon::removeEntry(int position)
button->get_style_context()->remove_class("Left");
arrowButton->hide();
hasMenu = false;
// Remove the button image.
buttonImage->hide();
if (emptyImageFilename.empty()) {
// Remove the button image.
buttonImage->hide();
} else {
// Show the empty icon.
changeImage(emptyImageFilename, Glib::RefPtr<const Gio::Icon>());
}
selected = -1;
}
else if (position < selected) {